Skip to content

Commit

Permalink
Merge branch 'MDL-65847-auth_db_error_handling' of git://github.com/l…
Browse files Browse the repository at this point in the history
…eonstr/moodle into master
  • Loading branch information
stronk7 committed Aug 18, 2020
2 parents d66512d + 5049102 commit dd844d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions auth/db/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,12 @@ function user_update($olduser, $newuser) {
}
}
if (!empty($update)) {
$authdb->Execute("UPDATE {$this->config->table}
SET ".implode(',', $update)."
WHERE {$this->config->fielduser}='".$this->ext_addslashes($extusername)."'");
$sql = "UPDATE {$this->config->table}
SET ".implode(',', $update)."
WHERE {$this->config->fielduser} = ?";
if (!$authdb->Execute($sql, array($this->ext_addslashes($extusername)))) {
print_error('auth_dbupdateerror', 'auth_db');
}
}
$authdb->Close();
return true;
Expand Down
1 change: 1 addition & 0 deletions auth/db/lang/en/auth_db.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@
$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['auth_dbupdateerror'] = 'Error updating external database.';
$string['pluginname'] = 'External database';
$string['privacy:metadata'] = 'The External database authentication plugin does not store any personal data.';

0 comments on commit dd844d9

Please sign in to comment.