moodle/auth/ldap/config.html

374 lines
12 KiB
HTML
Raw Normal View History

<?php
// Initialize vars
optional_variable($config->ldap_host_url, "");
optional_variable($config->ldap_contexts, "");
optional_variable($config->ldap_user_type, "");
optional_variable($config->ldap_user_attribute, "");
optional_variable($config->ldap_search_sub, "");
optional_variable($config->ldap_opt_deref, "");
optional_variable($config->ldap_preventpassindb, 0);
optional_variable($config->ldap_bind_dn, "");
optional_variable($config->ldap_bind_pw, "");
optional_variable($config->ldap_version, "2");
optional_variable($config->ldap_objectclass, "");
optional_variable($config->ldap_memberattribute, "");
optional_variable($config->ldap_creators, "");
optional_variable($config->ldap_create_context, "");
optional_variable($config->ldap_expiration, "");
2004-09-27 14:19:32 +00:00
optional_variable($config->ldap_expiration_warning, "10");
optional_variable($config->ldap_expireattr, "");
optional_variable($config->ldap_gracelogins, "");
optional_variable($config->ldap_graceattr, "");
optional_variable($config->auth_user_create, "");
optional_variable($config->auth_user_create, "");
optional_variable($config->auth_ldap_forcechangepassword, "");
optional_variable($config->auth_ldap_stdchangepassword, false);
if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
print '<tr><td><p align="center"><font color="red"><strong>Warning:
The PHP LDAP module does not seem to be present.
Please ensure it is installed and enabled.</strong></font></p></td></tr>';
}
?>
<tr>
<td colspan="2">
<h4><?php print_string("auth_ldap_server_settings", "auth") ?> </h4>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">ldap_host_url:</td>
<td>
<input name="ldap_host_url" type="text" size="30" value="<?php echo $config->ldap_host_url?>">
<?php if (isset($err["ldap_host_url"])) formerr($err["ldap_host_url"]); ?>
</td>
<td>
2003-09-09 05:37:39 +00:00
<?php print_string("auth_ldap_host_url","auth") ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">ldap_version:</td>
<td>
<?php
$versions[2] = "2";
$versions[3] = "3";
choose_from_menu($versions, "ldap_version", $config->ldap_version, "");
if (isset($err["ldap_version"])) formerr($err["ldap_version"]);
?>
</td>
<td>
<?php print_string("auth_ldap_version","auth") ?>
</td>
</tr>
<tr>
<td colspan="2">
<h4><?php print_string("auth_ldap_bind_settings", "auth") ?> </h4>
</td>
2004-09-12 01:34:24 +00:00
</tr>
<tr valign="top" class="required">
<td align="right">ldap_preventpassindb:</td>
<td>
<?php
$choices = array();
$choices["0"] = get_string("no");
$choices["1"] = get_string("yes");
choose_from_menu ($choices, "ldap_preventpassindb", $config->ldap_preventpassindb, "");
?>
</td><td>
<?php print_string("auth_ldap_preventpassindb","auth") ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">ldap_bind_dn:</td>
<td>
<input name="ldap_bind_dn" type="text" size="30" value="<?php echo $config->ldap_bind_dn?>">
<?php if (isset($err["ldap_bind_dn"])) formerr($err["ldap_bind_dn"]); ?>
</td><td>
<?php print_string("auth_ldap_bind_dn","auth") ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">ldap_bind_pw:</td>
<td>
<input name="ldap_bind_pw" type="password" size="30" value="<?php echo $config->ldap_bind_pw?>">
<?php if (isset($err["ldap_bind_pw"])) formerr($err["ldap_bind_pw"]); ?>
</td><td>
<?php print_string("auth_ldap_bind_pw","auth") ?>
</td>
</tr>
<tr>
<td colspan="2">
<h4><?php print_string("auth_ldap_user_settings", "auth") ?> </h4>
</td>
2004-09-12 01:34:24 +00:00
</tr>
<tr valign="top" class="required">
<td align="right">ldap_user_type:</td>
<td>
<?php choose_from_menu(auth_ldap_suppported_usertypes(), "ldap_user_type", $config->ldap_user_type, ""); ?>
<?php if (isset($err["ldap_user_type"])) formerr($err["ldap_user_type"]); ?>
</td>
<td>
<?php print_string("auth_ldap_user_type","auth") ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">ldap_contexts:</td>
<td>
<input name="ldap_contexts" type="text" size="30" value="<?php echo $config->ldap_contexts?>">
<?php if (isset($err["ldap_contexts"])) formerr($err["ldap_contexts"]); ?>
</td>
<td>
<?php print_string("auth_ldap_contexts","auth") ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">ldap_search_sub:</td>
<td>
<?php
$choices = array();
$choices["0"] = get_string("no");
$choices["1"] = get_string("yes");
choose_from_menu ($choices, "ldap_search_sub", $config->ldap_search_sub, "");
?>
<?php if (isset($err["ldap_search_sub"])) formerr($err["ldap_search_sub"]); ?>
</td>
<td>
<?php print_string("auth_ldap_search_sub","auth") ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">ldap_opt_deref:</td>
<td>
<?php
$opt_deref[LDAP_DEREF_NEVER] = get_string("no");
$opt_deref[LDAP_DEREF_ALWAYS] = get_string("yes");
choose_from_menu($opt_deref, "ldap_opt_deref", $config->ldap_opt_deref, LDAP_DEREF_NEVER);
if (isset($err["ldap_opt_deref"])) formerr($err["ldap_opt_deref"]);
?>
</td>
<td>
<?php print_string("auth_ldap_opt_deref","auth") ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">ldap_user_attribute:</td>
<td>
<input name="ldap_user_attribute" type="text" size="30" value="<?php echo $config->ldap_user_attribute?>">
2003-09-09 05:37:39 +00:00
<?php if (isset($err["ldap_user_attribute"])) formerr($err["ldap_user_attribute"]); ?>
</td>
<td>
2003-09-09 05:37:39 +00:00
<?php print_string("auth_ldap_user_attribute","auth") ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">ldap_memberattribute:</td>
<td>
<input name="ldap_memberattribute" type="text" size="30" value="<?php echo $config->ldap_memberattribute?>">
<?php if (isset($err["ldap_memberattribute"])) formerr($err["ldap_memberattribute"]); ?>
</td><td>
<?php print_string("auth_ldap_memberattribute","auth") ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">ldap_objectclass:</td>
<td>
<input name="ldap_objectclass" type="text" size="30" value="<?php echo $config->ldap_objectclass?>">
<?php if (isset($err["ldap_objectclass"])) formerr($err["ldap_objectclass"]); ?>
</td>
<td>
<?php print_string("auth_ldap_objectclass","auth") ?>
</td>
</tr>
<tr>
<td colspan="2">
<h4><?php print_string("forcechangepassword", "auth") ?> </h4>
</td>
</tr>
<tr valign="top" class="required">
<td align="right" valign="top"><?php print_string('forcechangepassword', 'auth') ?>:</td>
<td>
<select name="auth_ldap_forcechangepassword">
2004-09-27 14:19:32 +00:00
<option value="0" <?php echo ($config->auth_ldap_forcechangepassword ? '' : 'selected="yes"') ?> >
<?php print_string("no") ?></option>
2004-09-27 14:19:32 +00:00
<option value="1" <?php echo ($config->auth_ldap_forcechangepassword ? 'selected="yes"' : '') ?> >
<?php print_string("yes") ?></option>
</select><br>
</td>
<td align="left" valign="top">
<p><?php print_string('forcechangepasswordfirst_help', 'auth') ?></p>
</td>
</tr>
<tr valign="top" class="required">
<td align="right" valign="top"><?php print_string('stdchangepassword', 'auth') ?>:</td>
<td>
<select name="auth_ldap_stdchangepassword">
2004-09-27 14:19:32 +00:00
<option value="0" <?php echo ($config->auth_ldap_stdchangepassword ? '' : 'selected="yes"') ?> >
<?php print_string("no") ?></option>
2004-09-27 14:19:32 +00:00
<option value="1" <?php echo ($config->auth_ldap_stdchangepassword ? 'selected="yes"' : '') ?> >
<?php print_string("yes") ?></option>
</select><br>
</td>
<td align="left" valign="top">
<p><?php print_string('stdchangepassword_expl', 'auth') ?></p>
<p><?php print_string('stdchangepassword_explldap', 'auth') ?></p>
</td>
</tr>
<tr>
<td colspan="2">
<h4><?php print_string("auth_ldap_passwdexpire_settings", "auth") ?> </h4>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">ldap_expiration:</td>
<td>
<?php
$expiration['0'] = "No";
$expiration['1'] = "LDAP";
choose_from_menu($expiration, "ldap_expiration", $config->ldap_expiration, "");
if (isset($err["ldap_expiration"])) formerr($err["ldap_expiration"]);
?>
</td>
<td>
<?php print_string("auth_ldap_expiration_desc","auth") ?>
</td>
</tr>
2004-09-27 14:19:32 +00:00
<tr valign="top" class="required">
<td align="right">ldap_expiration_warning:</td>
2004-09-27 14:19:32 +00:00
<td>
<input name="ldap_expiration_warning" type="text" size="2" value="<?php echo $config->ldap_expiration_warning?>">
<?php if (isset($err["ldap_expiration_warning"])) formerr($err["ldap_expiration_warning"]);
?>
</td>
<td>
<?php print_string("auth_ldap_expiration_warning_desc","auth") ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">ldap_exprireattr:</td>
<td>
<input name="ldap_expireattr" type="text" size="30" value="<?php echo $config->ldap_expireattr?>">
<?php if (isset($err["ldap_expireattr"])) formerr($err["ldap_expireattr"]);
?>
</td>
<td>
<?php print_string("auth_ldap_expireattr_desc","auth") ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">ldap_gracelogins:</td>
<td>
<?php
$grace['0'] = get_string("no");
$grace['1'] = get_string("yes");
choose_from_menu($grace, "ldap_gracelogins", $config->ldap_gracelogins, "");
if (isset($err["ldap_expiration"])) formerr($err["ldap_expiration"]);
?>
</td>
<td>
<?php print_string("auth_ldap_gracelogins_desc","auth") ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">ldap_graceattr:</td>
<td>
<input name="ldap_graceattr" type="text" size="30" value="<?php echo $config->ldap_graceattr?>">
<?php if (isset($err["ldap_graceattr"])) formerr($err["ldap_graceattr"]);
?>
</td>
<td>
<?php print_string("auth_ldap_graceattr_desc","auth") ?>
</td>
</tr>
<tr>
<td colspan="2">
<h4><?php print_string("auth_user_create", "auth") ?> </h4>
</td>
2004-09-12 01:34:24 +00:00
</tr>
</tr>
<tr valign="top" class="required">
<td align="right">ldap_create_context:</td>
<td>
<input name="ldap_create_context" type="text" size="30" value="<?php echo $config->ldap_create_context?>">
<?php if (isset($err["ldap_create_context"])) formerr($err["ldap_create_context"]); ?>
</td><td>
<?php print_string("auth_ldap_create_context","auth") ?>
</td>
</tr>
<tr>
<td colspan="2">
<h4><?php print_string("coursecreators") ?> </h4>
</td>
2004-09-12 01:34:24 +00:00
</tr>
<tr valign="top" class="required">
<td align="right">ldap_creators:</td>
<td>
<input name="ldap_creators" type="text" size="30" value="<?php echo $config->ldap_creators?>">
2003-09-09 05:37:39 +00:00
<?php if (isset($err["ldap_creators"])) formerr($err["ldap_creators"]); ?>
</td><td>
2003-09-09 05:37:39 +00:00
<?php print_string("auth_ldap_creators","auth") ?>
</td>
</tr>
<?php
$help = get_string("auth_ldapextrafields","auth");
$help .= get_string("auth_updatelocal_expl","auth");
$help .= get_string("auth_fieldlock_expl","auth");
$help .= get_string("auth_updateremote_expl","auth");
$help .= '<hr />';
$help .= get_string("auth_updateremote_ldap","auth");
print_auth_lock_options($auth, $user_fields, $help, true, true);
?>
<tr valign="top" class="required">
<td align="right"><?php print_string("instructions", "auth") ?>:</td>
<td>
<textarea name="auth_instructions" cols="30" rows="10" wrap="virtual"><?php p($config->auth_instructions) ?></textarea>
</td>
<td>
2003-09-09 05:37:39 +00:00
<?php print_string("authinstructions","auth") ?>
<?php helpbutton("text", get_string("helptext")) ?>
</td>
</tr>