3 include($CFG->dirroot
.'/auth/cas/languages.php');
5 // set to defaults if undefined (CAS)
6 if (!isset ($config->hostname
)) {
7 $config->hostname
= '';
9 if (!isset ($config->port
)) {
12 if (!isset ($config->casversion
)) {
13 $config->casversion
= CAS_VERSION_2_0
;
15 if (!isset ($config->baseuri
)) {
16 $config->baseuri
= '';
18 if (!isset ($config->language
)) {
19 $config->language
= '';
21 if (!isset ($config->proxycas
)) {
22 $config->proxycas
= '';
24 if (!isset ($config->logoutcas
)) {
25 $config->logoutcas
= '';
27 if (!isset ($config->multiauth
)) {
28 $config->multiauth
= '';
30 if (!isset ($config->certificate_check
)) {
31 $config->certificate_check
= '';
33 if (!isset ($config->certificate_path
)) {
34 $config->certificate_path
= '';
37 // set to defaults if undefined (LDAP)
38 if (!isset($config->host_url
)) {
39 $config->host_url
= '';
41 if (empty($config->ldapencoding
)) {
42 $config->ldapencoding
= 'utf-8';
44 if (!isset($config->contexts
)) {
45 $config->contexts
= '';
47 if (!isset($config->user_type
)) {
48 $config->user_type
= 'default';
50 if (!isset($config->user_attribute
)) {
51 $config->user_attribute
= '';
53 if (!isset($config->search_sub
)) {
54 $config->search_sub
= '';
56 if (!isset($config->opt_deref
)) {
57 $config->opt_deref
= LDAP_DEREF_NEVER
;
59 if (!isset($config->bind_dn
)) {
60 $config->bind_dn
= '';
62 if (!isset($config->bind_pw
)) {
63 $config->bind_pw
= '';
65 if (!isset($config->ldap_version
)) {
66 $config->ldap_version
= '3';
68 if (!isset($config->objectclass
)) {
69 $config->objectclass
= '';
71 if (!isset($config->memberattribute
)) {
72 $config->memberattribute
= '';
74 if (!isset($config->memberattribute_isdn
)) {
75 $config->memberattribute_isdn
= '';
77 if (!isset($config->groupecreators
)) {
78 $config->groupecreators
= '';
80 if (!isset($config->attrcreators
)) {
81 $config->attrcreators
= '';
83 if (!isset($config->removeuser
)) {
84 $config->removeuser
= AUTH_REMOVEUSER_KEEP
;
87 $yesno = array( get_string('no'), get_string('yes') );
90 <table cellspacing=
"0" cellpadding=
"5" border=
"0">
93 <h4><?php print_string('auth_cas_server_settings', 'auth_cas') ?></h4>
96 <tr valign=
"top" class=
"required">
97 <td align=
"right"><?php print_string('auth_cas_hostname_key', 'auth_cas') ?>:
</td>
99 <input name=
"hostname" type=
"text" size=
"30" value=
"<?php echo $config->hostname ?>" />
100 <?php
if (isset($err['hostname'])) { echo $OUTPUT->error_text($err['hostname']); } ?>
103 <?php print_string('auth_cas_hostname', 'auth_cas') ?>
106 <tr valign=
"top" class=
"required">
108 <?php print_string('auth_cas_baseuri_key', 'auth_cas') ?>:
111 <input name=
"baseuri" type=
"text" size=
"30" value=
"<?php echo $config->baseuri ?>" />
112 <?php
if (isset($err['baseuri'])) { echo $OUTPUT->error_text($err['baseuri']); } ?>
115 <?php print_string('auth_cas_baseuri', 'auth_cas') ?>
118 <tr valign=
"top" class=
"required">
120 <?php print_string('auth_cas_port_key', 'auth_cas') ?>:
123 <input name=
"port" type=
"text" size=
"30" value=
"<?php echo $config->port ?>" />
124 <?php
if (isset($err['port'])) { echo $OUTPUT->error_text($err['port']); } ?>
127 <?php print_string('auth_cas_port', 'auth_cas') ?>
130 <tr valign=
"top" class=
"required">
132 <?php print_string('auth_cas_casversion', 'auth_cas') ?>:
136 $casversions = array();
137 $casversions[CAS_VERSION_1_0
] = 'CAS 1.0';
138 $casversions[CAS_VERSION_2_0
] = 'CAS 2.0';
139 echo html_writer
::select($casversions, 'casversion', $config->casversion
, false);
140 if (isset($err['casversion'])) { echo $OUTPUT->error_text($err['casversion']); }
144 <?php print_string('auth_cas_version', 'auth_cas') ?>
147 <tr valign=
"top" class=
"required">
148 <td align=
"right"><?php print_string('auth_cas_language_key', 'auth_cas') ?>:
</td>
150 <?php echo html_writer
::select($CASLANGUAGES, 'language', $config->language
, false); ?>
153 <?php print_string('auth_cas_language', 'auth_cas') ?>
156 <tr valign=
"top" class=
"required">
158 <?php print_string('auth_cas_proxycas_key', 'auth_cas') ?>:
161 <?php echo html_writer
::select($yesno, 'proxycas', $config->proxycas
, false); ?>
164 <?php print_string('auth_cas_proxycas', 'auth_cas') ?>
167 <tr valign=
"top" class=
"required">
168 <td align=
"right"><?php print_string('auth_cas_logoutcas_key', 'auth_cas') ?>:
</td>
170 <?php echo html_writer
::select($yesno, 'logoutcas', $config->logoutcas
, false); ?>
173 <?php print_string('auth_cas_logoutcas', 'auth_cas') ?>
176 <tr valign=
"top" class=
"required">
177 <td align=
"right"><?php print_string('auth_cas_multiauth_key', 'auth_cas') ?>:
</td>
179 <?php echo html_writer
::select($yesno, 'multiauth', $config->multiauth
, false); ?>
182 <?php print_string('auth_cas_multiauth', 'auth_cas') ?>
185 <tr valign=
"top" class=
"required">
186 <td align=
"right"><?php print_string('auth_cas_certificate_check_key', 'auth_cas') ?>:
</td>
188 <?php echo html_writer
::select($yesno, 'certificate_check', $config->certificate_check
, false); ?>
191 <?php print_string('auth_cas_certificate_check', 'auth_cas') ?>
194 <tr valign=
"top" class=
"required">
195 <td align=
"right"><?php print_string('auth_cas_certificate_path_key', 'auth_cas') ?>:
</td>
197 <input name=
"certificate_path" id=
"certificate_path" type=
"text" size=
"30" value=
"<?php echo $config->certificate_path ?>" />
198 <?php
if (isset($err['certificate_path'])) echo $OUTPUT->error_text($err['certificate_path']); ?>
201 <?php print_string('auth_cas_certificate_path', 'auth_cas') ?>
206 <h4><?php print_string('auth_ldap_server_settings', 'auth_ldap') ?></h4>
209 <tr valign=
"top" class=
"required">
211 <label for=
"host_url"><?php print_string('auth_ldap_host_url_key', 'auth_ldap') ?></label>
214 <input name=
"host_url" id=
"host_url" type=
"text" size=
"30" value=
"<?php echo $config->host_url?>" />
215 <?php
if (isset($err['host_url'])) { echo $OUTPUT->error_text($err['host_url']); } ?>
218 <?php print_string('auth_ldap_host_url', 'auth_ldap') ?>
221 <tr valign=
"top" class=
"required">
222 <td align=
"right"><label for=
"menuversion"><?php print_string('auth_ldap_version_key', 'auth_ldap') ?></label></td>
228 echo html_writer
::select($versions, 'ldap_version', $config->ldap_version
, false);
229 if (isset($err['ldap_version'])) { echo $OUTPUT->error_text($err['ldap_version']); }
233 <?php print_string('auth_ldap_version', 'auth_ldap') ?>
236 <tr valign=
"top" class=
"required">
238 <label for=
"ldapencoding"><?php print_string('auth_ldap_ldap_encoding_key', 'auth_ldap') ?></label>
241 <input id=
"ldapencoding" name=
"ldapencoding" type=
"text" value=
"<?php echo $config->ldapencoding ?>" />
242 <?php
if (isset($err['ldapencoding'])) { echo $OUTPUT->error_text($err['ldapencoding']); } ?>
245 <?php print_string('auth_ldap_ldap_encoding', 'auth_ldap') ?>
250 <h4><?php print_string('auth_ldap_bind_settings', 'auth_ldap') ?></h4>
253 <tr valign=
"top" class=
"required">
255 <label for=
"bind_dn"><?php print_string('auth_ldap_bind_dn_key', 'auth_ldap') ?></label>
258 <input name=
"bind_dn" id=
"bind_dn" type=
"text" size=
"30" value=
"<?php echo $config->bind_dn?>" />
259 <?php
if (isset($err['bind_dn'])) { echo $OUTPUT->error_text($err['bind_dn']); } ?>
262 <?php print_string('auth_ldap_bind_dn', 'auth_ldap') ?>
265 <tr valign=
"top" class=
"required">
267 <label for=
"bind_pw"><?php print_string('auth_ldap_bind_pw_key', 'auth_ldap') ?></label>
270 <input name=
"bind_pw" id=
"bind_pw" type=
"password" size=
"30" value=
"<?php echo $config->bind_pw?>" />
271 <?php
if (isset($err['bind_pw'])) { echo $OUTPUT->error_text($err['bind_pw']); } ?>
274 <?php print_string('auth_ldap_bind_pw', 'auth_ldap') ?>
279 <h4><?php print_string('auth_ldap_user_settings', 'auth_ldap') ?></h4>
282 <tr valign=
"top" class=
"required">
284 <label for=
"menuuser_type"><?php print_string('auth_ldap_user_type_key', 'auth_ldap') ?></label>
288 echo html_writer
::select(ldap_supported_usertypes(), 'user_type', $config->user_type
, false);
289 if (isset($err['user_type'])) { echo $OUTPUT->error_text($err['user_type']); }
293 <?php print_string('auth_ldap_user_type', 'auth_ldap') ?>
296 <tr valign=
"top" class=
"required">
298 <label for=
"contexts"><?php print_string('auth_ldap_contexts_key', 'auth_ldap') ?></label>
301 <input name=
"contexts" id=
"contexts" type=
"text" size=
"30" value=
"<?php echo $config->contexts?>" />
302 <?php
if (isset($err['contexts'])) { echo $OUTPUT->error_text($err['contexts']); } ?>
305 <?php print_string('auth_ldap_contexts', 'auth_ldap') ?>
308 <tr valign=
"top" class=
"required">
310 <label for=
"menusearch_sub"><?php print_string('auth_ldap_search_sub_key', 'auth_ldap') ?></label></td>
312 <?php echo html_writer
::select($yesno, 'search_sub', $config->search_sub
, false); ?>
315 <?php print_string('auth_ldap_search_sub', 'auth_ldap') ?>
318 <tr valign=
"top" class=
"required">
319 <td align=
"right"><label for=
"menuopt_deref"><?php print_string('auth_ldap_opt_deref_key', 'auth_ldap') ?></label></td>
322 $opt_deref = array();
323 $opt_deref[LDAP_DEREF_NEVER
] = get_string('no');
324 $opt_deref[LDAP_DEREF_ALWAYS
] = get_string('yes');
325 echo html_writer
::select($opt_deref, 'opt_deref', $config->opt_deref
, false);
326 if (isset($err['opt_deref'])) { echo $OUTPUT->error_text($err['opt_deref']); }
330 <?php print_string('auth_ldap_opt_deref', 'auth_ldap') ?>
333 <tr valign=
"top" class=
"required">
335 <label for=
"user_attribute"><?php print_string('auth_ldap_user_attribute_key', 'auth_ldap') ?></label>
338 <input name=
"user_attribute" id=
"user_attribute" type=
"text" size=
"30" value=
"<?php echo $config->user_attribute?>" />
339 <?php
if (isset($err['user_attribute'])) { echo $OUTPUT->error_text($err['user_attribute']); } ?>
342 <?php print_string('auth_ldap_user_attribute', 'auth_ldap') ?>
345 <tr valign=
"top" class=
"required">
347 <label for=
"memberattribute"><?php print_string('auth_ldap_memberattribute_key', 'auth_ldap') ?></label>
350 <input name=
"memberattribute" id=
"memberattribute" type=
"text" size=
"30" value=
"<?php echo $config->memberattribute?>" />
351 <?php
if (isset($err['memberattribute'])) { echo $OUTPUT->error_text($err['memberattribute']); } ?>
354 <?php print_string('auth_ldap_memberattribute', 'auth_ldap') ?>
357 <tr valign=
"top" class=
"required">
359 <label for=
"memberattribute_isdn"><?php print_string('auth_ldap_memberattribute_isdn_key', 'auth_ldap') ?></label>
362 <input name=
"memberattribute_isdn" id=
"memberattribute_isdn" type=
"text" size=
"30" value=
"<?php echo $config->memberattribute_isdn?>" />
363 <?php
if (isset($err['memberattribute_isdn'])) { echo $OUTPUT->error_text($err['memberattribute_isdn']); } ?>
366 <?php print_string('auth_ldap_memberattribute_isdn', 'auth_ldap') ?>
369 <tr valign=
"top" class=
"required">
371 <label for=
"objectclass"><?php print_string('auth_ldap_objectclass_key', 'auth_ldap') ?></label>
374 <input name=
"objectclass" id=
"objectclass" type=
"text" size=
"30" value=
"<?php echo $config->objectclass?>" />
375 <?php
if (isset($err['objectclass'])) { echo $OUTPUT->error_text($err['objectclass']); } ?>
378 <?php print_string('auth_ldap_objectclass', 'auth_ldap') ?>
383 <h4><?php print_string('coursecreators') ?></h4>
386 <tr valign=
"top" class=
"required">
388 <label for=
"attrcreators"><?php print_string('auth_ldap_attrcreators_key', 'auth_ldap') ?></label>
391 <input name=
"attrcreators" id=
"attrcreators" type=
"text" size=
"30" value=
"<?php echo $config->attrcreators?>" />
392 <?php
if (isset($err['attrcreators'])) { echo $OUTPUT->error_text($err['attrcreators']); } ?>
395 <?php print_string('auth_ldap_attrcreators', 'auth_ldap') ?>
398 <tr valign=
"top" class=
"required">
400 <label for=
"groupecreators"><?php print_string('auth_ldap_groupecreators_key', 'auth_ldap') ?></label>
403 <input name=
"groupecreators" id=
"groupecreators" type=
"text" size=
"30" value=
"<?php echo $config->groupecreators?>" />
404 <?php
if (isset($err['groupecreators'])) { echo $OUTPUT->error_text($err['groupecreators']); } ?>
407 <?php print_string('auth_ldap_groupecreators', 'auth_ldap') ?>
412 <h4><?php print_string('auth_sync_script', 'auth') ?></h4>
417 <label for=
"menuremoveuser"><?php print_string('auth_remove_user_key', 'auth') ?></label>
421 $deleteopt = array();
422 $deleteopt[AUTH_REMOVEUSER_KEEP
] = get_string('auth_remove_keep', 'auth');
423 $deleteopt[AUTH_REMOVEUSER_SUSPEND
] = get_string('auth_remove_suspend', 'auth');
424 $deleteopt[AUTH_REMOVEUSER_FULLDELETE
] = get_string('auth_remove_delete', 'auth');
425 echo html_writer
::select($deleteopt, 'removeuser', $config->removeuser
, false);
429 <?php print_string('auth_remove_user', 'auth') ?>
433 $help = get_string('auth_ldapextrafields', 'auth_ldap');
434 $help .= get_string('auth_updatelocal_expl', 'auth');
435 $help .= get_string('auth_fieldlock_expl', 'auth');
436 $help .= get_string('auth_updateremote_expl', 'auth');
438 $help .= get_string('auth_updateremote_ldap', 'auth');
440 print_auth_lock_options($this->authtype
, $user_fields, $help, true, true);