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
= '';
36 if (!isset($config->logout_return_url
)) {
37 $config->logout_return_url
= '';
40 // set to defaults if undefined (LDAP)
41 if (!isset($config->host_url
)) {
42 $config->host_url
= '';
44 if (!isset($config->start_tls
)) {
45 $config->start_tls
= false;
47 if (empty($config->ldapencoding
)) {
48 $config->ldapencoding
= 'utf-8';
50 if (!isset($config->pagesize
)) {
51 $config->pagesize
= LDAP_DEFAULT_PAGESIZE
;
53 if (!isset($config->contexts
)) {
54 $config->contexts
= '';
56 if (!isset($config->user_type
)) {
57 $config->user_type
= 'default';
59 if (!isset($config->user_attribute
)) {
60 $config->user_attribute
= '';
62 if (!isset($config->search_sub
)) {
63 $config->search_sub
= '';
65 if (!isset($config->opt_deref
)) {
66 $config->opt_deref
= LDAP_DEREF_NEVER
;
68 if (!isset($config->bind_dn
)) {
69 $config->bind_dn
= '';
71 if (!isset($config->bind_pw
)) {
72 $config->bind_pw
= '';
74 if (!isset($config->ldap_version
)) {
75 $config->ldap_version
= '3';
77 if (!isset($config->objectclass
)) {
78 $config->objectclass
= '';
80 if (!isset($config->memberattribute
)) {
81 $config->memberattribute
= '';
83 if (!isset($config->memberattribute_isdn
)) {
84 $config->memberattribute_isdn
= '';
86 if (!isset($config->groupecreators
)) {
87 $config->groupecreators
= '';
89 if (!isset($config->attrcreators
)) {
90 $config->attrcreators
= '';
92 if (!isset($config->removeuser
)) {
93 $config->removeuser
= AUTH_REMOVEUSER_KEEP
;
96 $yesno = array( get_string('no'), get_string('yes') );
99 if (!ldap_paged_results_supported($config->ldap_version
)) {
100 $disabled = ' disabled="disabled"';
101 echo $OUTPUT->notification(get_string('pagedresultsnotsupp', 'auth_ldap'));
105 <table cellspacing=
"0" cellpadding=
"5" border=
"0">
108 <h4><?php print_string('auth_cas_server_settings', 'auth_cas') ?></h4>
111 <tr valign=
"top" class=
"required">
112 <td align=
"right"><label for=
"hostname"><?php print_string('auth_cas_hostname_key', 'auth_cas') ?>:
</label></td>
114 <input name=
"hostname" id=
"hostname" type=
"text" size=
"30" value=
"<?php echo $config->hostname ?>" />
115 <?php
if (isset($err['hostname'])) { echo $OUTPUT->error_text($err['hostname']); } ?>
118 <?php print_string('auth_cas_hostname', 'auth_cas') ?>
121 <tr valign=
"top" class=
"required">
123 <label for=
"baseuri"><?php print_string('auth_cas_baseuri_key', 'auth_cas') ?>:
</label>
126 <input name=
"baseuri" id=
"baseuri" type=
"text" size=
"30" value=
"<?php echo $config->baseuri ?>" />
127 <?php
if (isset($err['baseuri'])) { echo $OUTPUT->error_text($err['baseuri']); } ?>
130 <?php print_string('auth_cas_baseuri', 'auth_cas') ?>
133 <tr valign=
"top" class=
"required">
135 <label for=
"port"><?php print_string('auth_cas_port_key', 'auth_cas') ?>:
</label>
138 <input name=
"port" id=
"port" type=
"text" size=
"30" value=
"<?php echo $config->port ?>" />
139 <?php
if (isset($err['port'])) { echo $OUTPUT->error_text($err['port']); } ?>
142 <?php print_string('auth_cas_port', 'auth_cas') ?>
145 <tr valign=
"top" class=
"required">
147 <?php echo html_writer
::label(get_string('auth_cas_casversion', 'auth_cas'), 'menucasversion'); ?>:
151 $casversions = array();
152 $casversions[CAS_VERSION_1_0
] = 'CAS 1.0';
153 $casversions[CAS_VERSION_2_0
] = 'CAS 2.0';
154 echo html_writer
::select($casversions, 'casversion', $config->casversion
, false);
155 if (isset($err['casversion'])) { echo $OUTPUT->error_text($err['casversion']); }
159 <?php print_string('auth_cas_version', 'auth_cas') ?>
162 <tr valign=
"top" class=
"required">
163 <td align=
"right"><?php echo html_writer
::label(get_string('auth_cas_language_key', 'auth_cas'), 'menulanguage'); ?>:
</td>
165 <?php echo html_writer
::select($CASLANGUAGES, 'language', $config->language
, false); ?>
168 <?php print_string('auth_cas_language', 'auth_cas') ?>
171 <tr valign=
"top" class=
"required">
173 <?php echo html_writer
::label(get_string('auth_cas_proxycas_key', 'auth_cas'), 'menuproxycas'); ?>:
176 <?php echo html_writer
::select($yesno, 'proxycas', $config->proxycas
, false); ?>
179 <?php print_string('auth_cas_proxycas', 'auth_cas') ?>
182 <tr valign=
"top" class=
"required">
183 <td align=
"right"><?php echo html_writer
::label(get_string('auth_cas_logoutcas_key', 'auth_cas'), 'menulogoutcas'); ?>:
</td>
185 <?php echo html_writer
::select($yesno, 'logoutcas', $config->logoutcas
, false); ?>
188 <?php print_string('auth_cas_logoutcas', 'auth_cas') ?>
191 <tr valign=
"top" class=
"required">
192 <td align=
"right"><?php echo html_writer
::label(get_string('auth_cas_multiauth_key', 'auth_cas'), 'menumultiauth'); ?>:
</td>
194 <?php echo html_writer
::select($yesno, 'multiauth', $config->multiauth
, false); ?>
197 <?php print_string('auth_cas_multiauth', 'auth_cas') ?>
200 <tr valign=
"top" class=
"required">
201 <td align=
"right"><?php echo html_writer
::label(get_string('auth_cas_certificate_check_key', 'auth_cas'), 'menucertificate_check'); ?>:
</td>
203 <?php echo html_writer
::select($yesno, 'certificate_check', $config->certificate_check
, false); ?>
206 <?php print_string('auth_cas_certificate_check', 'auth_cas') ?>
209 <tr valign=
"top" class=
"required">
210 <td align=
"right"><label for=
"certificate_path"><?php print_string('auth_cas_certificate_path_key', 'auth_cas') ?>:
</label></td>
212 <input name=
"certificate_path" id=
"certificate_path" type=
"text" size=
"30" value=
"<?php echo $config->certificate_path ?>" />
213 <?php
if (isset($err['certificate_path'])) echo $OUTPUT->error_text($err['certificate_path']); ?>
216 <?php print_string('auth_cas_certificate_path', 'auth_cas') ?>
219 <tr valign=
"top" class=
"required">
220 <td align=
"right"><?php print_string('auth_cas_logout_return_url_key', 'auth_cas') ?>:
</td>
222 <input name=
"logout_return_url" type=
"text" size=
"30" value=
"<?php echo $config->logout_return_url ?>" />
223 <?php
if (isset($err['logout_return_url'])) { echo $OUTPUT->error_text($err['logout_return_url']); } ?>
226 <?php print_string('auth_cas_logout_return_url', 'auth_cas') ?>
231 <h4><?php print_string('auth_ldap_server_settings', 'auth_ldap') ?></h4>
234 <tr valign=
"top" class=
"required">
236 <label for=
"host_url"><?php print_string('auth_ldap_host_url_key', 'auth_ldap') ?></label>
239 <input name=
"host_url" id=
"host_url" type=
"text" size=
"30" value=
"<?php echo $config->host_url?>" />
240 <?php
if (isset($err['host_url'])) { echo $OUTPUT->error_text($err['host_url']); } ?>
243 <?php print_string('auth_ldap_host_url', 'auth_ldap') ?>
246 <tr valign=
"top" class=
"required">
247 <td align=
"right"><label for=
"ldap_version"><?php print_string('auth_ldap_version_key', 'auth_ldap') ?></label></td>
253 echo html_writer
::select($versions, 'ldap_version', $config->ldap_version
, false);
254 if (isset($err['ldap_version'])) { echo $OUTPUT->error_text($err['ldap_version']); }
258 <?php print_string('auth_ldap_version', 'auth_ldap') ?>
263 <label for=
"start_tls"><?php print_string('start_tls_key', 'auth_ldap') ?></label>
266 <?php echo html_writer
::select($yesno, 'start_tls', $config->start_tls
, false); ?>
269 <?php print_string('start_tls', 'auth_ldap') ?>
272 <tr valign=
"top" class=
"required">
274 <label for=
"ldapencoding"><?php print_string('auth_ldap_ldap_encoding_key', 'auth_ldap') ?></label>
277 <input id=
"ldapencoding" name=
"ldapencoding" type=
"text" value=
"<?php echo $config->ldapencoding ?>" />
278 <?php
if (isset($err['ldapencoding'])) { echo $OUTPUT->error_text($err['ldapencoding']); } ?>
281 <?php print_string('auth_ldap_ldap_encoding', 'auth_ldap') ?>
286 <label for=
"pagesize"><?php print_string('pagesize_key', 'auth_ldap') ?></label>
289 <input id=
"pagesize" name=
"pagesize" type=
"text" value=
"<?php echo $config->pagesize ?>" <?php
echo $disabled ?>/>
291 if (isset($err['pagesize'])) { echo $OUTPUT->error_text($err['pagesize']); }
293 // Don't loose the page size value (disabled fields are not submitted!)
295 <input id=
"pagesize" name=
"pagesize" type=
"hidden" value=
"<?php echo $config->pagesize ?>" />
299 <?php print_string('pagesize', 'auth_ldap') ?>
304 <h4><?php print_string('auth_ldap_bind_settings', 'auth_ldap') ?></h4>
307 <tr valign=
"top" class=
"required">
309 <label for=
"bind_dn"><?php print_string('auth_ldap_bind_dn_key', 'auth_ldap') ?></label>
312 <input name=
"bind_dn" id=
"bind_dn" type=
"text" size=
"30" value=
"<?php echo $config->bind_dn?>" />
313 <?php
if (isset($err['bind_dn'])) { echo $OUTPUT->error_text($err['bind_dn']); } ?>
316 <?php print_string('auth_ldap_bind_dn', 'auth_ldap') ?>
319 <tr valign=
"top" class=
"required">
321 <label for=
"bind_pw"><?php print_string('auth_ldap_bind_pw_key', 'auth_ldap') ?></label>
324 <input name=
"bind_pw" id=
"bind_pw" type=
"password" size=
"30" value=
"<?php echo $config->bind_pw?>" autocomplete
="off"/>
325 <?php
if (isset($err['bind_pw'])) { echo $OUTPUT->error_text($err['bind_pw']); } ?>
328 <?php print_string('auth_ldap_bind_pw', 'auth_ldap') ?>
333 <h4><?php print_string('auth_ldap_user_settings', 'auth_ldap') ?></h4>
336 <tr valign=
"top" class=
"required">
338 <label for=
"menuuser_type"><?php print_string('auth_ldap_user_type_key', 'auth_ldap') ?></label>
342 echo html_writer
::select(ldap_supported_usertypes(), 'user_type', $config->user_type
, false);
343 if (isset($err['user_type'])) { echo $OUTPUT->error_text($err['user_type']); }
347 <?php print_string('auth_ldap_user_type', 'auth_ldap') ?>
350 <tr valign=
"top" class=
"required">
352 <label for=
"contexts"><?php print_string('auth_ldap_contexts_key', 'auth_ldap') ?></label>
355 <input name=
"contexts" id=
"contexts" type=
"text" size=
"30" value=
"<?php echo $config->contexts?>" />
356 <?php
if (isset($err['contexts'])) { echo $OUTPUT->error_text($err['contexts']); } ?>
359 <?php print_string('auth_ldap_contexts', 'auth_ldap') ?>
362 <tr valign=
"top" class=
"required">
364 <label for=
"menusearch_sub"><?php print_string('auth_ldap_search_sub_key', 'auth_ldap') ?></label></td>
366 <?php echo html_writer
::select($yesno, 'search_sub', $config->search_sub
, false); ?>
369 <?php print_string('auth_ldap_search_sub', 'auth_ldap') ?>
372 <tr valign=
"top" class=
"required">
373 <td align=
"right"><label for=
"menuopt_deref"><?php print_string('auth_ldap_opt_deref_key', 'auth_ldap') ?></label></td>
376 $opt_deref = array();
377 $opt_deref[LDAP_DEREF_NEVER
] = get_string('no');
378 $opt_deref[LDAP_DEREF_ALWAYS
] = get_string('yes');
379 echo html_writer
::select($opt_deref, 'opt_deref', $config->opt_deref
, false);
380 if (isset($err['opt_deref'])) { echo $OUTPUT->error_text($err['opt_deref']); }
384 <?php print_string('auth_ldap_opt_deref', 'auth_ldap') ?>
387 <tr valign=
"top" class=
"required">
389 <label for=
"user_attribute"><?php print_string('auth_ldap_user_attribute_key', 'auth_ldap') ?></label>
392 <input name=
"user_attribute" id=
"user_attribute" type=
"text" size=
"30" value=
"<?php echo $config->user_attribute?>" />
393 <?php
if (isset($err['user_attribute'])) { echo $OUTPUT->error_text($err['user_attribute']); } ?>
396 <?php print_string('auth_ldap_user_attribute', 'auth_ldap') ?>
399 <tr valign=
"top" class=
"required">
401 <label for=
"memberattribute"><?php print_string('auth_ldap_memberattribute_key', 'auth_ldap') ?></label>
404 <input name=
"memberattribute" id=
"memberattribute" type=
"text" size=
"30" value=
"<?php echo $config->memberattribute?>" />
405 <?php
if (isset($err['memberattribute'])) { echo $OUTPUT->error_text($err['memberattribute']); } ?>
408 <?php print_string('auth_ldap_memberattribute', 'auth_ldap') ?>
411 <tr valign=
"top" class=
"required">
413 <label for=
"memberattribute_isdn"><?php print_string('auth_ldap_memberattribute_isdn_key', 'auth_ldap') ?></label>
416 <input name=
"memberattribute_isdn" id=
"memberattribute_isdn" type=
"text" size=
"30" value=
"<?php echo $config->memberattribute_isdn?>" />
417 <?php
if (isset($err['memberattribute_isdn'])) { echo $OUTPUT->error_text($err['memberattribute_isdn']); } ?>
420 <?php print_string('auth_ldap_memberattribute_isdn', 'auth_ldap') ?>
423 <tr valign=
"top" class=
"required">
425 <label for=
"objectclass"><?php print_string('auth_ldap_objectclass_key', 'auth_ldap') ?></label>
428 <input name=
"objectclass" id=
"objectclass" type=
"text" size=
"30" value=
"<?php echo $config->objectclass?>" />
429 <?php
if (isset($err['objectclass'])) { echo $OUTPUT->error_text($err['objectclass']); } ?>
432 <?php print_string('auth_ldap_objectclass', 'auth_ldap') ?>
437 <h4><?php print_string('coursecreators') ?></h4>
440 <tr valign=
"top" class=
"required">
442 <label for=
"attrcreators"><?php print_string('auth_ldap_attrcreators_key', 'auth_ldap') ?></label>
445 <input name=
"attrcreators" id=
"attrcreators" type=
"text" size=
"30" value=
"<?php echo $config->attrcreators?>" />
446 <?php
if (isset($err['attrcreators'])) { echo $OUTPUT->error_text($err['attrcreators']); } ?>
449 <?php print_string('auth_ldap_attrcreators', 'auth_ldap') ?>
452 <tr valign=
"top" class=
"required">
454 <label for=
"groupecreators"><?php print_string('auth_ldap_groupecreators_key', 'auth_ldap') ?></label>
457 <input name=
"groupecreators" id=
"groupecreators" type=
"text" size=
"30" value=
"<?php echo $config->groupecreators?>" />
458 <?php
if (isset($err['groupecreators'])) { echo $OUTPUT->error_text($err['groupecreators']); } ?>
461 <?php print_string('auth_ldap_groupecreators', 'auth_ldap') ?>
466 <h4><?php print_string('auth_sync_script', 'auth') ?></h4>
471 <label for=
"menuremoveuser"><?php print_string('auth_remove_user_key', 'auth') ?></label>
475 $deleteopt = array();
476 $deleteopt[AUTH_REMOVEUSER_KEEP
] = get_string('auth_remove_keep', 'auth');
477 $deleteopt[AUTH_REMOVEUSER_SUSPEND
] = get_string('auth_remove_suspend', 'auth');
478 $deleteopt[AUTH_REMOVEUSER_FULLDELETE
] = get_string('auth_remove_delete', 'auth');
479 echo html_writer
::select($deleteopt, 'removeuser', $config->removeuser
, false);
483 <?php print_string('auth_remove_user', 'auth') ?>
487 $help = get_string('auth_ldapextrafields', 'auth_ldap');
488 $help .= get_string('auth_updatelocal_expl', 'auth');
489 $help .= get_string('auth_fieldlock_expl', 'auth');
490 $help .= get_string('auth_updateremote_expl', 'auth');
492 $help .= get_string('auth_updateremote_ldap', 'auth');
494 print_auth_lock_options($this->authtype
, $user_fields, $help, true, true, $this->get_custom_user_profile_fields());