7 require_once 'languages.php';
11 $createoptions[0] = get_string("no");
13 $createoptions[1] = get_string("yes");
17 // set to defaults if undefined (CAS)
19 if (!isset ($config->hostname
))
21 $config->hostname
= '';
23 if (!isset ($config->port
))
27 if (!isset ($config->casversion
))
29 $config->casversion
= '';
31 if (!isset ($config->baseuri
))
33 $config->baseuri
= '';
35 if (!isset ($config->language
))
37 $config->language
= '';
39 if (!isset ($config->proxycas
))
41 $config->proxycas
= '';
43 if (!isset ($config->logoutcas
))
45 $config->logoutcas
= '';
47 if (!isset ($config->multiauth
))
49 $config->multiauth
= '';
51 // set to defaults if undefined (LDAP)
53 if (!isset($config->host_url
))
55 { $config->host_url
= ''; }
57 if (empty($config->ldapencoding
))
59 { $config->ldapencoding
= 'utf-8'; }
61 if (!isset($config->contexts
))
63 { $config->contexts
= ''; }
65 if (!isset($config->user_type
))
67 { $config->user_type
= 'default'; }
69 if (!isset($config->user_attribute
))
71 { $config->user_attribute
= ''; }
73 if (!isset($config->search_sub
))
75 { $config->search_sub
= ''; }
77 if (!isset($config->opt_deref
))
79 { $config->opt_deref
= LDAP_DEREF_NEVER
; }
81 if (!isset($config->bind_dn
))
83 {$config->bind_dn
= ''; }
85 if (!isset($config->bind_pw
))
87 {$config->bind_pw
= ''; }
89 if (!isset($config->version
))
91 {$config->version
= '2'; }
93 if (!isset($config->objectclass
))
95 {$config->objectclass
= ''; }
97 if (!isset($config->memberattribute
))
99 {$config->memberattribute
= ''; }
101 if (!isset($config->memberattribute_isdn
))
103 {$config->memberattribute_isdn
= ''; }
105 if (!isset($config->groupecreators
))
107 {$config->groupecreators
= ''; }
109 if (!isset($config->attrcreators
))
111 {$config->attrcreators
= ''; }
113 if (!isset($config->removeuser
))
115 {$config->removeuser
= 0; }
119 $yesno = array( get_string('no'), get_string('yes') );
123 if (!function_exists('ldap_connect')) { // Is php4-ldap really there?
125 notify(get_string('auth_ldap_noextension','auth'));
137 <table cellspacing=
"0" cellpadding=
"5" border=
"0" align=
"center">
145 <h4><?php print_string('auth_cas_server_settings', 'auth') ?> </h4>
151 <tr valign=
"top" class=
"required">
153 <td align=
"right"><?php print_string('auth_cas_hostname_key', 'auth') ?>:
</td>
157 <input name=
"hostname" type=
"text" size=
"30" value=
"<?php echo $config->hostname ?>" />
163 if (isset($err['hostname'])) {
165 formerr($err['hostname']);
175 <td><?php print_string('auth_cas_hostname', 'auth') ?></td>
181 <tr valign=
"top" class=
"required">
183 <td align=
"right"><?php print_string('auth_cas_baseuri_key', 'auth') ?>:
</td>
187 <input name=
"baseuri" type=
"text" size=
"30" value=
"<?php echo $config->baseuri ?>" />
193 if (isset($err['baseuri'])) {
195 formerr($err['baseuri']);
205 <td><?php print_string('auth_cas_baseuri', 'auth') ?></td>
211 <tr valign=
"top" class=
"required">
213 <td align=
"right"><?php print_string('auth_cas_port_key', 'auth') ?>:
</td>
217 <input name=
"port" type=
"text" size=
"30" value=
"<?php echo $config->port ?>" />
223 if (isset($err['port'])) {
225 formerr($err['port']);
235 <td><?php print_string('auth_cas_port', 'auth') ?></td>
241 <tr valign=
"top" class=
"required">
243 <td align=
"right"><?php print_string('auth_cas_casversion', 'auth') ?>:
</td>
247 <input name=
"casversion" type=
"text" size=
"30" value=
"<?php echo $config->casversion ?>" />
253 if (isset($err['casversion'])) {
255 formerr($err['casversion']);
265 <td><?php print_string('auth_cas_version', 'auth') ?></td>
271 <tr valign=
"top" class=
"required">
273 <td align=
"right"><?php print_string('auth_cas_language_key', 'auth') ?>:
</td>
281 choose_from_menu($CASLANGUAGES, 'language', $config->language
, '');
289 <td><?php print_string('auth_cas_language', 'auth') ?></td>
295 <tr valign=
"top" class=
"required">
297 <td align=
"right"><?php print_string('auth_cas_proxycas_key', 'auth') ?>:
</td>
305 $options[1] = get_string('yes');
307 choose_from_menu ($options, 'proxycas', $config->proxycas
, get_string('no'), '', '');
313 <td><?php print_string('auth_cas_proxycas', 'auth') ?></td>
319 <tr valign=
"top" class=
"required">
321 <td align=
"right"><?php print_string('auth_cas_logoutcas_key', 'auth') ?>:
</td>
329 $options[1] = get_string('yes');
331 choose_from_menu ($options, 'logoutcas', $config->logoutcas
, get_string('no'), '', '');
337 <td><?php print_string('auth_cas_logoutcas', 'auth') ?></td>
343 <tr valign=
"top" class=
"required">
345 <td align=
"right"><?php print_string('auth_cas_multiauth_key', 'auth') ?>:
</td>
353 $options[1] = get_string('yes');
355 choose_from_menu ($options, 'multiauth', $config->multiauth
, get_string('no'), '', '');
361 <td><?php print_string('auth_cas_multiauth', 'auth') ?></td>
371 <h4><?php print_string('auth_ldap_server_settings', 'auth') ?> </h4>
379 <tr valign=
"top" class=
"required">
381 <td align=
"right"><label for=
"host_url"><?php print_string('auth_ldap_host_url_key','auth') ?></label></td>
385 <input name=
"host_url" id=
"host_url" type=
"text" size=
"30" value=
"<?php echo $config->host_url?>" />
387 <?php
if (isset($err['host_url'])) formerr($err['host_url']); ?>
393 <?php print_string('auth_ldap_host_url','auth') ?>
401 <tr valign=
"top" class=
"required">
403 <td align=
"right"><label for=
"menuversion"><?php print_string('auth_ldap_version_key','auth') ?></label></td>
415 choose_from_menu($versions, 'version', $config->version
, '');
417 if (isset($err['version'])) formerr($err['version']);
425 <?php print_string('auth_ldap_version','auth') ?>
433 <tr valign=
"top" class=
"required">
435 <td align=
"right"><label for=
"ldapencoding"><?php print_string("auth_ldap_ldap_encoding_key", "auth") ?></label></td>
439 <input id=
"ldapencoding" name=
"ldapencoding" type=
"text" value=
"<?php echo $config->ldapencoding ?>" />
445 if (isset($err['ldapencoding'])) {
447 formerr($err['ldapencoding']);
457 <td><?php print_string('auth_ldap_ldap_encoding', 'auth') ?></td>
467 <h4><?php print_string('auth_ldap_bind_settings', 'auth') ?> </h4>
475 <tr valign=
"top" class=
"required">
477 <td align=
"right"><label for=
"bind_dn"><?php print_string('auth_ldap_bind_dn_key','auth') ?></label></td>
481 <input name=
"bind_dn" id=
"bind_dn" type=
"text" size=
"30" value=
"<?php echo $config->bind_dn?>" />
483 <?php
if (isset($err['bind_dn'])) formerr($err['bind_dn']); ?>
487 <?php print_string('auth_ldap_bind_dn','auth') ?>
495 <tr valign=
"top" class=
"required">
497 <td align=
"right"><label for=
"bind_pw"><?php print_string('auth_ldap_bind_pw_key','auth') ?></label></td>
501 <input name=
"bind_pw" id=
"bind_pw" type=
"password" size=
"30" value=
"<?php echo $config->bind_pw?>" />
503 <?php
if (isset($err['bind_pw'])) formerr($err['bind_pw']); ?>
507 <?php print_string('auth_ldap_bind_pw','auth') ?>
519 <h4><?php print_string('auth_ldap_user_settings', 'auth') ?> </h4>
527 <tr valign=
"top" class=
"required">
529 <td align=
"right"><label for=
"menuuser_type"><?php print_string('auth_ldap_user_type_key','auth') ?></label></td>
533 <?php choose_from_menu($this->ldap_suppported_usertypes(), 'user_type', $config->user_type
, ''); ?>
535 <?php if (isset($err['user_type'])) formerr($err['user_type']); ?>
541 <?php print_string('auth_ldap_user_type', 'auth') ?>
549 <tr valign=
"top" class=
"required">
551 <td align=
"right"><label for=
"contexts"><?php print_string('auth_ldap_contexts_key','auth') ?></label></td>
555 <input name=
"contexts" id=
"contexts" type=
"text" size=
"30" value=
"<?php echo $config->contexts?>" />
557 <?php
if (isset($err['contexts'])) formerr($err['contexts']); ?>
563 <?php print_string('auth_ldap_contexts', 'auth') ?>
571 <tr valign=
"top" class=
"required">
573 <td align=
"right"><label for=
"menusearch_sub"><?php print_string('auth_ldap_search_sub_key','auth') ?></label></td>
577 <?php choose_from_menu($yesno, 'search_sub', $config->search_sub
, ''); ?>
583 <?php print_string('auth_ldap_search_sub','auth') ?>
591 <tr valign=
"top" class=
"required">
593 <td align=
"right"><label for=
"menuopt_deref"><?php print_string('auth_ldap_opt_deref_key','auth') ?></label></td>
599 $opt_deref = array();
601 $opt_deref[LDAP_DEREF_NEVER
] = get_string('no');
603 $opt_deref[LDAP_DEREF_ALWAYS
] = get_string('yes');
605 choose_from_menu($opt_deref, 'opt_deref', $config->opt_deref
, LDAP_DEREF_NEVER
, '');
607 if (isset($err['opt_deref'])) formerr($err['opt_deref']);
615 <?php print_string('auth_ldap_opt_deref','auth') ?>
627 <tr valign=
"top" class=
"required">
629 <td align=
"right"><label for=
"user_attribute"><?php print_string('auth_ldap_user_attribute_key','auth') ?></label></td>
633 <input name=
"user_attribute" id=
"user_attribute" type=
"text" size=
"30" value=
"<?php echo $config->user_attribute?>" />
635 <?php
if (isset($err['user_attribute'])) formerr($err['user_attribute']); ?>
641 <?php print_string('auth_ldap_user_attribute','auth') ?>
649 <tr valign=
"top" class=
"required">
651 <td align=
"right"><label for=
"memberattribute"><?php print_string('auth_ldap_memberattribute_key','auth') ?></label></td>
655 <input name=
"memberattribute" id=
"memberattribute" type=
"text" size=
"30" value=
"<?php echo $config->memberattribute?>" />
657 <?php
if (isset($err['memberattribute'])) formerr($err['memberattribute']); ?>
661 <?php print_string('auth_ldap_memberattribute','auth') ?>
669 <tr valign=
"top" class=
"required">
671 <td align=
"right"><label for=
"memberattribute_isdn"><?php print_string('auth_ldap_memberattribute_isdn_key','auth') ?></label></td>
675 <input name=
"memberattribute_isdn" id=
"memberattribute_isdn" type=
"text" size=
"30" value=
"<?php echo $config->memberattribute_isdn?>" />
677 <?php
if (isset($err['memberattribute_isdn'])) formerr($err['memberattribute_isdn']); ?>
681 <?php print_string('auth_ldap_memberattribute_isdn','auth') ?>
689 <tr valign=
"top" class=
"required">
691 <td align=
"right"><label for=
"objectclass"><?php print_string('auth_ldap_objectclass_key','auth') ?></label></td>
695 <input name=
"objectclass" id=
"objectclass" type=
"text" size=
"30" value=
"<?php echo $config->objectclass?>" />
697 <?php
if (isset($err['objectclass'])) formerr($err['objectclass']); ?>
703 <?php print_string('auth_ldap_objectclass','auth') ?>
715 <h4><?php print_string('coursecreators') ?> </h4>
723 <tr valign=
"top" class=
"required">
725 <td align=
"right"><label for=
"attrcreators_key"><?php print_string('auth_ldap_attrcreators_key','auth') ?></label></td>
729 <input name=
"attrcreators" id=
"attrcreators" type=
"text" size=
"30" value=
"<?php echo $config->attrcreators?>" />
731 <?php
if (isset($err['attrcreators'])) formerr($err['attrcreators']); ?>
735 <?php print_string('auth_ldap_attrcreators','auth') ?>
743 <tr valign=
"top" class=
"required">
745 <td align=
"right"><label for=
"groupecreators_key"><?php print_string('auth_ldap_groupecreators_key','auth') ?></label></td>
749 <input name=
"groupecreators" id=
"groupecreators" type=
"text" size=
"30" value=
"<?php echo $config->groupecreators?>" />
751 <?php
if (isset($err['groupecreators'])) formerr($err['groupecreators']); ?>
755 <?php print_string('auth_ldap_groupecreators','auth') ?>
767 <h4><?php print_string('auth_sync_script', 'auth') ?> </h4>
777 <td align=
"right"><label for=
"menuremoveuser"><?php print_string('auth_remove_user_key','auth') ?></label></td>
783 $deleteopt = array();
785 $deleteopt['0'] = get_string('auth_remove_keep','auth');
787 $deleteopt['1'] = get_string('auth_remove_suspend','auth');
789 $deleteopt['2'] = get_string('auth_remove_delete','auth');
791 choose_from_menu($deleteopt, 'removeuser', $config->removeuser
, '');
799 <?php print_string('auth_remove_user','auth') ?>
809 $help = get_string('auth_ldapextrafields','auth');
811 $help .= get_string('auth_updatelocal_expl','auth');
813 $help .= get_string('auth_fieldlock_expl','auth');
815 $help .= get_string('auth_updateremote_expl','auth');
819 $help .= get_string('auth_updateremote_ldap','auth');
823 print_auth_lock_options('cas', $user_fields, $help, true, true);