MDL-61786 auth: Changed strings for Test Settings to lang strings

The output strings for the Test Settings function were hard-coded English
strings. They've been changed to standard language strings which can be
translated and maintained via AMOS.
This commit is contained in:
Leon Stringer 2018-04-12 17:59:41 +01:00 committed by Adrian Greeve
parent 50e48a8f2d
commit 6bdccc7438
2 changed files with 12 additions and 6 deletions

View File

@ -709,12 +709,12 @@ class auth_plugin_db extends auth_plugin_base {
raise_memory_limit(MEMORY_HUGE);
if (empty($this->config->table)) {
echo $OUTPUT->notification('External table not specified.', 'notifyproblem');
echo $OUTPUT->notification(get_string('auth_dbnoexttable', 'auth_db'), 'notifyproblem');
return;
}
if (empty($this->config->fielduser)) {
echo $OUTPUT->notification('External user field not specified.', 'notifyproblem');
echo $OUTPUT->notification(get_string('auth_dbnouserfield', 'auth_db'), 'notifyproblem');
return;
}
@ -735,7 +735,7 @@ class auth_plugin_db extends auth_plugin_base {
error_reporting($CFG->debug);
ob_end_flush();
echo $OUTPUT->notification('Cannot connect the database.', 'notifyproblem');
echo $OUTPUT->notification(get_string('auth_dbcannotconnect', 'auth_db'), 'notifyproblem');
return;
}
@ -744,17 +744,17 @@ class auth_plugin_db extends auth_plugin_base {
WHERE {$this->config->fielduser} <> 'random_unlikely_username'"); // Any unlikely name is ok here.
if (!$rs) {
echo $OUTPUT->notification('Can not read external table.', 'notifyproblem');
echo $OUTPUT->notification(get_string('auth_dbcannotreadtable', 'auth_db'), 'notifyproblem');
} else if ($rs->EOF) {
echo $OUTPUT->notification('External table is empty.', 'notifyproblem');
echo $OUTPUT->notification(get_string('auth_dbtableempty', 'auth_db'), 'notifyproblem');
$rs->close();
} else {
$fields_obj = $rs->FetchObj();
$columns = array_keys((array)$fields_obj);
echo $OUTPUT->notification('External table contains following columns:<br />'.implode(', ', $columns), 'notifysuccess');
echo $OUTPUT->notification(get_string('auth_dbcolumnlist', 'auth_db', implode(', ', $columns)), 'notifysuccess');
$rs->close();
}

View File

@ -68,5 +68,11 @@ $string['auth_dbuser'] = 'Username with read access to the database';
$string['auth_dbuser_key'] = 'DB user';
$string['auth_dbuserstoadd'] = 'User entries to add: {$a}';
$string['auth_dbuserstoremove'] = 'User entries to remove: {$a}';
$string['auth_dbnoexttable'] = 'External table not specified.';
$string['auth_dbnouserfield'] = 'External user field not specified.';
$string['auth_dbcannotconnect'] = 'Cannot connect to external database.';
$string['auth_dbcannotreadtable'] = 'Cannot read external table.';
$string['auth_dbtableempty'] = 'External table is empty.';
$string['auth_dbcolumnlist'] = 'External table contains the following columns:<br />{$a}';
$string['pluginname'] = 'External database';
$string['privacy:metadata'] = 'The External database authentication plugin does not store any personal data.';