mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
simplify code of remoteuser.php
This commit is contained in:
parent
6e139f16e4
commit
ffc55f3510
1 changed files with 4 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue