PageRenderTime 46ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/auth/db/config.html

https://github.com/mrmark/moodle
HTML | 289 lines | 247 code | 42 blank | 0 comment | 0 complexity | 8f8bc9a7692fd5dd47691523d99751ec MD5 | raw file
  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. if (!isset($config->updateusers)) {
  50. $config->updateusers = 0;
  51. }
  52. $yesno = array( get_string('no'), get_string('yes') );
  53. ?>
  54. <table cellspacing="0" cellpadding="5" border="0">
  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" class="text-ltr" size="30" value="<?php echo $config->host?>" />
  59. <?php
  60. if (isset($err["host"])) {
  61. echo $OUTPUT->error_text($err["host"]);
  62. }
  63. ?>
  64. </td>
  65. <td><?php print_string("auth_dbhost", "auth_db") ?></td>
  66. </tr>
  67. <tr valign="top" class="required">
  68. <td align="right"><label for="menutype"><?php print_string("auth_dbtype_key", "auth_db") ?></label></td>
  69. <td>
  70. <?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");
  71. foreach ($dbtypes as $dbtype) {
  72. $dboptions[$dbtype] = $dbtype;
  73. }
  74. echo html_writer::select($dboptions, "type", $config->type, false);
  75. ?>
  76. </td>
  77. <td>
  78. <?php print_string("auth_dbtype","auth_db") ?>
  79. </td>
  80. </tr>
  81. <tr valign="top" class="required">
  82. <td align="right"><label for="menusybasequoting"><?php print_string("auth_dbsybasequoting", "auth_db") ?></label></td>
  83. <td>
  84. <?php echo html_writer::select($yesno, 'sybasequoting', $config->sybasequoting, false); ?>
  85. </td>
  86. <td><?php print_string("auth_dbsybasequotinghelp", "auth_db") ?></td>
  87. </tr>
  88. <tr valign="top" class="required">
  89. <td align="right"><label for="name"><?php print_string("auth_dbname_key", "auth_db") ?></label></td>
  90. <td>
  91. <input id="name" name="name" type="text" class="text-ltr" size="30" value="<?php echo $config->name?>" />
  92. <?php
  93. if (isset($err["name"])) {
  94. echo $OUTPUT->error_text($err["name"]);
  95. }
  96. ?>
  97. </td>
  98. <td><?php print_string("auth_dbname", "auth_db") ?></td>
  99. </tr>
  100. <tr valign="top" class="required">
  101. <td align="right"><label for="user"><?php print_string("auth_dbuser_key", "auth_db") ?></label></td>
  102. <td>
  103. <input id="user" name="user" type="text" class="text-ltr" size="30" value="<?php echo $config->user?>" />
  104. <?php
  105. if (isset($err["user"])) {
  106. echo $OUTPUT->error_text($err["user"]);
  107. }
  108. ?>
  109. </td>
  110. <td><?php print_string("auth_dbuser", "auth_db") ?></td>
  111. </tr>
  112. <tr valign="top" class="required">
  113. <td align="right"><label for="pass"><?php print_string("auth_dbpass_key", "auth_db") ?></label></td>
  114. <td>
  115. <input id="pass" name="pass" type="password" class="text-ltr" size="30" value="<?php p($config->pass)?>" autocomplete="off"/>
  116. <?php
  117. if (isset($err["pass"])) {
  118. echo $OUTPUT->error_text($err["pass"]);
  119. }
  120. ?>
  121. </td>
  122. <td>
  123. <?php print_string("auth_dbpass", "auth_db") ?>
  124. </td>
  125. </tr>
  126. <tr valign="top" class="required">
  127. <td align="right"><label for="table"><?php print_string("auth_dbtable_key", "auth_db") ?></label></td>
  128. <td>
  129. <input id="table" name="table" type="text" class="text-ltr" size="30" value="<?php echo $config->table?>" />
  130. <?php
  131. if (isset($err["table"])) {
  132. echo $OUTPUT->error_text($err["table"]);
  133. }
  134. ?>
  135. </td>
  136. <td><?php print_string("auth_dbtable", "auth_db") ?></td>
  137. </tr>
  138. <tr valign="top" class="required">
  139. <td align="right"><label for="fielduser"><?php print_string("auth_dbfielduser_key", "auth_db") ?></label></td>
  140. <td>
  141. <input id="fielduser" name="fielduser" type="text" class="text-ltr" size="30" value="<?php echo $config->fielduser?>" />
  142. <?php
  143. if (isset($err["fielduser"])) {
  144. echo $OUTPUT->error_text($err["fielduser"]);
  145. }
  146. ?>
  147. </td>
  148. <td><?php print_string("auth_dbfielduser", "auth_db") ?></td>
  149. </tr>
  150. <tr valign="top" class="required">
  151. <td align="right"><label for="fieldpass"><?php print_string("auth_dbfieldpass_key", "auth_db") ?></label></td>
  152. <td>
  153. <input id="fieldpass" name="fieldpass" type="text" class="text-ltr" size="30" value="<?php echo $config->fieldpass?>" />
  154. <?php
  155. if (isset($err["fieldpass"])) {
  156. echo $OUTPUT->error_text($err["fieldpass"]);
  157. }
  158. ?>
  159. </td>
  160. <td><?php print_string("auth_dbfieldpass", "auth_db") ?></td>
  161. </tr>
  162. <tr valign="top" class="required">
  163. <td align="right"><label for="menupasstype"><?php print_string("auth_dbpasstype_key", "auth_db") ?></label></td>
  164. <td>
  165. <?php
  166. $passtype = array();
  167. $passtype["plaintext"] = get_string("plaintext", "auth");
  168. $passtype["md5"] = get_string("md5", "auth");
  169. $passtype["sha1"] = get_string("sha1", "auth");
  170. $passtype["saltedcrypt"] = get_string("auth_dbsaltedcrypt", "auth_db");
  171. $passtype["internal"] = get_string("internal", "auth");
  172. echo html_writer::select($passtype, "passtype", $config->passtype, false);
  173. ?>
  174. </td>
  175. <td><?php print_string("auth_dbpasstype", "auth_db") ?></td>
  176. </tr>
  177. <tr valign="top" class="required">
  178. <td align="right"><label for="extencoding"><?php print_string("auth_dbextencoding", "auth_db") ?></label></td>
  179. <td>
  180. <input id="extencoding" name="extencoding" type="text" class="text-ltr" value="<?php echo $config->extencoding ?>" />
  181. <?php
  182. if (isset($err['extencoding'])) {
  183. echo $OUTPUT->error_text($err['extencoding']);
  184. }
  185. ?>
  186. </td>
  187. <td><?php print_string('auth_dbextencodinghelp', 'auth_db') ?></td>
  188. </tr>
  189. <tr valign="top">
  190. <td align="right"><label for="setupsql"><?php print_string("auth_dbsetupsql", "auth_db") ?></label></td>
  191. <td>
  192. <input id="setupsql" name="setupsql" type="text" class="text-ltr" value="<?php echo $config->setupsql ?>" />
  193. </td>
  194. <td><?php print_string('auth_dbsetupsqlhelp', 'auth_db') ?></td>
  195. </tr>
  196. <tr valign="top">
  197. <td align="right"><label for="menudebugauthdb"><?php print_string("auth_dbdebugauthdb", "auth_db") ?></label></td>
  198. <td>
  199. <?php echo html_writer::select($yesno, 'debugauthdb', $config->debugauthdb, false); ?>
  200. </td>
  201. <td><?php print_string("auth_dbdebugauthdbhelp", "auth_db") ?></td>
  202. </tr>
  203. <tr valign="top">
  204. <td align="right"><label for="changepasswordurl"><?php print_string("auth_dbchangepasswordurl_key", "auth_db") ?></label></td>
  205. <td>
  206. <input id="changepasswordurl" name="changepasswordurl" type="text" class="text-ltr" value="<?php echo $config->changepasswordurl ?>" />
  207. <?php
  208. if (isset($err['changepasswordurl'])) {
  209. echo $OUTPUT->error_text($err['changepasswordurl']);
  210. }
  211. ?>
  212. </td>
  213. <td><?php print_string('changepasswordhelp', 'auth') ?></td>
  214. </tr>
  215. <tr>
  216. <td colspan="2">
  217. <h4><?php print_string('auth_sync_script', 'auth') ?> </h4>
  218. </td>
  219. </tr>
  220. <tr valign="top">
  221. <td align="right"><label for="menuremoveuser"><?php print_string('auth_remove_user_key','auth') ?></label></td>
  222. <td>
  223. <?php
  224. $deleteopt = array();
  225. $deleteopt[AUTH_REMOVEUSER_KEEP] = get_string('auth_remove_keep','auth');
  226. $deleteopt[AUTH_REMOVEUSER_SUSPEND] = get_string('auth_remove_suspend','auth');
  227. $deleteopt[AUTH_REMOVEUSER_FULLDELETE] = get_string('auth_remove_delete','auth');
  228. echo html_writer::select($deleteopt, 'removeuser', $config->removeuser, false);
  229. ?>
  230. </td>
  231. <td>
  232. <?php print_string('auth_remove_user','auth') ?>
  233. </td>
  234. </tr>
  235. <tr valign="top">
  236. <td align="right"><label for="menuupdateusers"><?php print_string('auth_dbupdateusers', 'auth_db') ?></label></td>
  237. <td>
  238. <?php echo html_writer::select($yesno, 'updateusers', $config->updateusers, false); ?>
  239. </td>
  240. <td>
  241. <?php print_string('auth_dbupdateusers_description','auth_db') ?>
  242. </td>
  243. </tr>
  244. <?php
  245. print_auth_lock_options($this->authtype, $user_fields, get_string('auth_dbextrafields', 'auth_db'), true, true, $this->get_custom_user_profile_fields());
  246. ?>
  247. </table>