aboutsummaryrefslogtreecommitdiffstats
path: root/lib/user.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-02-05 14:58:35 +0100
committerArthur Schiwon <blizzz@owncloud.com>2013-02-05 19:26:00 +0100
commit5221ee0c5aaca5588e20683f397fec9d1d6e98c7 (patch)
treeceb42e65f80c08d8faf8fae48fea3f19577628e2 /lib/user.php
parente6400b305987977d867f1592f3231167903b70b1 (diff)
downloadnextcloud-server-5221ee0c5aaca5588e20683f397fec9d1d6e98c7.tar.gz
nextcloud-server-5221ee0c5aaca5588e20683f397fec9d1d6e98c7.zip
offer change password only when the action is supported by the user backend
Diffstat (limited to 'lib/user.php')
-rw-r--r--lib/user.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/user.php b/lib/user.php
index 38259bceea5..f953d221543 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -420,6 +420,24 @@ class OC_User {
}
/**
+ * @brief Check whether user can change his password
+ * @param $uid The username
+ * @returns true/false
+ *
+ * Check whether a specified user can change his password
+ */
+ public static function canUserChangePassword($uid) {
+ foreach(self::$_usedBackends as $backend) {
+ if($backend->implementsActions(OC_USER_BACKEND_SET_PASSWORD)) {
+ if($backend->userExists($uid)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
* @brief Check if the password is correct
* @param $uid The username
* @param $password The password