From 96d46bf41a428b555c02f30f1bb496535d41bc5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Thu, 24 May 2018 09:04:43 +0200 Subject: [PATCH] =?UTF-8?q?feat(RemoteAPI):=20Add=20call=20to=20delete=20U?= =?UTF-8?q?sers=20to=20the=20remote=20API=20=E2=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/RemoteAPICore.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/inc/RemoteAPICore.php b/inc/RemoteAPICore.php index 0ff358cf95..2f26dc54fb 100644 --- a/inc/RemoteAPICore.php +++ b/inc/RemoteAPICore.php @@ -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', @@ -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. *