diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-08-10 20:51:35 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-08-10 22:38:28 +0200 |
commit | f03874ac4994ac54816828a7e5d58570080c5bcf (patch) | |
tree | c57e9bb47514457005b6902c74ca64a6bc5cd766 /lib | |
parent | b54d790a873290e71654e94ac5072e87e6ba5427 (diff) | |
download | nextcloud-server-f03874ac4994ac54816828a7e5d58570080c5bcf.tar.gz nextcloud-server-f03874ac4994ac54816828a7e5d58570080c5bcf.zip |
work on user management
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 2 | ||||
-rw-r--r-- | lib/group.php | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/base.php b/lib/base.php index 93b8e0b584d..2e735514347 100644 --- a/lib/base.php +++ b/lib/base.php @@ -149,9 +149,11 @@ OC_Group::setBackend( OC_Config::getValue( "groupbackend", "database" )); OC_Util::addScript( "jquery-1.6.2.min" ); OC_Util::addScript( "jquery-ui-1.8.14.custom.min" ); OC_Util::addScript( "js" ); +OC_Util::addScript( "multiselect" ); OC_Util::addScript('search','result'); OC_Util::addStyle( "jquery-ui-1.8.14.custom" ); OC_Util::addStyle( "styles" ); +OC_Util::addStyle( "multiselect" ); // Load Apps // This includes plugins for users and filesystems as well 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()); + } } |