Skip to content

Commit bfebac1

Browse files
committed
fix user comparison and skip update on protected users
The farmer lets us know when a user is protected and can't be written, so we can actually skip the update completely. fixes #132 for good
1 parent d209a58 commit bfebac1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

OAuthManager.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace dokuwiki\plugin\oauth;
44

5+
use dokuwiki\Logger;
6+
57
/**
68
* Implements the flow control for oAuth
79
*/
@@ -255,9 +257,9 @@ protected function processUserData($userdata, $servicename)
255257
);
256258

257259
// update user if changed
258-
array_multisort($localUserInfo);
259-
array_multisort($userdata);
260-
if($localUserInfo != $userdata) {
260+
sort($localUserInfo['grps']);
261+
sort($userdata['grps']);
262+
if ($localUserInfo != $userdata && !isset($localUserInfo['protected'])) {
261263
$auth->modifyUser($localUser, $userdata);
262264
}
263265
} elseif (actionOK('register') || $auth->getConf('register-on-auth')) {

0 commit comments

Comments
 (0)