Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-28182 always use full user object when deleting users

  • Loading branch information...
commit 4133a3cd5b6e86621e01cb7a4a76443b0e8a4c78 1 parent aede1fe
@skodak skodak authored
View
4 auth/db/auth.php
@@ -230,11 +230,11 @@ function sync_users($do_updates=false) {
if (count($userlist)) {
list($notin_sql, $params) = $DB->get_in_or_equal($userlist, SQL_PARAMS_NAMED, 'u', false);
$params['authtype'] = $this->authtype;
- $sql = "SELECT u.id, u.username, u.email, u.auth
+ $sql = "SELECT u.*
FROM {user} u
WHERE u.auth=:authtype AND u.deleted=0 AND u.username $notin_sql";
} else {
- $sql = "SELECT u.id, u.username, u.email, u.auth
+ $sql = "SELECT u.*
FROM {user} u
WHERE u.auth=:authtype AND u.deleted=0";
$params = array();
View
2  auth/ldap/auth.php
@@ -689,7 +689,7 @@ function sync_users($do_updates=true) {
// Find users in DB that aren't in ldap -- to be removed!
// this is still not as scalable (but how often do we mass delete?)
if ($this->config->removeuser !== AUTH_REMOVEUSER_KEEP) {
- $sql = 'SELECT u.id, u.username, u.email, u.auth
+ $sql = 'SELECT u.*
FROM {user} u
LEFT JOIN {tmp_extuser} e ON (u.username = e.username AND u.mnethostid = e.mnethostid)
WHERE u.auth = ?
View
2  lib/cronlib.php
@@ -219,7 +219,7 @@ function cron_run() {
if (!empty($CFG->deleteincompleteusers)) {
$cuttime = $timenow - ($CFG->deleteincompleteusers * 3600);
- $rs = $DB->get_recordset_sql ("SELECT id, username
+ $rs = $DB->get_recordset_sql ("SELECT *
FROM {user}
WHERE confirmed = 1 AND lastaccess > 0
AND lastaccess < ? AND deleted = 0
View
2  lib/moodlelib.php
@@ -3410,7 +3410,7 @@ function truncate_userinfo($info) {
*
* Any plugin that needs to purge user data should register the 'user_deleted' event.
*
- * @param object $user User object before delete
+ * @param stdClass $user full user object before delete
* @return boolean always true
*/
function delete_user($user) {
Please sign in to comment.
Something went wrong with that request. Please try again.