[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/auth/cas/ -> config.html (source)

   1  <?php
   2  
   3  
   4  
   5      global $CFG;
   6  
   7      require_once  'languages.php';
   8  
   9  
  10  
  11      $createoptions[0] = get_string("no");
  12  
  13      $createoptions[1] = get_string("yes");
  14  
  15  
  16  
  17      // set to defaults if undefined (CAS)
  18  
  19      if (!isset ($config->hostname)) 
  20  
  21          $config->hostname = '';
  22  
  23      if (!isset ($config->port)) 
  24  
  25          $config->port = '';
  26  
  27      if (!isset ($config->casversion)) 
  28  
  29          $config->casversion = '';
  30  
  31      if (!isset ($config->baseuri)) 
  32  
  33          $config->baseuri = '';
  34  
  35      if (!isset ($config->language)) 
  36  
  37          $config->language = '';
  38  
  39      if (!isset ($config->proxycas)) 
  40  
  41          $config->proxycas = '';
  42  
  43      if (!isset ($config->logoutcas)) 
  44  
  45          $config->logoutcas = '';
  46  
  47      if (!isset ($config->multiauth))
  48  
  49          $config->multiauth = '';
  50  
  51    // set to defaults if undefined (LDAP)
  52  
  53      if (!isset($config->host_url))
  54  
  55          { $config->host_url = ''; }
  56  
  57      if (empty($config->ldapencoding))
  58  
  59          { $config->ldapencoding = 'utf-8'; }
  60  
  61      if (!isset($config->contexts))
  62  
  63          { $config->contexts = ''; }
  64  
  65      if (!isset($config->user_type))
  66  
  67          { $config->user_type = 'default'; }
  68  
  69      if (!isset($config->user_attribute))
  70  
  71          { $config->user_attribute = ''; }
  72  
  73      if (!isset($config->search_sub))
  74  
  75          { $config->search_sub = ''; }
  76  
  77      if (!isset($config->opt_deref))
  78  
  79          { $config->opt_deref = LDAP_DEREF_NEVER; }
  80  
  81      if (!isset($config->bind_dn))
  82  
  83          {$config->bind_dn = ''; }
  84  
  85      if (!isset($config->bind_pw))
  86  
  87          {$config->bind_pw = ''; }
  88  
  89      if (!isset($config->version))
  90  
  91          {$config->version = '2'; }
  92  
  93      if (!isset($config->objectclass))
  94  
  95          {$config->objectclass = ''; }
  96  
  97      if (!isset($config->memberattribute))
  98  
  99          {$config->memberattribute = ''; }
 100  
 101      if (!isset($config->memberattribute_isdn))
 102  
 103          {$config->memberattribute_isdn = ''; }
 104  
 105      if (!isset($config->groupecreators))
 106  
 107          {$config->groupecreators = ''; }
 108  
 109      if (!isset($config->attrcreators))
 110  
 111          {$config->attrcreators = ''; }
 112  
 113       if (!isset($config->removeuser))
 114  
 115          {$config->removeuser = 0; }
 116  
 117  
 118  
 119      $yesno = array( get_string('no'), get_string('yes') );
 120  
 121  
 122  
 123  if (!function_exists('ldap_connect')) { // Is php4-ldap really there?
 124  
 125      notify(get_string('auth_ldap_noextension','auth'));
 126  
 127  }
 128  
 129  
 130  
 131  
 132  
 133  ?>
 134  
 135  
 136  
 137  <table cellspacing="0" cellpadding="5" border="0">
 138  
 139  
 140  
 141  <tr>
 142  
 143     <td colspan="2">
 144  
 145          <h4><?php print_string('auth_cas_server_settings', 'auth') ?> </h4>
 146  
 147     </td>
 148  
 149  </tr>
 150  
 151  <tr valign="top" class="required">
 152  
 153      <td align="right"><?php print_string('auth_cas_hostname_key', 'auth') ?>:</td>
 154  
 155      <td>
 156  
 157          <input name="hostname" type="text" size="30" value="<?php echo $config->hostname ?>" />
 158  
 159          <?php
 160  
 161  
 162  
 163          if (isset($err['hostname'])) {
 164  
 165              formerr($err['hostname']);
 166  
 167          }
 168  
 169  
 170  
 171          ?>
 172  
 173      </td>
 174  
 175      <td><?php print_string('auth_cas_hostname', 'auth') ?></td>
 176  
 177  </tr>
 178  
 179  
 180  
 181  <tr valign="top"  class="required">
 182  
 183      <td align="right"><?php print_string('auth_cas_baseuri_key', 'auth') ?>:</td>
 184  
 185      <td>
 186  
 187          <input name="baseuri" type="text" size="30" value="<?php echo $config->baseuri ?>" />
 188  
 189          <?php
 190  
 191  
 192  
 193          if (isset($err['baseuri'])) {
 194  
 195              formerr($err['baseuri']);
 196  
 197          }
 198  
 199  
 200  
 201          ?>
 202  
 203      </td>
 204  
 205      <td><?php print_string('auth_cas_baseuri', 'auth') ?></td>
 206  
 207  </tr>
 208  
 209  
 210  
 211  <tr valign="top" class="required">
 212  
 213      <td align="right"><?php print_string('auth_cas_port_key', 'auth') ?>:</td>
 214  
 215      <td>
 216  
 217          <input name="port" type="text" size="30" value="<?php echo $config->port ?>" />
 218  
 219          <?php
 220  
 221  
 222  
 223          if (isset($err['port'])) {
 224  
 225              formerr($err['port']);
 226  
 227          }
 228  
 229  
 230  
 231          ?>
 232  
 233      </td>
 234  
 235      <td><?php print_string('auth_cas_port', 'auth') ?></td>
 236  
 237  </tr>
 238  
 239  
 240  
 241  <tr valign="top"  class="required">
 242  
 243      <td align="right"><?php print_string('auth_cas_casversion', 'auth') ?>:</td>
 244  
 245      <td>
 246  
 247          <input name="casversion" type="text" size="30" value="<?php echo $config->casversion ?>" />
 248  
 249          <?php
 250  
 251  
 252  
 253          if (isset($err['casversion'])) {
 254  
 255              formerr($err['casversion']);
 256  
 257          }
 258  
 259  
 260  
 261          ?>
 262  
 263      </td>
 264  
 265      <td><?php print_string('auth_cas_version', 'auth') ?></td>
 266  
 267  </tr>
 268  
 269  
 270  
 271  <tr valign="top"  class="required">
 272  
 273      <td align="right"><?php print_string('auth_cas_language_key', 'auth') ?>:</td>
 274  
 275      <td>
 276  
 277          <?php
 278  
 279  
 280  
 281          choose_from_menu($CASLANGUAGES, 'language', $config->language, '');
 282  
 283  
 284  
 285          ?>
 286  
 287      </td>
 288  
 289      <td><?php print_string('auth_cas_language', 'auth') ?></td>
 290  
 291  </tr>
 292  
 293  
 294  
 295  <tr valign="top"  class="required">
 296  
 297      <td align="right"><?php print_string('auth_cas_proxycas_key', 'auth') ?>:</td>
 298  
 299      <td>
 300  
 301          <?php
 302  
 303          unset($options);
 304  
 305          $options[1] = get_string('yes');
 306  
 307          choose_from_menu ($options, 'proxycas', $config->proxycas, get_string('no'), '', '');
 308  
 309          ?>
 310  
 311      </td>
 312  
 313      <td><?php print_string('auth_cas_proxycas', 'auth') ?></td>
 314  
 315  </tr>
 316  
 317  
 318  
 319  <tr valign="top"  class="required">
 320  
 321      <td align="right"><?php print_string('auth_cas_logoutcas_key', 'auth') ?>:</td>
 322  
 323      <td>
 324  
 325          <?php
 326  
 327          unset($options);
 328  
 329          $options[1] = get_string('yes');
 330  
 331          choose_from_menu ($options, 'logoutcas', $config->logoutcas, get_string('no'), '', '');
 332  
 333          ?>
 334  
 335      </td>
 336  
 337      <td><?php print_string('auth_cas_logoutcas', 'auth') ?></td>
 338  
 339  </tr>
 340  
 341  
 342  
 343  <tr valign="top"  class="required">
 344  
 345      <td align="right"><?php print_string('auth_cas_multiauth_key', 'auth') ?>:</td>
 346  
 347      <td>
 348  
 349          <?php
 350  
 351          unset($options);
 352  
 353          $options[1] = get_string('yes');
 354  
 355          choose_from_menu ($options, 'multiauth', $config->multiauth, get_string('no'), '', '');
 356  
 357          ?>
 358  
 359      </td>
 360  
 361      <td><?php print_string('auth_cas_multiauth', 'auth') ?></td>
 362  
 363  </tr>
 364  
 365  
 366  
 367  <tr>
 368  
 369     <td colspan="2">
 370  
 371          <h4><?php print_string('auth_ldap_server_settings', 'auth') ?> </h4>
 372  
 373     </td>
 374  
 375  </tr>
 376  
 377  
 378  
 379  <tr valign="top" class="required">
 380  
 381      <td align="right"><label for="host_url"><?php print_string('auth_ldap_host_url_key','auth') ?></label></td>
 382  
 383      <td>
 384  
 385          <input name="host_url" id="host_url" type="text" size="30" value="<?php echo $config->host_url?>" />
 386  
 387      <?php  if (isset($err['host_url'])) formerr($err['host_url']); ?>
 388  
 389      </td>
 390  
 391      <td>
 392  
 393      <?php print_string('auth_ldap_host_url','auth') ?>
 394  
 395      </td>
 396  
 397  </tr>
 398  
 399  
 400  
 401  <tr valign="top" class="required">
 402  
 403      <td align="right"><label for="menuversion"><?php print_string('auth_ldap_version_key','auth') ?></label></td>
 404  
 405      <td>
 406  
 407      <?php
 408  
 409         $versions = array();
 410  
 411         $versions[2] = '2';
 412  
 413         $versions[3] = '3';
 414  
 415         choose_from_menu($versions, 'version', $config->version, '');
 416  
 417         if (isset($err['version'])) formerr($err['version']);
 418  
 419      ?>
 420  
 421      </td>
 422  
 423      <td>
 424  
 425      <?php print_string('auth_ldap_version','auth') ?>
 426  
 427      </td>
 428  
 429  </tr>
 430  
 431  
 432  
 433  <tr valign="top" class="required">
 434  
 435      <td align="right"><label for="ldapencoding"><?php print_string("auth_ldap_ldap_encoding_key", "auth") ?></label></td>
 436  
 437      <td>
 438  
 439          <input id="ldapencoding" name="ldapencoding" type="text" value="<?php echo $config->ldapencoding ?>" />
 440  
 441          <?php
 442  
 443  
 444  
 445          if (isset($err['ldapencoding'])) {
 446  
 447              formerr($err['ldapencoding']);
 448  
 449          }
 450  
 451  
 452  
 453          ?>
 454  
 455      </td>
 456  
 457      <td><?php print_string('auth_ldap_ldap_encoding', 'auth') ?></td>
 458  
 459  </tr>
 460  
 461  
 462  
 463  <tr>
 464  
 465     <td colspan="2">
 466  
 467          <h4><?php print_string('auth_ldap_bind_settings', 'auth') ?> </h4>
 468  
 469     </td>
 470  
 471  </tr>
 472  
 473  
 474  
 475  <tr valign="top" class="required">
 476  
 477      <td align="right"><label for="bind_dn"><?php print_string('auth_ldap_bind_dn_key','auth') ?></label></td>
 478  
 479      <td>
 480  
 481      <input name="bind_dn" id="bind_dn" type="text" size="30" value="<?php echo $config->bind_dn?>" />
 482  
 483      <?php  if (isset($err['bind_dn'])) formerr($err['bind_dn']); ?>
 484  
 485      </td><td>
 486  
 487      <?php print_string('auth_ldap_bind_dn','auth') ?>
 488  
 489      </td>
 490  
 491  </tr>
 492  
 493  
 494  
 495  <tr valign="top" class="required">
 496  
 497      <td align="right"><label for="bind_pw"><?php print_string('auth_ldap_bind_pw_key','auth') ?></label></td>
 498  
 499      <td>
 500  
 501      <input name="bind_pw" id="bind_pw" type="password" size="30" value="<?php echo $config->bind_pw?>" />
 502  
 503      <?php  if (isset($err['bind_pw'])) formerr($err['bind_pw']); ?>
 504  
 505      </td><td>
 506  
 507      <?php print_string('auth_ldap_bind_pw','auth') ?>
 508  
 509      </td>
 510  
 511  </tr>
 512  
 513  
 514  
 515  <tr>
 516  
 517     <td colspan="2">
 518  
 519          <h4><?php print_string('auth_ldap_user_settings', 'auth') ?> </h4>
 520  
 521     </td>
 522  
 523  </tr>
 524  
 525  
 526  
 527  <tr valign="top" class="required">
 528  
 529      <td align="right"><label for="menuuser_type"><?php print_string('auth_ldap_user_type_key','auth') ?></label></td>
 530  
 531      <td>
 532  
 533      <?php choose_from_menu($this->ldap_suppported_usertypes(), 'user_type', $config->user_type, ''); ?>
 534  
 535      <?php  if (isset($err['user_type'])) formerr($err['user_type']); ?>
 536  
 537      </td>
 538  
 539      <td>
 540  
 541      <?php print_string('auth_ldap_user_type', 'auth') ?>
 542  
 543      </td>
 544  
 545  </tr>
 546  
 547  
 548  
 549  <tr valign="top" class="required">
 550  
 551      <td align="right"><label for="contexts"><?php print_string('auth_ldap_contexts_key','auth') ?></label></td>
 552  
 553      <td>
 554  
 555      <input name="contexts" id="contexts"  type="text" size="30" value="<?php echo $config->contexts?>" />
 556  
 557      <?php  if (isset($err['contexts'])) formerr($err['contexts']); ?>
 558  
 559      </td>
 560  
 561      <td>
 562  
 563      <?php print_string('auth_ldap_contexts', 'auth') ?>
 564  
 565      </td>
 566  
 567  </tr>
 568  
 569  
 570  
 571  <tr valign="top" class="required">
 572  
 573      <td align="right"><label for="menusearch_sub"><?php print_string('auth_ldap_search_sub_key','auth') ?></label></td>
 574  
 575      <td>
 576  
 577          <?php choose_from_menu($yesno, 'search_sub', $config->search_sub, ''); ?>
 578  
 579      </td>
 580  
 581      <td>
 582  
 583      <?php print_string('auth_ldap_search_sub','auth') ?>
 584  
 585      </td>
 586  
 587  </tr>
 588  
 589  
 590  
 591  <tr valign="top" class="required">
 592  
 593      <td align="right"><label for="menuopt_deref"><?php print_string('auth_ldap_opt_deref_key','auth') ?></label></td>
 594  
 595      <td>
 596  
 597      <?php
 598  
 599         $opt_deref = array();
 600  
 601         $opt_deref[LDAP_DEREF_NEVER] = get_string('no');
 602  
 603         $opt_deref[LDAP_DEREF_ALWAYS] = get_string('yes');
 604  
 605         choose_from_menu($opt_deref, 'opt_deref', $config->opt_deref, LDAP_DEREF_NEVER, '');
 606  
 607         if (isset($err['opt_deref'])) formerr($err['opt_deref']);
 608  
 609      ?>
 610  
 611      </td>
 612  
 613      <td>
 614  
 615      <?php print_string('auth_ldap_opt_deref','auth') ?>
 616  
 617      </td>
 618  
 619  </tr>
 620  
 621  
 622  
 623  
 624  
 625  
 626  
 627  <tr valign="top" class="required">
 628  
 629      <td align="right"><label for="user_attribute"><?php print_string('auth_ldap_user_attribute_key','auth') ?></label></td>
 630  
 631      <td>
 632  
 633      <input name="user_attribute" id="user_attribute" type="text" size="30" value="<?php echo $config->user_attribute?>" />
 634  
 635      <?php  if (isset($err['user_attribute'])) formerr($err['user_attribute']); ?>
 636  
 637      </td>
 638  
 639      <td>
 640  
 641      <?php print_string('auth_ldap_user_attribute','auth') ?>
 642  
 643      </td>
 644  
 645  </tr>
 646  
 647  
 648  
 649  <tr valign="top" class="required">
 650  
 651          <td align="right"><label for="memberattribute"><?php print_string('auth_ldap_memberattribute_key','auth') ?></label></td>
 652  
 653          <td>
 654  
 655      <input name="memberattribute" id="memberattribute" type="text" size="30" value="<?php echo $config->memberattribute?>" />
 656  
 657      <?php  if (isset($err['memberattribute'])) formerr($err['memberattribute']); ?>
 658  
 659      </td><td>
 660  
 661      <?php print_string('auth_ldap_memberattribute','auth') ?>
 662  
 663      </td>
 664  
 665  </tr>
 666  
 667  
 668  
 669  <tr valign="top" class="required">
 670  
 671          <td align="right"><label for="memberattribute_isdn"><?php print_string('auth_ldap_memberattribute_isdn_key','auth') ?></label></td>
 672  
 673          <td>
 674  
 675      <input name="memberattribute_isdn" id="memberattribute_isdn" type="text" size="30" value="<?php echo $config->memberattribute_isdn?>" />
 676  
 677      <?php  if (isset($err['memberattribute_isdn'])) formerr($err['memberattribute_isdn']); ?>
 678  
 679      </td><td>
 680  
 681      <?php print_string('auth_ldap_memberattribute_isdn','auth') ?>
 682  
 683      </td>
 684  
 685  </tr>
 686  
 687  
 688  
 689  <tr valign="top" class="required">
 690  
 691      <td align="right"><label for="objectclass"><?php print_string('auth_ldap_objectclass_key','auth') ?></label></td>
 692  
 693      <td>
 694  
 695      <input name="objectclass" id="objectclass" type="text" size="30" value="<?php echo $config->objectclass?>" />
 696  
 697      <?php  if (isset($err['objectclass'])) formerr($err['objectclass']); ?>
 698  
 699      </td>
 700  
 701      <td>
 702  
 703      <?php print_string('auth_ldap_objectclass','auth') ?>
 704  
 705      </td>
 706  
 707  </tr>
 708  
 709  
 710  
 711  <tr>
 712  
 713     <td colspan="2">
 714  
 715          <h4><?php print_string('coursecreators') ?> </h4>
 716  
 717     </td>
 718  
 719  </tr>
 720  
 721  
 722  
 723  <tr valign="top" class="required">
 724  
 725          <td align="right"><label for="attrcreators"><?php print_string('auth_ldap_attrcreators_key','auth') ?></label></td>
 726  
 727          <td>
 728  
 729      <input name="attrcreators" id="attrcreators" type="text" size="30" value="<?php echo $config->attrcreators?>" />
 730  
 731      <?php  if (isset($err['attrcreators'])) formerr($err['attrcreators']); ?>
 732  
 733      </td><td>
 734  
 735      <?php print_string('auth_ldap_attrcreators','auth') ?>
 736  
 737      </td>
 738  
 739  </tr>
 740  
 741  
 742  
 743  <tr valign="top" class="required">
 744  
 745          <td align="right"><label for="groupecreators"><?php print_string('auth_ldap_groupecreators_key','auth') ?></label></td>
 746  
 747          <td>
 748  
 749      <input name="groupecreators" id="groupecreators" type="text" size="30" value="<?php echo $config->groupecreators?>" />
 750  
 751      <?php  if (isset($err['groupecreators'])) formerr($err['groupecreators']); ?>
 752  
 753      </td><td>
 754  
 755      <?php print_string('auth_ldap_groupecreators','auth') ?>
 756  
 757      </td>
 758  
 759  </tr>
 760  
 761  
 762  
 763  <tr>
 764  
 765     <td colspan="2">
 766  
 767          <h4><?php print_string('auth_sync_script', 'auth') ?> </h4>
 768  
 769     </td>
 770  
 771  </tr>
 772  
 773  
 774  
 775  <tr valign="top">
 776  
 777      <td align="right"><label for="menuremoveuser"><?php print_string('auth_remove_user_key','auth') ?></label></td>
 778  
 779      <td>
 780  
 781      <?php
 782  
 783         $deleteopt = array();
 784  
 785         $deleteopt['0'] = get_string('auth_remove_keep','auth');
 786  
 787         $deleteopt['1'] = get_string('auth_remove_suspend','auth');
 788  
 789         $deleteopt['2'] = get_string('auth_remove_delete','auth');
 790  
 791         choose_from_menu($deleteopt, 'removeuser', $config->removeuser, '');
 792  
 793      ?>
 794  
 795      </td>
 796  
 797      <td>
 798  
 799      <?php print_string('auth_remove_user','auth') ?>
 800  
 801      </td>
 802  
 803  </tr>
 804  
 805  <?php
 806  
 807  
 808  
 809  $help  = get_string('auth_ldapextrafields','auth');
 810  
 811  $help .= get_string('auth_updatelocal_expl','auth');
 812  
 813  $help .= get_string('auth_fieldlock_expl','auth');
 814  
 815  $help .= get_string('auth_updateremote_expl','auth');
 816  
 817  $help .= '<hr />';
 818  
 819  $help .= get_string('auth_updateremote_ldap','auth');
 820  
 821  
 822  
 823  print_auth_lock_options('cas', $user_fields, $help, true, true);
 824  
 825  
 826  
 827  ?>
 828  </table>


Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7