summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLorenzo M. Catucci <lorenzo@sancho.ccd.uniroma2.it>2012-12-06 18:09:47 +0100
committerLorenzo M. Catucci <lorenzo@sancho.ccd.uniroma2.it>2012-12-07 17:19:26 +0100
commit15afbfd198f9f54cee8717776b4f45f73d9b1cbf (patch)
treeb3a6478a0c7914a38661e5f24aa5c81e856729d0 /lib
parent588bbd2c9f36761a8bf6f0b736d3042940c6fa18 (diff)
downloadnextcloud-server-15afbfd198f9f54cee8717776b4f45f73d9b1cbf.tar.gz
nextcloud-server-15afbfd198f9f54cee8717776b4f45f73d9b1cbf.zip
Add an $excludingBackend optional parameter
to the userExists method both in OCP\User and in OC_User.
Diffstat (limited to 'lib')
-rw-r--r--lib/public/user.php6
-rw-r--r--lib/user.php7
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/public/user.php b/lib/public/user.php
index b320ce8ea0c..9e50115ab70 100644
--- a/lib/public/user.php
+++ b/lib/public/user.php
@@ -65,12 +65,12 @@ class User {
/**
* @brief check if a user exists
* @param string $uid the username
+ * @param string $excludingBackend (default none)
* @return boolean
*/
- public static function userExists( $uid ) {
- return \OC_USER::userExists( $uid );
+ public static function userExists( $uid, $excludingBackend = null ) {
+ return \OC_USER::userExists( $uid, $excludingBackend );
}
-
/**
* @brief Loggs the user out including all the session data
* @returns true
diff --git a/lib/user.php b/lib/user.php
index 31c93740d77..d55c6165a09 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -407,10 +407,15 @@ class OC_User {
/**
* @brief check if a user exists
* @param string $uid the username
+ * @param string $excludingBackend (default none)
* @return boolean
*/
- public static function userExists($uid) {
+ public static function userExists($uid, $excludingBackend=null) {
foreach(self::$_usedBackends as $backend) {
+ if (!is_null($excludingBackend) && !strcmp(get_class($backend),$excludingBackend)) {
+ OC_Log::write('OC_User', $excludingBackend . 'excluded from user existance check.', OC_Log::DEBUG);
+ continue;
+ }
$result=$backend->userExists($uid);
if($result===true) {
return true;