Skip to content
Snippets Groups Projects
Commit caaaf7a7 authored by Thomas Müller's avatar Thomas Müller
Browse files

Update settings/ajax/creategroup.php

respect coding style
parent a570cc7b
No related branches found
No related tags found
No related merge requests found
<?php
// Init owncloud
require_once('../../lib/base.php');
require_once '../../lib/base.php';
OCP\JSON::callCheck();
// 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" )));
exit();
}
......@@ -15,13 +15,13 @@ OCP\JSON::callCheck();
$groupname = $_POST["groupname"];
// 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" )));
exit();
}
// Return Success story
if( OC_Group::createGroup( $groupname )){
if( OC_Group::createGroup( $groupname )) {
OC_JSON::success(array("data" => array( "groupname" => $groupname )));
}
else{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment