Permalink
Browse files

MDL-28182 always use full user object when deleting users

  • Loading branch information...
1 parent ac30618 commit 3f51ad2a702bf8102e52598b06cecb60078f14f3 @skodak skodak committed Jul 22, 2011
Showing with 5 additions and 5 deletions.
  1. +2 −2 auth/db/auth.php
  2. +1 −1 auth/ldap/auth.php
  3. +1 −1 lib/cronlib.php
  4. +1 −1 lib/moodlelib.php
View
@@ -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
@@ -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
@@ -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
@@ -3406,7 +3406,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) {

0 comments on commit 3f51ad2

Please sign in to comment.