summaryrefslogtreecommitdiffstats
path: root/lib/group.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-08-10 20:51:35 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-08-10 22:38:28 +0200
commitf03874ac4994ac54816828a7e5d58570080c5bcf (patch)
treec57e9bb47514457005b6902c74ca64a6bc5cd766 /lib/group.php
parentb54d790a873290e71654e94ac5072e87e6ba5427 (diff)
downloadnextcloud-server-f03874ac4994ac54816828a7e5d58570080c5bcf.tar.gz
nextcloud-server-f03874ac4994ac54816828a7e5d58570080c5bcf.zip
work on user management
Diffstat (limited to 'lib/group.php')
-rw-r--r--lib/group.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/group.php b/lib/group.php
index 1161b9035fa..54dc0b6463c 100644
--- a/lib/group.php
+++ b/lib/group.php
@@ -171,11 +171,11 @@ class OC_Group {
*/
public static function addToGroup( $uid, $gid ){
// Does the user exist?
- if( !in_array( $uid, OC_User::getUsers())){
+ if( !OC_User::userExists($uid)){
return false;
}
// Does the group exist?
- if( !in_array( $gid, self::getGroups())){
+ if( !OC_Group::groupExists($gid)){
return false;
}
@@ -234,4 +234,13 @@ class OC_Group {
public static function getGroups(){
return self::$_backend->getGroups();
}
+
+ /**
+ * check if a group exists
+ * @param string $gid
+ * @return bool
+ */
+ public static function groupExists($gid){
+ return in_array( $gid, self::getGroups());
+ }
}