diff options
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()); + } } |