Lines Matching defs:user
35 'logout' => true, // can the user logout again? (eg. not possible with HTTP auth)
159 $this->_log('redirecting user to '.$url);
168 * @param string $user
172 public function trustExternal($user, $pass, $sticky = false) {
189 $data = $this->getUserData($user);
191 $this->_log('authenticated user (state='.$state.')');
197 $this->_log('logged user out (state='.$state.')');
201 // Check user match is SSO and local session
203 if($_SESSION[DOKU_COOKIE]['auth']['user'] !== $this->_getAttributes(false, 'id')) {
204 $this->_log('SSO user doesn\'t match local user, logging out (state='.$state.')');
217 return array_key_exists(DOKU_COOKIE, $_SESSION) && array_key_exists('auth', $_SESSION[DOKU_COOKIE]) && $_SESSION[DOKU_COOKIE]['auth']['user'];
221 * Create user session
223 private function _setSession(string $user, array $grps = null, string $mail = null, string $name = null): void {
227 $USERINFO['name'] = $name ?: $user;
228 $USERINFO['mail'] = $mail ?: (mail_isvalid($user) ? $user : null);
231 $INPUT->server->set('REMOTE_USER', $user);
234 $pass = hash_hmac('sha1', $user, $secret);
235 auth_setCookie($user, auth_encrypt($pass, $secret), false);
270 * @param string $user
273 public function checkPass($user, $pass): bool {
274 if($_SESSION[DOKU_COOKIE]['auth']['user'] !== $user)
278 if($user !== $attrs['id'])
282 if($pass !== hash_hmac('sha1', $user, $secret))
289 * Get user info
291 * @param string $user
294 public function getUserData($user, $requireGroups = true): array {
312 // Any user virtualy exists
313 $data = ['name' => $user, 'mail' => $user, 'grps' => []];
316 if($user === $INPUT->server->str('REMOTE_USER')) {
321 $grps = array_key_exists($user, $this->_users) ? $this->_users[$user]['grps'] : [];