mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 04:31:32 +00:00
setting quota and homefolder returns the updated account
This commit is contained in:
parent
4e39c69224
commit
c940162328
|
@ -2264,7 +2264,8 @@ final class SeedDMS_RestapiController { /* {{{ */
|
|||
return $this->renderer->json($response, array('success'=>false, 'message'=>'', 'data'=>'Could not change quota.'))->withStatus(404);
|
||||
}
|
||||
|
||||
return $this->renderer->json($response, array('success'=>true, 'message'=>'', 'data'=>''))->withStatus(200);
|
||||
$data = $this->__getUserData($account);
|
||||
return $this->renderer->json($response, array('success'=>true, 'message'=>'', 'data'=>$data))->withStatus(200);
|
||||
} /* }}} */
|
||||
|
||||
function changeUserHomefolder($request, $response, $args) { /* {{{ */
|
||||
|
@ -2289,23 +2290,28 @@ final class SeedDMS_RestapiController { /* {{{ */
|
|||
return;
|
||||
}
|
||||
|
||||
if(!ctype_digit($args['folderid']) || $args['folderid'] == 0) {
|
||||
if(!ctype_digit($args['folderid'])) {
|
||||
return $this->renderer->json($response, array('success'=>false, 'message'=>'No homefolder given', 'data'=>''))->withStatus(400);
|
||||
return;
|
||||
}
|
||||
$newHomefolder = $dms->getFolder($args['folderid']);
|
||||
if (!$newHomefolder) {
|
||||
return $this->renderer->json($response, array('success'=>false, 'message'=>'', 'data'=>'Folder not found.'))->withStatus(404);
|
||||
return;
|
||||
}
|
||||
if($args['folderid'] == 0) {
|
||||
$operation = $account->setHomeFolder(0);
|
||||
} else {
|
||||
$newHomefolder = $dms->getFolder($args['folderid']);
|
||||
if (!$newHomefolder) {
|
||||
return $this->renderer->json($response, array('success'=>false, 'message'=>'', 'data'=>'Folder not found.'))->withStatus(404);
|
||||
return;
|
||||
}
|
||||
|
||||
$operation = $account->setHomeFolder($newHomefolder->getId());
|
||||
$operation = $account->setHomeFolder($newHomefolder->getId());
|
||||
}
|
||||
|
||||
if (!$operation){
|
||||
return $this->renderer->json($response, array('success'=>false, 'message'=>'', 'data'=>'Could not change homefolder.'))->withStatus(404);
|
||||
}
|
||||
|
||||
return $this->renderer->json($response, array('success'=>true, 'message'=>'', 'data'=>''))->withStatus(200);
|
||||
$data = $this->__getUserData($account);
|
||||
return $this->renderer->json($response, array('success'=>true, 'message'=>'', 'data'=>$data))->withStatus(200);
|
||||
} /* }}} */
|
||||
|
||||
function getUserById($request, $response, $args) { /* {{{ */
|
||||
|
|
Loading…
Reference in New Issue
Block a user