[ Index ] |
PHP Cross Reference of Unnamed Project |
[Summary view] [Print] [Text view]
1 <?php 2 3 include($CFG->dirroot.'/auth/cas/languages.php'); 4 5 // set to defaults if undefined (CAS) 6 if (!isset ($config->hostname)) { 7 $config->hostname = ''; 8 } 9 if (!isset ($config->port)) { 10 $config->port = ''; 11 } 12 if (!isset ($config->casversion)) { 13 $config->casversion = CAS_VERSION_2_0; 14 } 15 if (!isset ($config->baseuri)) { 16 $config->baseuri = ''; 17 } 18 if (!isset ($config->language)) { 19 $config->language = ''; 20 } 21 if (!isset ($config->proxycas)) { 22 $config->proxycas = ''; 23 } 24 if (!isset ($config->logoutcas)) { 25 $config->logoutcas = ''; 26 } 27 if (!isset ($config->multiauth)) { 28 $config->multiauth = ''; 29 } 30 if (!isset ($config->certificate_check)) { 31 $config->certificate_check = ''; 32 } 33 if (!isset ($config->certificate_path)) { 34 $config->certificate_path = ''; 35 } 36 if (!isset($config->curl_ssl_version)) { 37 $config->curl_ssl_version = ''; 38 } 39 if (!isset($config->logout_return_url)) { 40 $config->logout_return_url = ''; 41 } 42 43 // set to defaults if undefined (LDAP) 44 if (!isset($config->host_url)) { 45 $config->host_url = ''; 46 } 47 if (!isset($config->start_tls)) { 48 $config->start_tls = false; 49 } 50 if (empty($config->ldapencoding)) { 51 $config->ldapencoding = 'utf-8'; 52 } 53 if (!isset($config->pagesize)) { 54 $config->pagesize = LDAP_DEFAULT_PAGESIZE; 55 } 56 if (!isset($config->contexts)) { 57 $config->contexts = ''; 58 } 59 if (!isset($config->user_type)) { 60 $config->user_type = 'default'; 61 } 62 if (!isset($config->user_attribute)) { 63 $config->user_attribute = ''; 64 } 65 if (!isset($config->search_sub)) { 66 $config->search_sub = ''; 67 } 68 if (!isset($config->opt_deref)) { 69 $config->opt_deref = LDAP_DEREF_NEVER; 70 } 71 if (!isset($config->bind_dn)) { 72 $config->bind_dn = ''; 73 } 74 if (!isset($config->bind_pw)) { 75 $config->bind_pw = ''; 76 } 77 if (!isset($config->ldap_version)) { 78 $config->ldap_version = '3'; 79 } 80 if (!isset($config->objectclass)) { 81 $config->objectclass = ''; 82 } 83 if (!isset($config->memberattribute)) { 84 $config->memberattribute = ''; 85 } 86 if (!isset($config->memberattribute_isdn)) { 87 $config->memberattribute_isdn = ''; 88 } 89 if (!isset($config->groupecreators)) { 90 $config->groupecreators = ''; 91 } 92 if (!isset($config->attrcreators)) { 93 $config->attrcreators = ''; 94 } 95 if (!isset($config->removeuser)) { 96 $config->removeuser = AUTH_REMOVEUSER_KEEP; 97 } 98 99 $yesno = array( get_string('no'), get_string('yes') ); 100 101 $disabled = ''; 102 if (!ldap_paged_results_supported($config->ldap_version)) { 103 $disabled = ' disabled="disabled"'; 104 echo $OUTPUT->notification(get_string('pagedresultsnotsupp', 'auth_ldap')); 105 } 106 107 ?> 108 <table cellspacing="0" cellpadding="5" border="0"> 109 <tr> 110 <td colspan="2"> 111 <h4><?php print_string('auth_cas_server_settings', 'auth_cas') ?></h4> 112 </td> 113 </tr> 114 <tr valign="top" class="required"> 115 <td align="right"><label for="hostname"><?php print_string('auth_cas_hostname_key', 'auth_cas') ?>: </label></td> 116 <td> 117 <input name="hostname" id="hostname" type="text" size="30" value="<?php echo $config->hostname ?>" /> 118 <?php if (isset($err['hostname'])) { echo $OUTPUT->error_text($err['hostname']); } ?> 119 </td> 120 <td> 121 <?php print_string('auth_cas_hostname', 'auth_cas') ?> 122 </td> 123 </tr> 124 <tr valign="top" class="required"> 125 <td align="right"> 126 <label for="baseuri"><?php print_string('auth_cas_baseuri_key', 'auth_cas') ?>: </label> 127 </td> 128 <td> 129 <input name="baseuri" id="baseuri" type="text" size="30" value="<?php echo $config->baseuri ?>" /> 130 <?php if (isset($err['baseuri'])) { echo $OUTPUT->error_text($err['baseuri']); } ?> 131 </td> 132 <td> 133 <?php print_string('auth_cas_baseuri', 'auth_cas') ?> 134 </td> 135 </tr> 136 <tr valign="top" class="required"> 137 <td align="right"> 138 <label for="port"><?php print_string('auth_cas_port_key', 'auth_cas') ?>: </label> 139 </td> 140 <td> 141 <input name="port" id="port" type="text" size="30" value="<?php echo $config->port ?>" /> 142 <?php if (isset($err['port'])) { echo $OUTPUT->error_text($err['port']); } ?> 143 </td> 144 <td> 145 <?php print_string('auth_cas_port', 'auth_cas') ?> 146 </td> 147 </tr> 148 <tr valign="top" class="required"> 149 <td align="right"> 150 <?php echo html_writer::label(get_string('auth_cas_casversion', 'auth_cas'), 'menucasversion'); ?>: 151 </td> 152 <td> 153 <?php 154 $casversions = array(); 155 $casversions[CAS_VERSION_1_0] = 'CAS 1.0'; 156 $casversions[CAS_VERSION_2_0] = 'CAS 2.0'; 157 echo html_writer::select($casversions, 'casversion', $config->casversion, false); 158 if (isset($err['casversion'])) { echo $OUTPUT->error_text($err['casversion']); } 159 ?> 160 </td> 161 <td> 162 <?php print_string('auth_cas_version', 'auth_cas') ?> 163 </td> 164 </tr> 165 <tr valign="top" class="required"> 166 <td align="right"><?php echo html_writer::label(get_string('auth_cas_language_key', 'auth_cas'), 'menulanguage'); ?>:</td> 167 <td> 168 <?php echo html_writer::select($CASLANGUAGES, 'language', $config->language, false); ?> 169 </td> 170 <td> 171 <?php print_string('auth_cas_language', 'auth_cas') ?> 172 </td> 173 </tr> 174 <tr valign="top" class="required"> 175 <td align="right"> 176 <?php echo html_writer::label(get_string('auth_cas_proxycas_key', 'auth_cas'), 'menuproxycas'); ?>: 177 </td> 178 <td> 179 <?php echo html_writer::select($yesno, 'proxycas', $config->proxycas, false); ?> 180 </td> 181 <td> 182 <?php print_string('auth_cas_proxycas', 'auth_cas') ?> 183 </td> 184 </tr> 185 <tr valign="top" class="required"> 186 <td align="right"><?php echo html_writer::label(get_string('auth_cas_logoutcas_key', 'auth_cas'), 'menulogoutcas'); ?>:</td> 187 <td> 188 <?php echo html_writer::select($yesno, 'logoutcas', $config->logoutcas, false); ?> 189 </td> 190 <td> 191 <?php print_string('auth_cas_logoutcas', 'auth_cas') ?> 192 </td> 193 </tr> 194 <tr valign="top" class="required"> 195 <td align="right"><?php echo html_writer::label(get_string('auth_cas_multiauth_key', 'auth_cas'), 'menumultiauth'); ?>:</td> 196 <td> 197 <?php echo html_writer::select($yesno, 'multiauth', $config->multiauth, false); ?> 198 </td> 199 <td> 200 <?php print_string('auth_cas_multiauth', 'auth_cas') ?> 201 </td> 202 </tr> 203 <tr valign="top" class="required"> 204 <td align="right"><?php echo html_writer::label(get_string('auth_cas_certificate_check_key', 'auth_cas'), 'menucertificate_check'); ?>:</td> 205 <td> 206 <?php echo html_writer::select($yesno, 'certificate_check', $config->certificate_check, false); ?> 207 </td> 208 <td> 209 <?php print_string('auth_cas_certificate_check', 'auth_cas') ?> 210 </td> 211 </tr> 212 <tr valign="top" class="required"> 213 <td align="right"><label for="certificate_path"><?php print_string('auth_cas_certificate_path_key', 'auth_cas') ?>: </label></td> 214 <td> 215 <input name="certificate_path" id="certificate_path" type="text" size="30" value="<?php echo $config->certificate_path ?>" /> 216 <?php if (isset($err['certificate_path'])) echo $OUTPUT->error_text($err['certificate_path']); ?> 217 </td> 218 <td> 219 <?php print_string('auth_cas_certificate_path', 'auth_cas') ?> 220 </td> 221 </tr> 222 <tr valign="top" class="required"> 223 <td align="right"><label for="curl_ ssl_version"><?php print_string('auth_cas_curl_ssl_version_key', 'auth_cas') ?>: </label></td> 224 <td> 225 <?php 226 $sslversions = array(); 227 $sslversions[''] = get_string('auth_cas_curl_ssl_version_default', 'auth_cas'); 228 if (defined('CURL_SSLVERSION_TLSv1')) { 229 $sslversions[CURL_SSLVERSION_TLSv1] = get_string('auth_cas_curl_ssl_version_TLSv1x', 'auth_cas'); 230 } 231 if (defined('CURL_SSLVERSION_TLSv1_0')) { 232 $sslversions[CURL_SSLVERSION_TLSv1_0] = get_string('auth_cas_curl_ssl_version_TLSv10', 'auth_cas'); 233 } 234 if (defined('CURL_SSLVERSION_TLSv1_1')) { 235 $sslversions[CURL_SSLVERSION_TLSv1_1] = get_string('auth_cas_curl_ssl_version_TLSv11', 'auth_cas'); 236 } 237 if (defined('CURL_SSLVERSION_TLSv1_2')) { 238 $sslversions[CURL_SSLVERSION_TLSv1_2] = get_string('auth_cas_curl_ssl_version_TLSv12', 'auth_cas'); 239 } 240 if (defined('CURL_SSLVERSION_SSLv2')) { 241 $sslversions[CURL_SSLVERSION_SSLv2] = get_string('auth_cas_curl_ssl_version_SSLv2', 'auth_cas'); 242 } 243 if (defined('CURL_SSLVERSION_SSLv3')) { 244 $sslversions[CURL_SSLVERSION_SSLv3] = get_string('auth_cas_curl_ssl_version_SSLv3', 'auth_cas'); 245 } 246 echo html_writer::select($sslversions, 'curl_ssl_version', $config->curl_ssl_version, false); 247 if (isset($err['curl_ssl_version'])) echo $OUTPUT->error_text($err['curl_ssl_version']); 248 ?> 249 </td> 250 <td> 251 <?php print_string('auth_cas_curl_ssl_version', 'auth_cas') ?> 252 </td> 253 </tr> 254 <tr valign="top" class="required"> 255 <td align="right"><?php print_string('auth_cas_logout_return_url_key', 'auth_cas') ?>:</td> 256 <td> 257 <input name="logout_return_url" type="text" size="30" value="<?php echo $config->logout_return_url ?>" /> 258 <?php if (isset($err['logout_return_url'])) { echo $OUTPUT->error_text($err['logout_return_url']); } ?> 259 </td> 260 <td> 261 <?php print_string('auth_cas_logout_return_url', 'auth_cas') ?> 262 </td> 263 </tr> 264 <tr> 265 <td colspan="2"> 266 <h4><?php print_string('auth_ldap_server_settings', 'auth_ldap') ?></h4> 267 </td> 268 </tr> 269 <tr valign="top" class="required"> 270 <td align="right"> 271 <label for="host_url"><?php print_string('auth_ldap_host_url_key', 'auth_ldap') ?></label> 272 </td> 273 <td> 274 <input name="host_url" id="host_url" type="text" size="30" value="<?php echo $config->host_url?>" /> 275 <?php if (isset($err['host_url'])) { echo $OUTPUT->error_text($err['host_url']); } ?> 276 </td> 277 <td> 278 <?php print_string('auth_ldap_host_url', 'auth_ldap') ?> 279 </td> 280 </tr> 281 <tr valign="top" class="required"> 282 <td align="right"><label for="ldap_version"><?php print_string('auth_ldap_version_key', 'auth_ldap') ?></label></td> 283 <td> 284 <?php 285 $versions = array(); 286 $versions[2] = '2'; 287 $versions[3] = '3'; 288 echo html_writer::select($versions, 'ldap_version', $config->ldap_version, false); 289 if (isset($err['ldap_version'])) { echo $OUTPUT->error_text($err['ldap_version']); } 290 ?> 291 </td> 292 <td> 293 <?php print_string('auth_ldap_version', 'auth_ldap') ?> 294 </td> 295 </tr> 296 <tr valign="top"> 297 <td align="right"> 298 <label for="start_tls"><?php print_string('start_tls_key', 'auth_ldap') ?></label> 299 </td> 300 <td> 301 <?php echo html_writer::select($yesno, 'start_tls', $config->start_tls, false); ?> 302 </td> 303 <td> 304 <?php print_string('start_tls', 'auth_ldap') ?> 305 </td> 306 </tr> 307 <tr valign="top" class="required"> 308 <td align="right"> 309 <label for="ldapencoding"><?php print_string('auth_ldap_ldap_encoding_key', 'auth_ldap') ?></label> 310 </td> 311 <td> 312 <input id="ldapencoding" name="ldapencoding" type="text" value="<?php echo $config->ldapencoding ?>" /> 313 <?php if (isset($err['ldapencoding'])) { echo $OUTPUT->error_text($err['ldapencoding']); } ?> 314 </td> 315 <td> 316 <?php print_string('auth_ldap_ldap_encoding', 'auth_ldap') ?> 317 </td> 318 </tr> 319 <tr valign="top"> 320 <td align="right"> 321 <label for="pagesize"><?php print_string('pagesize_key', 'auth_ldap') ?></label> 322 </td> 323 <td> 324 <input id="pagesize" name="pagesize" type="text" value="<?php echo $config->pagesize ?>" <?php echo $disabled ?>/> 325 <?php 326 if (isset($err['pagesize'])) { echo $OUTPUT->error_text($err['pagesize']); } 327 if ($disabled) { 328 // Don't loose the page size value (disabled fields are not submitted!) 329 ?> 330 <input id="pagesize" name="pagesize" type="hidden" value="<?php echo $config->pagesize ?>" /> 331 <?php } ?> 332 </td> 333 <td> 334 <?php print_string('pagesize', 'auth_ldap') ?> 335 </td> 336 </tr> 337 <tr> 338 <td colspan="2"> 339 <h4><?php print_string('auth_ldap_bind_settings', 'auth_ldap') ?></h4> 340 </td> 341 </tr> 342 <tr valign="top" class="required"> 343 <td align="right"> 344 <label for="bind_dn"><?php print_string('auth_ldap_bind_dn_key', 'auth_ldap') ?></label> 345 </td> 346 <td> 347 <input name="bind_dn" id="bind_dn" type="text" size="30" value="<?php echo $config->bind_dn?>" /> 348 <?php if (isset($err['bind_dn'])) { echo $OUTPUT->error_text($err['bind_dn']); } ?> 349 </td> 350 <td> 351 <?php print_string('auth_ldap_bind_dn', 'auth_ldap') ?> 352 </td> 353 </tr> 354 <tr valign="top" class="required"> 355 <td align="right"> 356 <label for="bind_pw"><?php print_string('auth_ldap_bind_pw_key', 'auth_ldap') ?></label> 357 </td> 358 <td> 359 <input name="bind_pw" id="bind_pw" type="password" size="30" value="<?php echo $config->bind_pw?>" autocomplete="off"/> 360 <?php if (isset($err['bind_pw'])) { echo $OUTPUT->error_text($err['bind_pw']); } ?> 361 </td> 362 <td> 363 <?php print_string('auth_ldap_bind_pw', 'auth_ldap') ?> 364 </td> 365 </tr> 366 <tr> 367 <td colspan="2"> 368 <h4><?php print_string('auth_ldap_user_settings', 'auth_ldap') ?></h4> 369 </td> 370 </tr> 371 <tr valign="top" class="required"> 372 <td align="right"> 373 <label for="menuuser_type"><?php print_string('auth_ldap_user_type_key', 'auth_ldap') ?></label> 374 </td> 375 <td> 376 <?php 377 echo html_writer::select(ldap_supported_usertypes(), 'user_type', $config->user_type, false); 378 if (isset($err['user_type'])) { echo $OUTPUT->error_text($err['user_type']); } 379 ?> 380 </td> 381 <td> 382 <?php print_string('auth_ldap_user_type', 'auth_ldap') ?> 383 </td> 384 </tr> 385 <tr valign="top" class="required"> 386 <td align="right"> 387 <label for="contexts"><?php print_string('auth_ldap_contexts_key', 'auth_ldap') ?></label> 388 </td> 389 <td> 390 <input name="contexts" id="contexts" type="text" size="30" value="<?php echo $config->contexts?>" /> 391 <?php if (isset($err['contexts'])) { echo $OUTPUT->error_text($err['contexts']); } ?> 392 </td> 393 <td> 394 <?php print_string('auth_ldap_contexts', 'auth_ldap') ?> 395 </td> 396 </tr> 397 <tr valign="top" class="required"> 398 <td align="right"> 399 <label for="menusearch_sub"><?php print_string('auth_ldap_search_sub_key', 'auth_ldap') ?></label></td> 400 <td> 401 <?php echo html_writer::select($yesno, 'search_sub', $config->search_sub, false); ?> 402 </td> 403 <td> 404 <?php print_string('auth_ldap_search_sub', 'auth_ldap') ?> 405 </td> 406 </tr> 407 <tr valign="top" class="required"> 408 <td align="right"><label for="menuopt_deref"><?php print_string('auth_ldap_opt_deref_key', 'auth_ldap') ?></label></td> 409 <td> 410 <?php 411 $opt_deref = array(); 412 $opt_deref[LDAP_DEREF_NEVER] = get_string('no'); 413 $opt_deref[LDAP_DEREF_ALWAYS] = get_string('yes'); 414 echo html_writer::select($opt_deref, 'opt_deref', $config->opt_deref, false); 415 if (isset($err['opt_deref'])) { echo $OUTPUT->error_text($err['opt_deref']); } 416 ?> 417 </td> 418 <td> 419 <?php print_string('auth_ldap_opt_deref', 'auth_ldap') ?> 420 </td> 421 </tr> 422 <tr valign="top" class="required"> 423 <td align="right"> 424 <label for="user_attribute"><?php print_string('auth_ldap_user_attribute_key', 'auth_ldap') ?></label> 425 </td> 426 <td> 427 <input name="user_attribute" id="user_attribute" type="text" size="30" value="<?php echo $config->user_attribute?>" /> 428 <?php if (isset($err['user_attribute'])) { echo $OUTPUT->error_text($err['user_attribute']); } ?> 429 </td> 430 <td> 431 <?php print_string('auth_ldap_user_attribute', 'auth_ldap') ?> 432 </td> 433 </tr> 434 <tr valign="top" class="required"> 435 <td align="right"> 436 <label for="memberattribute"><?php print_string('auth_ldap_memberattribute_key', 'auth_ldap') ?></label> 437 </td> 438 <td> 439 <input name="memberattribute" id="memberattribute" type="text" size="30" value="<?php echo $config->memberattribute?>" /> 440 <?php if (isset($err['memberattribute'])) { echo $OUTPUT->error_text($err['memberattribute']); } ?> 441 </td> 442 <td> 443 <?php print_string('auth_ldap_memberattribute', 'auth_ldap') ?> 444 </td> 445 </tr> 446 <tr valign="top" class="required"> 447 <td align="right"> 448 <label for="memberattribute_isdn"><?php print_string('auth_ldap_memberattribute_isdn_key', 'auth_ldap') ?></label> 449 </td> 450 <td> 451 <input name="memberattribute_isdn" id="memberattribute_isdn" type="text" size="30" value="<?php echo $config->memberattribute_isdn?>" /> 452 <?php if (isset($err['memberattribute_isdn'])) { echo $OUTPUT->error_text($err['memberattribute_isdn']); } ?> 453 </td> 454 <td> 455 <?php print_string('auth_ldap_memberattribute_isdn', 'auth_ldap') ?> 456 </td> 457 </tr> 458 <tr valign="top" class="required"> 459 <td align="right"> 460 <label for="objectclass"><?php print_string('auth_ldap_objectclass_key', 'auth_ldap') ?></label> 461 </td> 462 <td> 463 <input name="objectclass" id="objectclass" type="text" size="30" value="<?php echo $config->objectclass?>" /> 464 <?php if (isset($err['objectclass'])) { echo $OUTPUT->error_text($err['objectclass']); } ?> 465 </td> 466 <td> 467 <?php print_string('auth_ldap_objectclass', 'auth_ldap') ?> 468 </td> 469 </tr> 470 <tr> 471 <td colspan="2"> 472 <h4><?php print_string('coursecreators') ?></h4> 473 </td> 474 </tr> 475 <tr valign="top" class="required"> 476 <td align="right"> 477 <label for="attrcreators"><?php print_string('auth_ldap_attrcreators_key', 'auth_ldap') ?></label> 478 </td> 479 <td> 480 <input name="attrcreators" id="attrcreators" type="text" size="30" value="<?php echo $config->attrcreators?>" /> 481 <?php if (isset($err['attrcreators'])) { echo $OUTPUT->error_text($err['attrcreators']); } ?> 482 </td> 483 <td> 484 <?php print_string('auth_ldap_attrcreators', 'auth_ldap') ?> 485 </td> 486 </tr> 487 <tr valign="top" class="required"> 488 <td align="right"> 489 <label for="groupecreators"><?php print_string('auth_ldap_groupecreators_key', 'auth_ldap') ?></label> 490 </td> 491 <td> 492 <input name="groupecreators" id="groupecreators" type="text" size="30" value="<?php echo $config->groupecreators?>" /> 493 <?php if (isset($err['groupecreators'])) { echo $OUTPUT->error_text($err['groupecreators']); } ?> 494 </td> 495 <td> 496 <?php print_string('auth_ldap_groupecreators', 'auth_ldap') ?> 497 </td> 498 </tr> 499 <tr> 500 <td colspan="2"> 501 <h4><?php print_string('auth_sync_script', 'auth') ?></h4> 502 </td> 503 </tr> 504 <tr valign="top"> 505 <td align="right"> 506 <label for="menuremoveuser"><?php print_string('auth_remove_user_key', 'auth') ?></label> 507 </td> 508 <td> 509 <?php 510 $deleteopt = array(); 511 $deleteopt[AUTH_REMOVEUSER_KEEP] = get_string('auth_remove_keep', 'auth'); 512 $deleteopt[AUTH_REMOVEUSER_SUSPEND] = get_string('auth_remove_suspend', 'auth'); 513 $deleteopt[AUTH_REMOVEUSER_FULLDELETE] = get_string('auth_remove_delete', 'auth'); 514 echo html_writer::select($deleteopt, 'removeuser', $config->removeuser, false); 515 ?> 516 </td> 517 <td> 518 <?php print_string('auth_remove_user', 'auth') ?> 519 </td> 520 </tr> 521 <?php 522 $help = get_string('auth_ldapextrafields', 'auth_ldap'); 523 $help .= get_string('auth_updatelocal_expl', 'auth'); 524 $help .= get_string('auth_fieldlock_expl', 'auth'); 525 $help .= get_string('auth_updateremote_expl', 'auth'); 526 $help .= '<hr />'; 527 $help .= get_string('auth_updateremote_ldap', 'auth'); 528 529 print_auth_lock_options($this->authtype, $user_fields, $help, true, true, $this->get_custom_user_profile_fields()); 530 ?> 531 </table>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Aug 11 10:00:09 2016 | Cross-referenced by PHPXref 0.7.1 |