From 59669b63f090311045382bb384fc666aa4259793 Mon Sep 17 00:00:00 2001 From: skodak Date: Fri, 25 Apr 2008 13:22:02 +0000 Subject: [PATCH] MDL-14543 fixed broken deleting from auth sync - credit goes to Juris Treibahs ; merged from MOODLE_19_STABLE --- auth/cas/auth.php | 2 +- auth/db/auth.php | 4 ++-- auth/ldap/auth.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/auth/cas/auth.php b/auth/cas/auth.php index d849227770..edeecb102d 100644 --- a/auth/cas/auth.php +++ b/auth/cas/auth.php @@ -695,7 +695,7 @@ if ( !is_object($PHPCAS_CLIENT) ) { // 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 (!empty($this->config->removeuser)) { - $sql = "SELECT u.id, u.username, u.email + $sql = "SELECT u.id, u.username, u.email, u.auth FROM {$CFG->prefix}user u LEFT JOIN $temptable e ON u.username = e.username WHERE u.auth='cas' diff --git a/auth/db/auth.php b/auth/db/auth.php index 334437fe7c..c4e0d8d564 100644 --- a/auth/db/auth.php +++ b/auth/db/auth.php @@ -238,11 +238,11 @@ class auth_plugin_db extends auth_plugin_base { // find obsolete users if (count($userlist)) { - $sql = "SELECT u.id, u.username, u.email + $sql = "SELECT u.id, u.username, u.email, u.auth FROM {$CFG->prefix}user u WHERE u.auth='db' AND u.deleted=0 AND u.username NOT IN ($quoteduserlist)"; } else { - $sql = "SELECT u.id, u.username, u.email + $sql = "SELECT u.id, u.username, u.email, u.auth FROM {$CFG->prefix}user u WHERE u.auth='db' AND u.deleted=0"; } diff --git a/auth/ldap/auth.php b/auth/ldap/auth.php index cd9aab84c1..e6b106d934 100644 --- a/auth/ldap/auth.php +++ b/auth/ldap/auth.php @@ -643,7 +643,7 @@ class auth_plugin_ldap extends auth_plugin_base { // 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 (!empty($this->config->removeuser)) { - $sql = "SELECT u.id, u.username, u.email + $sql = "SELECT u.id, u.username, u.email, u.auth FROM {$CFG->prefix}user u LEFT JOIN $temptable e ON u.username = e.username WHERE u.auth='ldap' -- 2.39.5