Lines Matching defs:userdata
69 $userdata = $service->getUser();
72 $userdata = $this->validateUserData($userdata, $logindata['servicename']);
73 $userdata = $this->processUserData($userdata, $logindata['servicename']);
76 $storageId = $this->getStorageId($userdata['mail']);
80 $session->setUser($userdata); // log in
106 $userdata = $session->getUser();
107 if (!$userdata) return false;
108 if (!isset($userdata['user'])) return false; // default dokuwiki does not put username here, let DW handle it
109 $session->setUser($userdata, false); // does a login without resetting the time
132 $userdata = $service->getUser();
135 $userdata = $this->validateUserData($userdata, $cookie['servicename']);
136 $userdata = $this->processUserData($userdata, $cookie['servicename']);
138 $session->setUser($userdata); // log in
177 * @param array $userdata
182 protected function validateUserData($userdata, $servicename)
188 if (empty($userdata['mail'])) {
192 $userdata['mail'] = strtolower($userdata['mail']);
198 if (!$hlp->checkMail($userdata['mail'])) {
203 if (!isset($userdata['user'])) $userdata['user'] = '';
204 $userdata['user'] = $auth->cleanUser((string)$userdata['user']);
205 if ($userdata['user'] === '') {
206 [$userdata['user']] = explode('@', $userdata['mail']);
210 if (empty($userdata['name'])) {
211 $userdata['name'] = $userdata['user'];
215 if (!isset($userdata['grps'])) $userdata['grps'] = [];
216 $userdata['grps'] = array_map([$auth, 'cleanGroup'], (array)$userdata['grps']);
218 return $userdata;
222 * Process the userdata, update the user info array and create the user if necessary
226 * @param array $userdata User info received from authentication
231 protected function processUserData($userdata, $servicename)
237 $localUser = $auth->getUserByEmail($userdata['mail']);
250 $userdata['user'] = $localUser;
251 $userdata['name'] = $localUserInfo['name'];
252 $userdata['grps'] = $this->mergeGroups(
254 $userdata['grps'] ?? [],
261 sort($userdata['grps']);
262 if ($localUserInfo != $userdata && !isset($localUserInfo['protected'])) {
263 $auth->modifyUser($localUser, $userdata);
266 if (!$auth->registerOAuthUser($userdata, $servicename)) {
273 return $userdata;