Update settings/ajax/creategroup.php

respect coding style
This commit is contained in:
Thomas Müller 2012-09-04 12:45:54 +03:00
parent a570cc7b60
commit caaaf7a7bf
1 changed files with 4 additions and 4 deletions

View File

@ -1,11 +1,11 @@
<?php <?php
// Init owncloud // Init owncloud
require_once('../../lib/base.php'); require_once '../../lib/base.php';
OCP\JSON::callCheck(); OCP\JSON::callCheck();
// Check if we are a user // Check if we are a user
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){ if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )) {
OC_JSON::error(array("data" => array( "message" => "Authentication error" ))); OC_JSON::error(array("data" => array( "message" => "Authentication error" )));
exit(); exit();
} }
@ -15,13 +15,13 @@ OCP\JSON::callCheck();
$groupname = $_POST["groupname"]; $groupname = $_POST["groupname"];
// Does the group exist? // Does the group exist?
if( in_array( $groupname, OC_Group::getGroups())){ if( in_array( $groupname, OC_Group::getGroups())) {
OC_JSON::error(array("data" => array( "message" => "Group already exists" ))); OC_JSON::error(array("data" => array( "message" => "Group already exists" )));
exit(); exit();
} }
// Return Success story // Return Success story
if( OC_Group::createGroup( $groupname )){ if( OC_Group::createGroup( $groupname )) {
OC_JSON::success(array("data" => array( "groupname" => $groupname ))); OC_JSON::success(array("data" => array( "groupname" => $groupname )));
} }
else{ else{