summaryrefslogtreecommitdiff
path: root/lib/plugins/auth.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/plugins/auth.php')
-rw-r--r--lib/plugins/auth.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/plugins/auth.php b/lib/plugins/auth.php
index b04735639..4799b3a38 100644
--- a/lib/plugins/auth.php
+++ b/lib/plugins/auth.php
@@ -116,7 +116,7 @@ class DokuWiki_Auth_Plugin extends DokuWiki_Plugin {
* @author Gabriel Birke <birke@d-scribe.de>
* @param string $type Modification type ('create', 'modify', 'delete')
* @param array $params Parameters for the createUser, modifyUser or deleteUsers method. The content of this array depends on the modification type
- * @return mixed Result from the modification function or false if an event handler has canceled the action
+ * @return bool|null|int Result from the modification function or false if an event handler has canceled the action
*/
public function triggerUserMod($type, $params) {
$validTypes = array(
@@ -124,12 +124,15 @@ class DokuWiki_Auth_Plugin extends DokuWiki_Plugin {
'modify' => 'modifyUser',
'delete' => 'deleteUsers'
);
- if(empty($validTypes[$type]))
+ if(empty($validTypes[$type])) {
return false;
+ }
+
+ $result = false;
$eventdata = array('type' => $type, 'params' => $params, 'modification_result' => null);
$evt = new Doku_Event('AUTH_USER_CHANGE', $eventdata);
if($evt->advise_before(true)) {
- $result = call_user_func_array(array($this, $validTypes[$type]), $params);
+ $result = call_user_func_array(array($this, $validTypes[$type]), $evt->data['params']);
$evt->data['modification_result'] = $result;
}
$evt->advise_after();
@@ -229,14 +232,15 @@ class DokuWiki_Auth_Plugin extends DokuWiki_Plugin {
* at least these fields:
*
* name string full name of the user
- * mail string email addres of the user
+ * mail string email address of the user
* grps array list of groups the user is in
*
* @author Andreas Gohr <andi@splitbrain.org>
* @param string $user the user name
- * @return array containing user data or false
+ * @param bool $requireGroups whether or not the returned data must include groups
+ * @return false|array containing user data or false
*/
- public function getUserData($user) {
+ public function getUserData($user, $requireGroups=true) {
if(!$this->cando['external']) msg("no valid authorisation system in use", -1);
return false;
}