summaryrefslogtreecommitdiffstats
path: root/lib/group
diff options
context:
space:
mode:
authorThomas Mueller <thomas.mueller@tmit.eu>2012-09-07 15:22:01 +0200
committerThomas Mueller <thomas.mueller@tmit.eu>2012-09-07 15:22:01 +0200
commit3829460ab8cbb6de65c53583a20fd04cbe7927dd (patch)
tree4dc24845a5eb31b17510a621e14c15b51f16bf7b /lib/group
parent785aa751bb5f9a4bcdd677b96207550482e17d3c (diff)
downloadnextcloud-server-3829460ab8cbb6de65c53583a20fd04cbe7927dd.tar.gz
nextcloud-server-3829460ab8cbb6de65c53583a20fd04cbe7927dd.zip
adding space between) and {
Diffstat (limited to 'lib/group')
-rw-r--r--lib/group/backend.php12
-rw-r--r--lib/group/database.php18
-rw-r--r--lib/group/dummy.php32
3 files changed, 31 insertions, 31 deletions
diff --git a/lib/group/backend.php b/lib/group/backend.php
index 5969986c652..1ba34c940cf 100644
--- a/lib/group/backend.php
+++ b/lib/group/backend.php
@@ -52,9 +52,9 @@ abstract class OC_Group_Backend implements OC_Group_Interface {
* Returns the supported actions as int to be
* compared with OC_USER_BACKEND_CREATE_USER etc.
*/
- public function getSupportedActions(){
+ public function getSupportedActions() {
$actions = 0;
- foreach($this->possibleActions AS $action => $methodName){
+ foreach($this->possibleActions AS $action => $methodName) {
if(method_exists($this, $methodName)) {
$actions |= $action;
}
@@ -71,7 +71,7 @@ abstract class OC_Group_Backend implements OC_Group_Interface {
* Returns the supported actions as int to be
* compared with OC_GROUP_BACKEND_CREATE_GROUP etc.
*/
- public function implementsActions($actions){
+ public function implementsActions($actions) {
return (bool)($this->getSupportedActions() & $actions);
}
@@ -83,7 +83,7 @@ abstract class OC_Group_Backend implements OC_Group_Interface {
*
* Checks whether the user is member of a group or not.
*/
- public function inGroup($uid, $gid){
+ public function inGroup($uid, $gid) {
return in_array($gid, $this->getUserGroups($uid));
}
@@ -95,7 +95,7 @@ abstract class OC_Group_Backend implements OC_Group_Interface {
* This function fetches all groups a user belongs to. It does not check
* if the user exists at all.
*/
- public function getUserGroups($uid){
+ public function getUserGroups($uid) {
return array();
}
@@ -115,7 +115,7 @@ abstract class OC_Group_Backend implements OC_Group_Interface {
* @param string $gid
* @return bool
*/
- public function groupExists($gid){
+ public function groupExists($gid) {
return in_array($gid, $this->getGroups($gid, 1));
}
diff --git a/lib/group/database.php b/lib/group/database.php
index 52608b2db73..f3012563acf 100644
--- a/lib/group/database.php
+++ b/lib/group/database.php
@@ -50,12 +50,12 @@ class OC_Group_Database extends OC_Group_Backend {
* Trys to create a new group. If the group name already exists, false will
* be returned.
*/
- public function createGroup( $gid ){
+ public function createGroup( $gid ) {
// Check for existence
$stmt = OC_DB::prepare( "SELECT `gid` FROM `*PREFIX*groups` WHERE `gid` = ?" );
$result = $stmt->execute( array( $gid ));
- if( $result->fetchRow() ){
+ if( $result->fetchRow() ) {
// Can not add an existing group
return false;
}
@@ -75,7 +75,7 @@ class OC_Group_Database extends OC_Group_Backend {
*
* Deletes a group and removes it from the group_user-table
*/
- public function deleteGroup( $gid ){
+ public function deleteGroup( $gid ) {
// Delete the group
$stmt = OC_DB::prepare( "DELETE FROM `*PREFIX*groups` WHERE `gid` = ?" );
$result = $stmt->execute( array( $gid ));
@@ -95,7 +95,7 @@ class OC_Group_Database extends OC_Group_Backend {
*
* Checks whether the user is member of a group or not.
*/
- public function inGroup( $uid, $gid ){
+ public function inGroup( $uid, $gid ) {
// check
$stmt = OC_DB::prepare( "SELECT `uid` FROM `*PREFIX*group_user` WHERE `gid` = ? AND `uid` = ?" );
$result = $stmt->execute( array( $gid, $uid ));
@@ -111,9 +111,9 @@ class OC_Group_Database extends OC_Group_Backend {
*
* Adds a user to a group.
*/
- public function addToGroup( $uid, $gid ){
+ public function addToGroup( $uid, $gid ) {
// No duplicate entries!
- if( !$this->inGroup( $uid, $gid )){
+ if( !$this->inGroup( $uid, $gid )) {
$stmt = OC_DB::prepare( "INSERT INTO `*PREFIX*group_user` ( `uid`, `gid` ) VALUES( ?, ? )" );
$stmt->execute( array( $uid, $gid ));
return true;
@@ -130,7 +130,7 @@ class OC_Group_Database extends OC_Group_Backend {
*
* removes the user from a group.
*/
- public function removeFromGroup( $uid, $gid ){
+ public function removeFromGroup( $uid, $gid ) {
$stmt = OC_DB::prepare( "DELETE FROM `*PREFIX*group_user` WHERE `uid` = ? AND `gid` = ?" );
$stmt->execute( array( $uid, $gid ));
@@ -145,13 +145,13 @@ class OC_Group_Database extends OC_Group_Backend {
* This function fetches all groups a user belongs to. It does not check
* if the user exists at all.
*/
- public function getUserGroups( $uid ){
+ public function getUserGroups( $uid ) {
// No magic!
$stmt = OC_DB::prepare( "SELECT `gid` FROM `*PREFIX*group_user` WHERE `uid` = ?" );
$result = $stmt->execute( array( $uid ));
$groups = array();
- while( $row = $result->fetchRow()){
+ while( $row = $result->fetchRow()) {
$groups[] = $row["gid"];
}
diff --git a/lib/group/dummy.php b/lib/group/dummy.php
index 51eca28f3f4..8116dcbd675 100644
--- a/lib/group/dummy.php
+++ b/lib/group/dummy.php
@@ -34,8 +34,8 @@ class OC_Group_Dummy extends OC_Group_Backend {
* Trys to create a new group. If the group name already exists, false will
* be returned.
*/
- public function createGroup($gid){
- if(!isset($this->groups[$gid])){
+ public function createGroup($gid) {
+ if(!isset($this->groups[$gid])) {
$this->groups[$gid]=array();
return true;
}else{
@@ -50,8 +50,8 @@ class OC_Group_Dummy extends OC_Group_Backend {
*
* Deletes a group and removes it from the group_user-table
*/
- public function deleteGroup($gid){
- if(isset($this->groups[$gid])){
+ public function deleteGroup($gid) {
+ if(isset($this->groups[$gid])) {
unset($this->groups[$gid]);
return true;
}else{
@@ -67,8 +67,8 @@ class OC_Group_Dummy extends OC_Group_Backend {
*
* Checks whether the user is member of a group or not.
*/
- public function inGroup($uid, $gid){
- if(isset($this->groups[$gid])){
+ public function inGroup($uid, $gid) {
+ if(isset($this->groups[$gid])) {
return (array_search($uid,$this->groups[$gid])!==false);
}else{
return false;
@@ -83,9 +83,9 @@ class OC_Group_Dummy extends OC_Group_Backend {
*
* Adds a user to a group.
*/
- public function addToGroup($uid, $gid){
- if(isset($this->groups[$gid])){
- if(array_search($uid,$this->groups[$gid])===false){
+ public function addToGroup($uid, $gid) {
+ if(isset($this->groups[$gid])) {
+ if(array_search($uid,$this->groups[$gid])===false) {
$this->groups[$gid][]=$uid;
return true;
}else{
@@ -104,9 +104,9 @@ class OC_Group_Dummy extends OC_Group_Backend {
*
* removes the user from a group.
*/
- public function removeFromGroup($uid,$gid){
- if(isset($this->groups[$gid])){
- if(($index=array_search($uid,$this->groups[$gid]))!==false){
+ public function removeFromGroup($uid,$gid) {
+ if(isset($this->groups[$gid])) {
+ if(($index=array_search($uid,$this->groups[$gid]))!==false) {
unset($this->groups[$gid][$index]);
}else{
return false;
@@ -124,11 +124,11 @@ class OC_Group_Dummy extends OC_Group_Backend {
* This function fetches all groups a user belongs to. It does not check
* if the user exists at all.
*/
- public function getUserGroups($uid){
+ public function getUserGroups($uid) {
$groups=array();
$allGroups=array_keys($this->groups);
- foreach($allGroups as $group){
- if($this->inGroup($uid,$group)){
+ foreach($allGroups as $group) {
+ if($this->inGroup($uid,$group)) {
$groups[]=$group;
}
}
@@ -150,7 +150,7 @@ class OC_Group_Dummy extends OC_Group_Backend {
* @returns array with user ids
*/
public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
- if(isset($this->groups[$gid])){
+ if(isset($this->groups[$gid])) {
return $this->groups[$gid];
}else{
return array();