From 59bc3b48fdffb76ee65a4b630be3ffa1f6c20c80 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 29 Sep 2014 21:45:27 +0200 Subject: more scrutinizer issue improvements --- lib/plugins/auth.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/plugins/auth.php') diff --git a/lib/plugins/auth.php b/lib/plugins/auth.php index b38b591a3..0d6ea2fa3 100644 --- a/lib/plugins/auth.php +++ b/lib/plugins/auth.php @@ -124,8 +124,11 @@ 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)) { -- cgit v1.2.3 From 253d4b48ec708eb42033862dc15c8576f44a48ed Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 1 Oct 2014 15:32:05 +0200 Subject: more PHPDocs, unused var, small bit code reformatting --- lib/plugins/auth.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/plugins/auth.php') diff --git a/lib/plugins/auth.php b/lib/plugins/auth.php index 0d6ea2fa3..021bc5d4b 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 * @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( @@ -238,7 +238,7 @@ class DokuWiki_Auth_Plugin extends DokuWiki_Plugin { * @author Andreas Gohr * @param string $user the user name * @param bool $requireGroups whether or not the returned data must include groups - * @return array containing user data or false + * @return false|array containing user data or false */ public function getUserData($user, $requireGroups=true) { if(!$this->cando['external']) msg("no valid authorisation system in use", -1); -- cgit v1.2.3 From 9c03f73b0f57a7e1bf6a3108813a4004bf66d307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Koutn=C3=BD?= Date: Mon, 13 Oct 2014 02:12:55 +0200 Subject: AUTH_USER_CHANGE handler can modify passed data Originally AUTH_USER_CHANGE handler could modify the user data, however, auth plugin consequently worked with different copy of the array thus effectively preventing any changes by the AUTH_USER_CHANGE implementer. --- lib/plugins/auth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/plugins/auth.php') diff --git a/lib/plugins/auth.php b/lib/plugins/auth.php index b38b591a3..02e0613dd 100644 --- a/lib/plugins/auth.php +++ b/lib/plugins/auth.php @@ -129,7 +129,7 @@ class DokuWiki_Auth_Plugin extends DokuWiki_Plugin { $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(); -- cgit v1.2.3 From e6c4392f11bb5a668be8e874560af910b71d72f8 Mon Sep 17 00:00:00 2001 From: Patrick Brown Date: Thu, 7 May 2015 01:43:32 -0400 Subject: Fix scrutinizer issues with auth --- lib/plugins/auth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/plugins/auth.php') diff --git a/lib/plugins/auth.php b/lib/plugins/auth.php index 4799b3a38..036cb0d77 100644 --- a/lib/plugins/auth.php +++ b/lib/plugins/auth.php @@ -295,7 +295,7 @@ class DokuWiki_Auth_Plugin extends DokuWiki_Plugin { */ public function deleteUsers($users) { msg("authorisation method does not allow deleting of users", -1); - return false; + return 0; } /** -- cgit v1.2.3