-<?php
-
- global $CFG;
- require_once 'languages.php';
-
- $createoptions[0] = get_string("no");
- $createoptions[1] = get_string("yes");
-
- // set to defaults if undefined
- if (!isset ($config->hostname)) {
- $config->hostname = '';
- }
- if (!isset ($config->port)) {
- $config->port = '';
- }
- if (!isset ($config->casversion)) {
- $config->casversion = '';
- }
- if (!isset ($config->baseuri)) {
- $config->baseuri = '';
- }
- if (!isset ($config->language)) {
- $config->language = '';
- }
- if (!isset ($config->use_cas)) {
- $config->use_cas = '';
- }
- if (!isset ($config->auth_user_create)) {
- $config->auth_user_create = '0';
- }
- if (!isset ($config->create_user)) {
- $config->create_user = '0';
- }
- if (!isset($config->changepasswordurl)) {
- $config->changepasswordurl = '';
- }
-
-?>
-<table cellspacing="0" cellpadding="5" border="0">
-
-<tr>
- <td colspan="2">
- <h4><?php print_string('auth_cas_server_settings', 'auth') ?> </h4>
- </td>
-</tr>
-
-<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_cas_use_cas', 'auth') ?>:</td>
- <td>
- <?php
-
- unset($options);
- $options[1] = get_string('yes');
- choose_from_menu ($options, 'use_cas', $config->use_cas, get_string('no'), '', '');
-
- ?>
- </td>
- <td><?php print_string('auth_cas_enabled', 'auth') ?></td>
-</tr>
-
-<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_cas_hostname_key', 'auth') ?>:</td>
- <td>
- <input name="hostname" type="text" size="30" value="<?php echo $config->hostname ?>" />
- <?php
-
- if (isset($err['hostname'])) {
- formerr($err['hostname']);
- }
-
- ?>
- </td>
- <td><?php print_string('auth_cas_hostname', 'auth') ?></td>
-</tr>
-
-<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_cas_baseuri_key', 'auth') ?>:</td>
- <td>
- <input name="baseuri" type="text" size="30" value="<?php echo $config->baseuri ?>" />
- <?php
-
- if (isset($err['baseuri'])) {
- formerr($err['baseuri']);
- }
-
- ?>
- </td>
- <td><?php print_string('auth_cas_baseuri', 'auth') ?></td>
-</tr>
-
-<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_cas_port_key', 'auth') ?>:</td>
- <td>
- <input name="port" type="text" size="30" value="<?php echo $config->port ?>" />
- <?php
-
- if (isset($err['port'])) {
- formerr($err['port']);
- }
-
- ?>
- </td>
- <td><?php print_string('auth_cas_port', 'auth') ?></td>
-</tr>
-
-<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_cas_casversion', 'auth') ?>:</td>
- <td>
- <input name="casversion" type="text" size="30" value="<?php echo $config->casversion ?>" />
- <?php
-
- if (isset($err['casversion'])) {
- formerr($err['casversion']);
- }
-
- ?>
- </td>
- <td><?php print_string('auth_cas_version', 'auth') ?></td>
-</tr>
-
-<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_cas_language_key', 'auth') ?>:</td>
- <td>
- <?php
-
- choose_from_menu($CASLANGUAGES, 'language', $config->language, '');
-
- ?>
- </td>
- <td><?php print_string('auth_cas_language', 'auth') ?></td>
-</tr>
-
-<tr valign="top">
- <td align="right"><?php print_string('auth_cas_auth_user_create', 'auth') ?>: </td>
- <td>
- <?php
-
- choose_from_menu($createoptions, 'auth_user_create', $config->auth_user_create, '');
- if (isset($err['auth_user_create'])) {
- formerr($err['auth_user_create']);
- }
-
- ?>
- </td>
- <td>
- <?php print_string("auth_user_creation","auth"); ?>
- </td>
-</tr>
-
-<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_cas_create_user_key', 'auth') ?>:</td>
- <td>
- <?php
-
- unset($options);
- $options[0] = get_string('no');
- $options[1] = get_string('yes');
- choose_from_menu($options, 'create_user', $config->create_user, '');
-
- ?>
- </td>
- <td><?php print_string('auth_cas_create_user', 'auth') ?></td>
-</tr>
-
-<tr valign="top">
- <td align="right"><?php print_string('auth_cas_changepasswordurl', 'auth') ?>: </td>
- <td>
- <input name="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
- <?php
-
- if (isset($err['changepasswordurl'])) {
- formerr($err['changepasswordurl']);
- }
-
- ?>
- </td>
- <td><?php print_string('changepasswordhelp', 'auth') ?></td>
-</tr>
-
-</table>
-
-<?php
-
- $ldapplugin = get_auth_plugin('ldap');
- $ldapplugin->config_form(get_config('auth/ldap'), $err);
-
-?>
+<?php\r
+\r
+ global $CFG;\r
+ require_once 'languages.php';\r
+\r
+ $createoptions[0] = get_string("no");\r
+ $createoptions[1] = get_string("yes");\r
+\r
+ // set to defaults if undefined (CAS)\r
+ if (!isset ($config->hostname)) \r
+ $config->hostname = '';\r
+ if (!isset ($config->port)) \r
+ $config->port = '';\r
+ if (!isset ($config->casversion)) \r
+ $config->casversion = '';\r
+ if (!isset ($config->baseuri)) \r
+ $config->baseuri = '';\r
+ if (!isset ($config->language)) \r
+ $config->language = '';\r
+ if (!isset ($config->use_cas)) \r
+ $config->use_cas = '';\r
+ if (!isset ($config->proxycas)) \r
+ $config->proxycas = '';\r
+ if (!isset ($config->logoutcas)) \r
+ $config->logoutcas = '';\r
+ if (!isset ($config->multiauth))\r
+ $config->multiauth = '';\r
+ // set to defaults if undefined (LDAP)\r
+ if (!isset($config->host_url))\r
+ { $config->host_url = ''; }\r
+ if (empty($config->ldapencoding))\r
+ { $config->ldapencoding = 'utf-8'; }\r
+ if (!isset($config->contexts))\r
+ { $config->contexts = ''; }\r
+ if (!isset($config->user_type))\r
+ { $config->user_type = 'default'; }\r
+ if (!isset($config->user_attribute))\r
+ { $config->user_attribute = ''; }\r
+ if (!isset($config->search_sub))\r
+ { $config->search_sub = ''; }\r
+ if (!isset($config->opt_deref))\r
+ { $config->opt_deref = LDAP_DEREF_NEVER; }\r
+ if (!isset($config->bind_dn))\r
+ {$config->bind_dn = ''; }\r
+ if (!isset($config->bind_pw))\r
+ {$config->bind_pw = ''; }\r
+ if (!isset($config->version))\r
+ {$config->version = '2'; }\r
+ if (!isset($config->objectclass))\r
+ {$config->objectclass = ''; }\r
+ if (!isset($config->memberattribute))\r
+ {$config->memberattribute = ''; }\r
+ if (!isset($config->memberattribute_isdn))\r
+ {$config->memberattribute_isdn = ''; }\r
+ if (!isset($config->groupecreators))\r
+ {$config->groupecreators = ''; }\r
+ if (!isset($config->attrcreators))\r
+ {$config->attrcreators = ''; }\r
+ if (!isset($config->removeuser))\r
+ {$config->removeuser = 0; }\r
+\r
+ $yesno = array( get_string('no'), get_string('yes') );\r
+\r
+if (!function_exists('ldap_connect')) { // Is php4-ldap really there?\r
+ notify(get_string('auth_ldap_noextension','auth'));\r
+}\r
+\r
+\r
+?>\r
+\r
+<table cellspacing="0" cellpadding="5" border="0" align="center">\r
+\r
+<tr>\r
+ <td colspan="2">\r
+ <h4><?php print_string('auth_cas_server_settings', 'auth') ?> </h4>\r
+ </td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><?php print_string('auth_cas_use_cas', 'auth') ?>:</td>\r
+ <td>\r
+ <?php\r
+\r
+ unset($options);\r
+ $options[1] = get_string('yes');\r
+ choose_from_menu ($options, 'use_cas', $config->use_cas, get_string('no'), '', '');\r
+\r
+ ?>\r
+ </td>\r
+ <td><?php print_string('auth_cas_enabled', 'auth') ?></td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><?php print_string('auth_cas_hostname_key', 'auth') ?>:</td>\r
+ <td>\r
+ <input name="hostname" type="text" size="30" value="<?php echo $config->hostname ?>" />\r
+ <?php\r
+\r
+ if (isset($err['hostname'])) {\r
+ formerr($err['hostname']);\r
+ }\r
+\r
+ ?>\r
+ </td>\r
+ <td><?php print_string('auth_cas_hostname', 'auth') ?></td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><?php print_string('auth_cas_baseuri_key', 'auth') ?>:</td>\r
+ <td>\r
+ <input name="baseuri" type="text" size="30" value="<?php echo $config->baseuri ?>" />\r
+ <?php\r
+\r
+ if (isset($err['baseuri'])) {\r
+ formerr($err['baseuri']);\r
+ }\r
+\r
+ ?>\r
+ </td>\r
+ <td><?php print_string('auth_cas_baseuri', 'auth') ?></td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><?php print_string('auth_cas_port_key', 'auth') ?>:</td>\r
+ <td>\r
+ <input name="port" type="text" size="30" value="<?php echo $config->port ?>" />\r
+ <?php\r
+\r
+ if (isset($err['port'])) {\r
+ formerr($err['port']);\r
+ }\r
+\r
+ ?>\r
+ </td>\r
+ <td><?php print_string('auth_cas_port', 'auth') ?></td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><?php print_string('auth_cas_casversion', 'auth') ?>:</td>\r
+ <td>\r
+ <input name="casversion" type="text" size="30" value="<?php echo $config->casversion ?>" />\r
+ <?php\r
+\r
+ if (isset($err['casversion'])) {\r
+ formerr($err['casversion']);\r
+ }\r
+\r
+ ?>\r
+ </td>\r
+ <td><?php print_string('auth_cas_version', 'auth') ?></td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><?php print_string('auth_cas_language_key', 'auth') ?>:</td>\r
+ <td>\r
+ <?php\r
+\r
+ choose_from_menu($CASLANGUAGES, 'language', $config->language, '');\r
+\r
+ ?>\r
+ </td>\r
+ <td><?php print_string('auth_cas_language', 'auth') ?></td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><?php print_string('auth_cas_proxycas_key', 'auth') ?>:</td>\r
+ <td>\r
+ <?php\r
+ unset($options);\r
+ $options[1] = get_string('yes');\r
+ choose_from_menu ($options, 'proxycas', $config->proxycas, get_string('no'), '', '');\r
+ ?>\r
+ </td>\r
+ <td><?php print_string('auth_cas_proxycas', 'auth') ?></td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><?php print_string('auth_cas_logoutcas_key', 'auth') ?>:</td>\r
+ <td>\r
+ <?php\r
+ unset($options);\r
+ $options[1] = get_string('yes');\r
+ choose_from_menu ($options, 'logoutcas', $config->logoutcas, get_string('no'), '', '');\r
+ ?>\r
+ </td>\r
+ <td><?php print_string('auth_cas_logoutcas', 'auth') ?></td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><?php print_string('auth_cas_multiauth_key', 'auth') ?>:</td>\r
+ <td>\r
+ <?php\r
+ unset($options);\r
+ $options[1] = get_string('yes');\r
+ choose_from_menu ($options, 'multiauth', $config->multiauth, get_string('no'), '', '');\r
+ ?>\r
+ </td>\r
+ <td><?php print_string('auth_cas_multiauth', 'auth') ?></td>\r
+</tr>\r
+\r
+<tr>\r
+ <td colspan="2">\r
+ <h4><?php print_string('auth_ldap_server_settings', 'auth') ?> </h4>\r
+ </td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><label for="host_url"><?php print_string('auth_ldap_host_url_key','auth') ?></label></td>\r
+ <td>\r
+ <input name="host_url" id="host_url" type="text" size="30" value="<?php echo $config->host_url?>" />\r
+ <?php if (isset($err['host_url'])) formerr($err['host_url']); ?>\r
+ </td>\r
+ <td>\r
+ <?php print_string('auth_ldap_host_url','auth') ?>\r
+ </td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><label for="menuversion"><?php print_string('auth_ldap_version_key','auth') ?></label></td>\r
+ <td>\r
+ <?php\r
+ $versions = array();\r
+ $versions[2] = '2';\r
+ $versions[3] = '3';\r
+ choose_from_menu($versions, 'version', $config->version, '');\r
+ if (isset($err['version'])) formerr($err['version']);\r
+ ?>\r
+ </td>\r
+ <td>\r
+ <?php print_string('auth_ldap_version','auth') ?>\r
+ </td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><label for="ldapencoding"><?php print_string("auth_ldap_ldap_encoding_key", "auth") ?></label></td>\r
+ <td>\r
+ <input id="ldapencoding" name="ldapencoding" type="text" value="<?php echo $config->ldapencoding ?>" />\r
+ <?php\r
+\r
+ if (isset($err['ldapencoding'])) {\r
+ formerr($err['ldapencoding']);\r
+ }\r
+\r
+ ?>\r
+ </td>\r
+ <td><?php print_string('auth_ldap_ldap_encoding', 'auth') ?></td>\r
+</tr>\r
+\r
+<tr>\r
+ <td colspan="2">\r
+ <h4><?php print_string('auth_ldap_bind_settings', 'auth') ?> </h4>\r
+ </td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><label for="bind_dn"><?php print_string('auth_ldap_bind_dn_key','auth') ?></label></td>\r
+ <td>\r
+ <input name="bind_dn" id="bind_dn" type="text" size="30" value="<?php echo $config->bind_dn?>" />\r
+ <?php if (isset($err['bind_dn'])) formerr($err['bind_dn']); ?>\r
+ </td><td>\r
+ <?php print_string('auth_ldap_bind_dn','auth') ?>\r
+ </td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><label for="bind_pw"><?php print_string('auth_ldap_bind_pw_key','auth') ?></label></td>\r
+ <td>\r
+ <input name="bind_pw" id="bind_pw" type="password" size="30" value="<?php echo $config->bind_pw?>" />\r
+ <?php if (isset($err['bind_pw'])) formerr($err['bind_pw']); ?>\r
+ </td><td>\r
+ <?php print_string('auth_ldap_bind_pw','auth') ?>\r
+ </td>\r
+</tr>\r
+\r
+<tr>\r
+ <td colspan="2">\r
+ <h4><?php print_string('auth_ldap_user_settings', 'auth') ?> </h4>\r
+ </td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><label for="menuuser_type"><?php print_string('auth_ldap_user_type_key','auth') ?></label></td>\r
+ <td>\r
+ <?php choose_from_menu($this->ldap_suppported_usertypes(), 'user_type', $config->user_type, ''); ?>\r
+ <?php if (isset($err['user_type'])) formerr($err['user_type']); ?>\r
+ </td>\r
+ <td>\r
+ <?php print_string('auth_ldap_user_type', 'auth') ?>\r
+ </td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><label for="contexts"><?php print_string('auth_ldap_contexts_key','auth') ?></label></td>\r
+ <td>\r
+ <input name="contexts" id="contexts" type="text" size="30" value="<?php echo $config->contexts?>" />\r
+ <?php if (isset($err['contexts'])) formerr($err['contexts']); ?>\r
+ </td>\r
+ <td>\r
+ <?php print_string('auth_ldap_contexts', 'auth') ?>\r
+ </td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><label for="menusearch_sub"><?php print_string('auth_ldap_search_sub_key','auth') ?></label></td>\r
+ <td>\r
+ <?php choose_from_menu($yesno, 'search_sub', $config->search_sub, ''); ?>\r
+ </td>\r
+ <td>\r
+ <?php print_string('auth_ldap_search_sub','auth') ?>\r
+ </td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><label for="menuopt_deref"><?php print_string('auth_ldap_opt_deref_key','auth') ?></label></td>\r
+ <td>\r
+ <?php\r
+ $opt_deref = array();\r
+ $opt_deref[LDAP_DEREF_NEVER] = get_string('no');\r
+ $opt_deref[LDAP_DEREF_ALWAYS] = get_string('yes');\r
+ choose_from_menu($opt_deref, 'opt_deref', $config->opt_deref, LDAP_DEREF_NEVER, '');\r
+ if (isset($err['opt_deref'])) formerr($err['opt_deref']);\r
+ ?>\r
+ </td>\r
+ <td>\r
+ <?php print_string('auth_ldap_opt_deref','auth') ?>\r
+ </td>\r
+</tr>\r
+\r
+\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><label for="user_attribute"><?php print_string('auth_ldap_user_attribute_key','auth') ?></label></td>\r
+ <td>\r
+ <input name="user_attribute" id="user_attribute" type="text" size="30" value="<?php echo $config->user_attribute?>" />\r
+ <?php if (isset($err['user_attribute'])) formerr($err['user_attribute']); ?>\r
+ </td>\r
+ <td>\r
+ <?php print_string('auth_ldap_user_attribute','auth') ?>\r
+ </td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><label for="memberattribute"><?php print_string('auth_ldap_memberattribute_key','auth') ?></label></td>\r
+ <td>\r
+ <input name="memberattribute" id="memberattribute" type="text" size="30" value="<?php echo $config->memberattribute?>" />\r
+ <?php if (isset($err['memberattribute'])) formerr($err['memberattribute']); ?>\r
+ </td><td>\r
+ <?php print_string('auth_ldap_memberattribute','auth') ?>\r
+ </td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><label for="memberattribute_isdn"><?php print_string('auth_ldap_memberattribute_isdn_key','auth') ?></label></td>\r
+ <td>\r
+ <input name="memberattribute_isdn" id="memberattribute_isdn" type="text" size="30" value="<?php echo $config->memberattribute_isdn?>" />\r
+ <?php if (isset($err['memberattribute_isdn'])) formerr($err['memberattribute_isdn']); ?>\r
+ </td><td>\r
+ <?php print_string('auth_ldap_memberattribute_isdn','auth') ?>\r
+ </td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><label for="objectclass"><?php print_string('auth_ldap_objectclass_key','auth') ?></label></td>\r
+ <td>\r
+ <input name="objectclass" id="objectclass" type="text" size="30" value="<?php echo $config->objectclass?>" />\r
+ <?php if (isset($err['objectclass'])) formerr($err['objectclass']); ?>\r
+ </td>\r
+ <td>\r
+ <?php print_string('auth_ldap_objectclass','auth') ?>\r
+ </td>\r
+</tr>\r
+\r
+<tr>\r
+ <td colspan="2">\r
+ <h4><?php print_string('coursecreators') ?> </h4>\r
+ </td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><label for="attrcreators_key"><?php print_string('auth_ldap_attrcreators_key','auth') ?></label></td>\r
+ <td>\r
+ <input name="attrcreators" id="attrcreators" type="text" size="30" value="<?php echo $config->attrcreators?>" />\r
+ <?php if (isset($err['attrcreators'])) formerr($err['attrcreators']); ?>\r
+ </td><td>\r
+ <?php print_string('auth_ldap_attrcreators','auth') ?>\r
+ </td>\r
+</tr>\r
+\r
+<tr valign="top" class="required">\r
+ <td align="right"><label for="groupecreators_key"><?php print_string('auth_ldap_groupecreators_key','auth') ?></label></td>\r
+ <td>\r
+ <input name="groupecreators" id="groupecreators" type="text" size="30" value="<?php echo $config->groupecreators?>" />\r
+ <?php if (isset($err['groupecreators'])) formerr($err['groupecreators']); ?>\r
+ </td><td>\r
+ <?php print_string('auth_ldap_groupecreators','auth') ?>\r
+ </td>\r
+</tr>\r
+\r
+<tr>\r
+ <td colspan="2">\r
+ <h4><?php print_string('auth_sync_script', 'auth') ?> </h4>\r
+ </td>\r
+</tr>\r
+\r
+<tr valign="top">\r
+ <td align="right"><label for="menuremoveuser"><?php print_string('auth_remove_user_key','auth') ?></label></td>\r
+ <td>\r
+ <?php\r
+ $deleteopt = array();\r
+ $deleteopt['0'] = get_string('auth_remove_keep','auth');\r
+ $deleteopt['1'] = get_string('auth_remove_suspend','auth');\r
+ $deleteopt['2'] = get_string('auth_remove_delete','auth');\r
+ choose_from_menu($deleteopt, 'removeuser', $config->removeuser, '');\r
+ ?>\r
+ </td>\r
+ <td>\r
+ <?php print_string('auth_remove_user','auth') ?>\r
+ </td>\r
+</tr>\r
+\r
+</table>\r
+\r
+<?php\r
+\r
+$help = get_string('auth_ldapextrafields','auth');\r
+$help .= get_string('auth_updatelocal_expl','auth');\r
+$help .= get_string('auth_fieldlock_expl','auth');\r
+$help .= get_string('auth_updateremote_expl','auth');\r
+$help .= '<hr />';\r
+$help .= get_string('auth_updateremote_ldap','auth');\r
+\r
+print_auth_lock_options('cas', $user_fields, $help, true, true);\r
+\r
+?>\r