Skip to content
Snippets Groups Projects
Commit ffc55f35 authored by Georg Ehrke's avatar Georg Ehrke
Browse files

simplify code of remoteuser.php

parent 6e139f16
Branches
No related tags found
No related merge requests found
......@@ -8,20 +8,10 @@ OCP\JSON::callCheck();
$username = $_POST["username"];
if(!OC_Group::inGroup(OC_User::getUser(), 'admin') && OC_SubAdmin::isSubAdmin(OC_User::getUser())){
$accessiblegroups = OC_SubAdmin::getSubAdminsGroups(OC_User::getUser());
$isuseraccessible = false;
foreach($accessiblegroups as $accessiblegroup){
if(OC_Group::inGroup($username, $accessiblegroup)){
$isuseraccessible = true;
break;
}
}
if(!$isuseraccessible){
$l = OC_L10N::get('core');
self::error(array( 'data' => array( 'message' => $l->t('Authentication error') )));
exit();
}
if(!OC_Group::inGroup(OC_User::getUser(), 'admin') && !OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username)){
$l = OC_L10N::get('core');
self::error(array( 'data' => array( 'message' => $l->t('Authentication error') )));
exit();
}
// Return Success story
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment