[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  <?php
   2      global $OUTPUT;
   3      // set to defaults if undefined
   4      if (!isset($config->host)) {
   5          $config->host = 'localhost';
   6      }
   7      if (!isset($config->type)) {
   8          $config->type = 'mysql';
   9      }
  10      if (!isset($config->sybasequoting)) {
  11          $config->sybasequoting = 0;
  12      }
  13      if (!isset($config->name)) {
  14          $config->name = '';
  15      }
  16      if (!isset($config->user)) {
  17          $config->user = '';
  18      }
  19      if (!isset($config->pass)) {
  20          $config->pass = '';
  21      }
  22      if (!isset($config->table)) {
  23          $config->table = '';
  24      }
  25      if (!isset($config->fielduser)) {
  26          $config->fielduser = '';
  27      }
  28      if (!isset($config->fieldpass)) {
  29          $config->fieldpass = '';
  30      }
  31      if (!isset($config->passtype)) {
  32          $config->passtype = 'plaintext';
  33      }
  34      if (!isset($config->changepasswordurl)) {
  35          $config->changepasswordurl = '';
  36      }
  37      if (empty($config->extencoding)) {
  38          $config->extencoding = 'utf-8';
  39      }
  40      if (empty($config->debugauthdb)) {
  41          $config->debugauthdb = 0;
  42      }
  43      if (!isset($config->setupsql)) {
  44          $config->setupsql = '';
  45      }
  46      if (!isset($config->removeuser)) {
  47          $config->removeuser = AUTH_REMOVEUSER_KEEP;
  48      }
  49  
  50      $yesno = array( get_string('no'), get_string('yes') );
  51  
  52  ?>
  53  <table cellspacing="0" cellpadding="5" border="0">
  54  
  55  <tr valign="top" class="required">
  56      <td align="right"><label for="host"><?php print_string("auth_dbhost_key", "auth_db") ?></label></td>
  57      <td>
  58          <input id="host" name="host" type="text" size="30" value="<?php echo $config->host?>" />
  59          <?php
  60  
  61          if (isset($err["host"])) {
  62              echo $OUTPUT->error_text($err["host"]);
  63          }
  64  
  65          ?>
  66      </td>
  67      <td><?php print_string("auth_dbhost", "auth_db") ?></td>
  68  </tr>
  69  
  70  <tr valign="top" class="required">
  71      <td align="right"><label for="menutype"><?php print_string("auth_dbtype_key", "auth_db") ?></label></td>
  72      <td>
  73      <?php  $dbtypes = array("access","ado_access", "ado", "ado_mssql", "borland_ibase", "csv", "db2", "fbsql", "firebird", "ibase", "informix72", "informix", "mssql", "mssql_n", "mssqlnative", "mysql", "mysqli", "mysqlt", "oci805", "oci8", "oci8po", "odbc", "odbc_mssql", "odbc_oracle", "oracle", "postgres64", "postgres7", "postgres", "proxy", "sqlanywhere", "sybase", "vfp");
  74         foreach ($dbtypes as $dbtype) {
  75             $dboptions[$dbtype] = $dbtype;
  76         }
  77         echo html_writer::select($dboptions, "type", $config->type, false);
  78      ?>
  79  
  80      </td>
  81      <td>
  82      <?php print_string("auth_dbtype","auth_db") ?>
  83      </td>
  84  </tr>
  85  
  86  <tr valign="top" class="required">
  87      <td align="right"><label for="menusybasequoting"><?php print_string("auth_dbsybasequoting", "auth_db") ?></label></td>
  88      <td>
  89          <?php echo html_writer::select($yesno, 'sybasequoting', $config->sybasequoting, false); ?>
  90      </td>
  91      <td><?php print_string("auth_dbsybasequotinghelp", "auth_db") ?></td>
  92  </tr>
  93  
  94  <tr valign="top" class="required">
  95      <td align="right"><label for="name"><?php print_string("auth_dbname_key", "auth_db") ?></label></td>
  96      <td>
  97          <input id="name" name="name" type="text" size="30" value="<?php echo $config->name?>" />
  98          <?php
  99  
 100          if (isset($err["name"])) {
 101              echo $OUTPUT->error_text($err["name"]);
 102          }
 103  
 104          ?>
 105      </td>
 106      <td><?php print_string("auth_dbname", "auth_db") ?></td>
 107  </tr>
 108  
 109  <tr valign="top" class="required">
 110      <td align="right"><label for="user"><?php print_string("auth_dbuser_key", "auth_db") ?></label></td>
 111      <td>
 112          <input id="user" name="user" type="text" size="30" value="<?php echo $config->user?>" />
 113          <?php
 114  
 115          if (isset($err["user"])) {
 116              echo $OUTPUT->error_text($err["user"]);
 117          }
 118  
 119          ?>
 120      </td>
 121      <td><?php print_string("auth_dbuser", "auth_db") ?></td>
 122  </tr>
 123  
 124  <tr valign="top" class="required">
 125      <td align="right"><label for="pass"><?php print_string("auth_dbpass_key", "auth_db") ?></label></td>
 126      <td>
 127          <input id="pass" name="pass" type="password" size="30" value="<?php p($config->pass)?>" autocomplete="off"/>
 128          <?php
 129  
 130          if (isset($err["pass"])) {
 131              echo $OUTPUT->error_text($err["pass"]);
 132          }
 133  
 134          ?>
 135      </td>
 136      <td>
 137      <?php print_string("auth_dbpass", "auth_db") ?>
 138      </td>
 139  </tr>
 140  
 141  <tr valign="top" class="required">
 142      <td align="right"><label for="table"><?php print_string("auth_dbtable_key", "auth_db") ?></label></td>
 143      <td>
 144          <input id="table" name="table" type="text" size="30" value="<?php echo $config->table?>" />
 145          <?php
 146  
 147          if (isset($err["table"])) {
 148              echo $OUTPUT->error_text($err["table"]);
 149          }
 150  
 151          ?>
 152      </td>
 153      <td><?php print_string("auth_dbtable", "auth_db") ?></td>
 154  </tr>
 155  
 156  <tr valign="top" class="required">
 157      <td align="right"><label for="fielduser"><?php print_string("auth_dbfielduser_key", "auth_db") ?></label></td>
 158      <td>
 159          <input id="fielduser" name="fielduser" type="text" size="30" value="<?php echo $config->fielduser?>" />
 160          <?php
 161  
 162          if (isset($err["fielduser"])) {
 163              echo $OUTPUT->error_text($err["fielduser"]);
 164          }
 165  
 166          ?>
 167      </td>
 168      <td><?php print_string("auth_dbfielduser", "auth_db") ?></td>
 169  </tr>
 170  
 171  <tr valign="top" class="required">
 172      <td align="right"><label for="fieldpass"><?php print_string("auth_dbfieldpass_key", "auth_db") ?></label></td>
 173      <td>
 174          <input id="fieldpass" name="fieldpass" type="text" size="30" value="<?php echo $config->fieldpass?>" />
 175          <?php
 176  
 177          if (isset($err["fieldpass"])) {
 178              echo $OUTPUT->error_text($err["fieldpass"]);
 179          }
 180  
 181          ?>
 182      </td>
 183      <td><?php print_string("auth_dbfieldpass", "auth_db") ?></td>
 184  </tr>
 185  
 186  <tr valign="top" class="required">
 187      <td align="right"><label for="menupasstype"><?php print_string("auth_dbpasstype_key", "auth_db") ?></label></td>
 188      <td>
 189          <?php
 190          $passtype = array();
 191          $passtype["plaintext"] = get_string("plaintext", "auth");
 192          $passtype["md5"]       = get_string("md5", "auth");
 193          $passtype["sha1"]      = get_string("sha1", "auth");
 194          $passtype["saltedcrypt"]      = get_string("auth_dbsaltedcrypt", "auth_db");
 195          $passtype["internal"]  = get_string("internal", "auth");
 196          echo html_writer::select($passtype, "passtype", $config->passtype, false);
 197  
 198          ?>
 199      </td>
 200      <td><?php print_string("auth_dbpasstype", "auth_db") ?></td>
 201  </tr>
 202  
 203  <tr valign="top" class="required">
 204      <td align="right"><label for="extencoding"><?php print_string("auth_dbextencoding", "auth_db") ?></label></td>
 205      <td>
 206          <input id="extencoding" name="extencoding" type="text" value="<?php echo $config->extencoding ?>" />
 207          <?php
 208  
 209          if (isset($err['extencoding'])) {
 210              echo $OUTPUT->error_text($err['extencoding']);
 211          }
 212  
 213          ?>
 214      </td>
 215      <td><?php print_string('auth_dbextencodinghelp', 'auth_db') ?></td>
 216  </tr>
 217  
 218  <tr valign="top">
 219      <td align="right"><label for="setupsql"><?php print_string("auth_dbsetupsql", "auth_db") ?></label></td>
 220      <td>
 221          <input id="setupsql" name="setupsql" type="text" value="<?php echo $config->setupsql ?>" />
 222      </td>
 223      <td><?php print_string('auth_dbsetupsqlhelp', 'auth_db') ?></td>
 224  </tr>
 225  
 226  <tr valign="top">
 227      <td align="right"><label for="menudebugauthdb"><?php print_string("auth_dbdebugauthdb", "auth_db") ?></label></td>
 228      <td>
 229          <?php echo html_writer::select($yesno, 'debugauthdb', $config->debugauthdb, false); ?>
 230      </td>
 231      <td><?php print_string("auth_dbdebugauthdbhelp", "auth_db") ?></td>
 232  </tr>
 233  
 234  <tr valign="top">
 235      <td align="right"><label for="changepasswordurl"><?php print_string("auth_dbchangepasswordurl_key", "auth_db") ?></label></td>
 236      <td>
 237          <input id="changepasswordurl" name="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
 238          <?php
 239  
 240          if (isset($err['changepasswordurl'])) {
 241              echo $OUTPUT->error_text($err['changepasswordurl']);
 242          }
 243  
 244          ?>
 245      </td>
 246      <td><?php print_string('changepasswordhelp', 'auth') ?></td>
 247  </tr>
 248  
 249  <tr>
 250     <td colspan="2">
 251          <h4><?php print_string('auth_sync_script', 'auth') ?> </h4>
 252     </td>
 253  </tr>
 254  
 255  <tr valign="top">
 256      <td align="right"><label for="menuremoveuser"><?php print_string('auth_remove_user_key','auth') ?></label></td>
 257      <td>
 258      <?php
 259         $deleteopt = array();
 260         $deleteopt[AUTH_REMOVEUSER_KEEP] = get_string('auth_remove_keep','auth');
 261         $deleteopt[AUTH_REMOVEUSER_SUSPEND] = get_string('auth_remove_suspend','auth');
 262         $deleteopt[AUTH_REMOVEUSER_FULLDELETE] = get_string('auth_remove_delete','auth');
 263         echo html_writer::select($deleteopt, 'removeuser', $config->removeuser, false);
 264      ?>
 265      </td>
 266      <td>
 267      <?php print_string('auth_remove_user','auth') ?>
 268      </td>
 269  </tr>
 270  
 271  <?php
 272  
 273  print_auth_lock_options($this->authtype, $user_fields, get_string('auth_dbextrafields', 'auth_db'), true, true, $this->get_custom_user_profile_fields());
 274  
 275  ?>
 276  </table>


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1