web service MDL-21351 list of selectabl users should not include deleted user
authorjerome mouneyrac <jerome@moodle.com>
Wed, 21 Apr 2010 06:30:50 +0000 (06:30 +0000)
committerjerome mouneyrac <jerome@moodle.com>
Wed, 21 Apr 2010 06:30:50 +0000 (06:30 +0000)
admin/webservice/lib.php

index c192dc2..137b672 100644 (file)
@@ -69,12 +69,13 @@ class service_user_selector extends user_selector_base {
             ///the following SQL retrieve all users that are allowed to the serviceid
             $sql = " FROM {user} u, {external_services_users} esu
                  WHERE $wherecondition
+                       AND u.deleted = 0
                        AND esu.userid = u.id
                        AND esu.externalserviceid = :serviceid";
         }
         else {
             ///the following SQL retrieve all users that are not allowed to the serviceid
-            $sql = " FROM {user} u WHERE $wherecondition
+            $sql = " FROM {user} u WHERE $wherecondition AND u.deleted = 0
                  AND NOT EXISTS (SELECT esu.userid FROM {external_services_users} esu
                                                   WHERE esu.externalserviceid = :serviceid
                                                         AND esu.userid = u.id)";