mirror of
https://github.com/moodle/moodle.git
synced 2025-02-24 20:13:14 +01:00
199 lines
5.4 KiB
HTML
199 lines
5.4 KiB
HTML
<?php
|
|
|
|
// set to defaults if undefined
|
|
if (!isset($config->host)) {
|
|
$config->host = "localhost";
|
|
}
|
|
if (!isset($config->type)) {
|
|
$config->type = "mysql";
|
|
}
|
|
if (!isset($config->name)) {
|
|
$config->name = "";
|
|
}
|
|
if (!isset($config->user)) {
|
|
$config->user = "";
|
|
}
|
|
if (!isset($config->pass)) {
|
|
$config->pass = "";
|
|
}
|
|
if (!isset($config->table)) {
|
|
$config->table = "";
|
|
}
|
|
if (!isset($config->fielduser)) {
|
|
$config->fielduser = "";
|
|
}
|
|
if (!isset($config->fieldpass)) {
|
|
$config->fieldpass = "";
|
|
}
|
|
if (!isset($config->passtype)) {
|
|
$config->passtype = "plaintext";
|
|
}
|
|
if (!isset($config->changepasswordurl)) {
|
|
$config->changepasswordurl = '';
|
|
}
|
|
|
|
$pluginconfig = get_config('auth/db');
|
|
|
|
?>
|
|
<table cellspacing="0" cellpadding="5" border="0" align="center">
|
|
|
|
<tr valign="top" class="required">
|
|
<td align="right"><?php print_string("auth_dbhost_key", "auth") ?>: </td>
|
|
<td>
|
|
<input name="host" type="text" size="30" value="<?php echo $config->host?>" />
|
|
<?php
|
|
|
|
if (isset($err["host"])) {
|
|
formerr($err["host"]);
|
|
}
|
|
|
|
?>
|
|
</td>
|
|
<td><?php print_string("auth_dbhost", "auth") ?></td>
|
|
</tr>
|
|
|
|
<tr valign="top" class="required">
|
|
<td align="right"><?php print_string("auth_dbtype_key", "auth") ?>: </td>
|
|
<td>
|
|
<?php $dbtypes = array("access","ado_access", "ado", "ado_mssql", "borland_ibase", "csv", "db2", "fbsql", "firebird", "ibase", "informix72", "informix", "mssql", "mssql_n", "mysql", "mysqlt", "oci805", "oci8", "oci8po", "odbc", "odbc_mssql", "odbc_oracle", "oracle", "postgres64", "postgres7", "postgres", "proxy", "sqlanywhere", "sybase", "vfp");
|
|
foreach ($dbtypes as $dbtype) {
|
|
$dboptions[$dbtype] = $dbtype;
|
|
}
|
|
choose_from_menu($dboptions, "type", $config->type, "");
|
|
?>
|
|
|
|
</td>
|
|
<td>
|
|
<?php print_string("auth_dbtype","auth") ?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top" class="required">
|
|
<td align="right"><?php print_string("auth_dbname_key", "auth") ?>: </td>
|
|
<td>
|
|
<input name="name" type="text" size="30" value="<?php echo $config->name?>" />
|
|
<?php
|
|
|
|
if (isset($err["name"])) {
|
|
formerr($err["name"]);
|
|
}
|
|
|
|
?>
|
|
</td>
|
|
<td><?php print_string("auth_dbname", "auth") ?></td>
|
|
</tr>
|
|
|
|
<tr valign="top" class="required">
|
|
<td align="right"><?php print_string("auth_dbuser_key", "auth") ?>: </td>
|
|
<td>
|
|
<input name="user" type="text" size="30" value="<?php echo $config->user?>" />
|
|
<?php
|
|
|
|
if (isset($err["user"])) {
|
|
formerr($err["user"]);
|
|
}
|
|
|
|
?>
|
|
</td>
|
|
<td><?php print_string("auth_dbuser", "auth") ?></td>
|
|
</tr>
|
|
|
|
<tr valign="top" class="required">
|
|
<td align="right"><?php print_string("auth_dbpass_key", "auth") ?>: </td>
|
|
<td>
|
|
<input name="pass" type="text" size="30" value="<?php echo $config->pass?>" />
|
|
<?php
|
|
|
|
if (isset($err["pass"])) {
|
|
formerr($err["pass"]);
|
|
}
|
|
|
|
?>
|
|
</td>
|
|
<td>
|
|
<?php print_string("auth_dbpass", "auth") ?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top" class="required">
|
|
<td align="right"><?php print_string("auth_dbtable_key", "auth") ?>: </td>
|
|
<td>
|
|
<input name="table" type="text" size="30" value="<?php echo $config->table?>" />
|
|
<?php
|
|
|
|
if (isset($err["table"])) {
|
|
formerr($err["table"]);
|
|
}
|
|
|
|
?>
|
|
</td>
|
|
<td><?php print_string("auth_dbtable", "auth") ?></td>
|
|
</tr>
|
|
|
|
<tr valign="top" class="required">
|
|
<td align="right"><?php print_string("auth_dbfielduser_key", "auth") ?>: </td>
|
|
<td>
|
|
<input name="fielduser" type="text" size="30" value="<?php echo $config->fielduser?>" />
|
|
<?php
|
|
|
|
if (isset($err["fielduser"])) {
|
|
formerr($err["fielduser"]);
|
|
}
|
|
|
|
?>
|
|
</td>
|
|
<td><?php print_string("auth_dbfielduser", "auth") ?></td>
|
|
</tr>
|
|
|
|
<tr valign="top" class="required">
|
|
<td align="right"><?php print_string("auth_dbfieldpass_key", "auth") ?>: </td>
|
|
<td>
|
|
<input name="fieldpass" type="text" size="30" value="<?php echo $config->fieldpass?>" />
|
|
<?php
|
|
|
|
if (isset($err["fieldpass"])) {
|
|
formerr($err["fieldpass"]);
|
|
}
|
|
|
|
?>
|
|
</td>
|
|
<td><?php print_string("auth_dbfieldpass", "auth") ?></td>
|
|
</tr>
|
|
|
|
<tr valign="top" class="required">
|
|
<td align="right"><?php print_string("auth_dbpasstype_key", "auth") ?>: </td>
|
|
<td>
|
|
<?php
|
|
|
|
$passtype["plaintext"] = get_string("plaintext", "auth");
|
|
$passtype["md5"] = get_string("md5", "auth");
|
|
$passtype["internal"] = get_string("internal", "auth");
|
|
choose_from_menu($passtype, "passtype", $config->passtype, "");
|
|
|
|
?>
|
|
</td>
|
|
<td><?php print_string("auth_dbpasstype", "auth") ?></td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="right"><?php print_string("auth_dbchangepasswordurl_key", "auth") ?>: </td>
|
|
<td>
|
|
<input name="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
|
|
<?php
|
|
|
|
if (isset($err['changepasswordurl'])) {
|
|
formerr($err['changepasswordurl']);
|
|
}
|
|
|
|
?>
|
|
</td>
|
|
<td><?php print_string('changepasswordhelp', 'auth') ?></td>
|
|
</tr>
|
|
<?php
|
|
|
|
global $user_fields;
|
|
print_auth_lock_options('db', $user_fields, get_string('auth_dbextrafields', 'auth'), true, false);
|
|
|
|
?>
|
|
</table>
|