summaryrefslogtreecommitdiffstats
path: root/settings/ajax/createuser.php
diff options
context:
space:
mode:
Diffstat (limited to 'settings/ajax/createuser.php')
-rw-r--r--settings/ajax/createuser.php8
1 files changed, 1 insertions, 7 deletions
diff --git a/settings/ajax/createuser.php b/settings/ajax/createuser.php
index bdf7e4983ac..b3e5c23de54 100644
--- a/settings/ajax/createuser.php
+++ b/settings/ajax/createuser.php
@@ -3,13 +3,7 @@
// Init owncloud
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' ) && !OC_SubAdmin::isSubAdmin(OC_User::getUser()))) {
- OC_JSON::error(array("data" => array( "message" => "Authentication error" )));
- exit();
-}
-OCP\JSON::callCheck();
+OC_JSON::checkSubAdminUser();
$isadmin = OC_Group::inGroup(OC_User::getUser(), 'admin')?true:false;