2016-08-18 04:43:57 +00:00
|
|
|
<?php
|
|
|
|
// This file is part of Moodle - http://moodle.org/
|
|
|
|
//
|
|
|
|
// Moodle is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Moodle is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Settings for the plugin.
|
|
|
|
*
|
|
|
|
* @package auth_userkey
|
|
|
|
* @copyright 2016 Dmitrii Metelkin (dmitriim@catalyst-au.net)
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
|
*/
|
|
|
|
|
|
|
|
$yesno = array(get_string('no'), get_string('yes'));
|
|
|
|
$fields = get_auth_plugin('userkey')->get_allowed_mapping_fields();
|
|
|
|
|
|
|
|
?>
|
|
|
|
<table cellspacing="0" cellpadding="5" border="0" class="generaltable">
|
|
|
|
<tr valign="top">
|
|
|
|
<?php $field = 'mappingfield' ?>
|
|
|
|
<td align="right"><label for="<?php echo $field ?>"><?php print_string($field, 'auth_userkey') ?></label></td>
|
|
|
|
<td>
|
|
|
|
<?php echo html_writer::select($fields, $field, $config->$field, false) ?>
|
|
|
|
<?php if (isset($err[$field])) { echo $OUTPUT->notification($err[$field], 'notifyfailure'); } ?>
|
|
|
|
<?php print_string($field.'_desc', 'auth_userkey') ?></td>
|
|
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
|
|
<?php $field = 'keylifetime' ?>
|
|
|
|
<td align="right"><label for="<?php echo $field ?>"><?php print_string($field, 'auth_userkey') ?></label></td>
|
2016-08-18 23:58:59 +00:00
|
|
|
<td><input type="text" size="4" name="<?php echo $field ?>" value="<?php print $config->$field ?>" placeholder="60"><br>
|
2016-08-18 04:43:57 +00:00
|
|
|
<?php if (isset($err[$field])) { echo $OUTPUT->notification($err[$field], 'notifyfailure'); } ?>
|
|
|
|
<?php print_string($field.'_desc', 'auth_userkey') ?></td>
|
|
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
|
|
<?php $field = 'iprestriction' ?>
|
|
|
|
<td align="right"><label for="<?php echo $field ?>"><?php print_string($field, 'auth_userkey') ?></label></td>
|
|
|
|
<td><?php echo html_writer::select($yesno, $field, $config->$field, false) ?>
|
|
|
|
<?php if (isset($err[$field])) { echo $OUTPUT->notification($err[$field], 'notifyfailure'); } ?>
|
|
|
|
<?php print_string($field.'_desc', 'auth_userkey')?></td>
|
|
|
|
</tr>
|
2016-08-19 00:49:38 +00:00
|
|
|
<tr valign="top">
|
|
|
|
<?php $field = 'redirecturl' ?>
|
|
|
|
<td align="right"><label for="<?php echo $field ?>"><?php print_string($field, 'auth_userkey') ?></label></td>
|
|
|
|
<td><input type="text" size="60" name="<?php echo $field ?>" value="<?php print $config->$field ?>" placeholder=""><br>
|
|
|
|
<?php if (isset($err[$field])) { echo $OUTPUT->notification($err[$field], 'notifyfailure'); } ?>
|
|
|
|
<?php print_string($field.'_desc', 'auth_userkey') ?></td>
|
|
|
|
</tr>
|
2016-08-18 04:43:57 +00:00
|
|
|
<!--UNCOMMENT FOLLOWING WHEN IMPLEMENT USER CREATION.-->
|
|
|
|
<!--<tr valign="top">-->
|
|
|
|
<!--<?php $field = 'createuser' ?>-->
|
|
|
|
<!--<td align="right"><label for="<?php echo $field ?>"><?php print_string($field, 'auth_userkey') ?></label></td>-->
|
|
|
|
<!--<td><?php echo html_writer::select($yesno, $field, $config->$field, false) ?>-->
|
|
|
|
<!--<?php if (isset($err[$field])) { echo $OUTPUT->notification($err[$field], 'notifyfailure'); } ?>-->
|
|
|
|
<!--<?php print_string($field.'_desc', 'auth_userkey')?></td>-->
|
|
|
|
<!--</tr>-->
|
|
|
|
</table>
|
|
|
|
|