enhance phpdoc and add @access to specify which usergroup can use the ApiCommands; add --import-settings parameter to config-services.php CLI script to gain even more automatism when setting up

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-02-24 10:57:52 +01:00
parent 81d6a856d9
commit 9a61a56732
9 changed files with 217 additions and 62 deletions

View File

@@ -21,6 +21,8 @@ class Admins extends ApiCommand implements ResourceEntity
/**
* lists all admin entries
*
* @access admin
* @throws Exception
* @return array count|list
*/
public function list()
@@ -52,7 +54,8 @@ class Admins extends ApiCommand implements ResourceEntity
* optional, the admin-id
* @param string $loginname
* optional, the loginname
*
*
* @access admin
* @throws Exception
* @return array
*/
@@ -84,6 +87,13 @@ class Admins extends ApiCommand implements ResourceEntity
throw new Exception("Not allowed to execute given command.", 403);
}
/**
* create a new admin user
*
* @access admin
* @throws Exception
* @return array
*/
public function add()
{
if ($this->isAdmin() && $this->getUserDetail('change_serversettings') == 1) {
@@ -290,6 +300,18 @@ class Admins extends ApiCommand implements ResourceEntity
throw new Exception("Not allowed to execute given command.", 403);
}
/**
* update an admin user by given id or loginname
*
* @param int $id
* optional, the admin-id
* @param string $loginname
* optional, the loginname
*
* @access admin
* @throws Exception
* @return array
*/
public function update()
{
if ($this->isAdmin() && $this->getUserDetail('change_serversettings') == 1) {
@@ -551,7 +573,8 @@ class Admins extends ApiCommand implements ResourceEntity
* optional, the admin-id
* @param string $loginname
* optional, the loginname
*
*
* @access admin
* @throws Exception
* @return array
*/
@@ -619,7 +642,8 @@ class Admins extends ApiCommand implements ResourceEntity
* optional, the admin-id
* @param string $loginname
* optional, the loginname
*
*
* @access admin
* @throws Exception
* @return array
*/