Skip to content
Snippets Groups Projects
Unverified Commit 2cceef48 authored by Michael Große's avatar Michael Große Committed by GitHub
Browse files

Merge pull request #2402 from splitbrain/remoteDeleteUsers

Add call to delete Users to the remote API
parents 7739b12f d7ab5a00
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,10 @@ class RemoteAPICore {
'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',
......@@ -549,6 +553,25 @@ class RemoteAPICore {
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
*
* @throws RemoteAccessDeniedException
*/
public function deleteUsers($usernames)
{
if (!auth_isadmin()) {
throw new RemoteAccessDeniedException('Only admins are allowed to delete users', 114);
}
/** @var DokuWiki_Auth_Plugin $auth */
global $auth;
return (bool)$auth->triggerUserMod('deleteUsers', $usernames);
}
/**
* Uploads a file to the wiki.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment