Skip to content

Commit

Permalink
feat(RemoteAPI): Add call to delete Users to the remote API
Browse files Browse the repository at this point in the history
  • Loading branch information
micgro42 committed May 24, 2018
1 parent 7739b12 commit 4bc8c5f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions inc/RemoteAPICore.php
Expand Up @@ -66,6 +66,10 @@ public function __getRemoteInfo() {
'args' => array('string', 'string', 'array'),
'return' => 'bool',
'doc' => 'Append text to a wiki page.'
), 'dokuwiki.deleteUsers' => array(
'args' => array('array'),
'return' => 'bool',
'doc' => 'Remove one or more users from the list of registered users.'
), 'wiki.getPage' => array(
'args' => array('string'),
'return' => 'string',
Expand Down Expand Up @@ -549,6 +553,23 @@ public function appendPage($id, $text, $params) {
return $this->putPage($id, $currentpage.$text, $params);
}

/**
* Remove one or more users from the list of registered users
*
* @param string[] $usernames List of usernames to remove
*
* @return bool
*/
public function deleteUsers($usernames)
{
if (!auth_isadmin()) {
return false;
}
/** @var DokuWiki_Auth_Plugin $auth */
global $auth;
return (bool)$auth->triggerUserMod('deleteUsers', $usernames);
}

/**
* Uploads a file to the wiki.
*
Expand Down

0 comments on commit 4bc8c5f

Please sign in to comment.