Rev 1265 | Rev 1282 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1265 | Rev 1267 | ||
---|---|---|---|
Line 177... | Line 177... | ||
177 | return $acs->loggedInRaList(); |
177 | return $acs->loggedInRaList(); |
178 | } |
178 | } |
179 | } |
179 | } |
180 | 180 | ||
181 | /** |
181 | /** |
182 | * @param string $email |
182 | * @param string|OIDplusRA $ra |
183 | * @return bool |
183 | * @return bool |
184 | * @throws OIDplusException |
184 | * @throws OIDplusException |
185 | */ |
185 | */ |
186 | public function isRaLoggedIn(string $email): bool { |
186 | public function isRaLoggedIn($ra): bool { |
- | 187 | $email = $ra instanceof OIDplusRA ? $ra->raEmail() : $ra; |
|
187 | $acs = $this->getAuthContentStore(); |
188 | $acs = $this->getAuthContentStore(); |
188 | if (is_null($acs)) return false; |
189 | if (is_null($acs)) return false; |
189 | return $acs->isRaLoggedIn($email); |
190 | return $acs->isRaLoggedIn($email); |
190 | } |
191 | } |
191 | 192 | ||
Line 222... | Line 223... | ||
222 | } |
223 | } |
223 | } |
224 | } |
224 | $logmsg = "RA '$email' logged in"; |
225 | $logmsg = "RA '$email' logged in"; |
225 | if ($origin != '') $logmsg .= " via $origin"; |
226 | if ($origin != '') $logmsg .= " via $origin"; |
226 | if ($loginfo != '') $logmsg .= " ($loginfo)"; |
227 | if ($loginfo != '') $logmsg .= " ($loginfo)"; |
227 | OIDplus::logger()->log("[OK]RA(%1)!", "%2", $email, $logmsg); |
228 | OIDplus::logger()->log("V2:[OK]RA(%1)", "%2", $email, $logmsg); |
228 | } |
229 | } |
229 | 230 | ||
230 | /** |
231 | /** |
231 | * @param string $email |
232 | * @param string $email |
232 | * @return void |
233 | * @return void |
Line 237... | Line 238... | ||
237 | 238 | ||
238 | $acs = $this->getAuthContentStore(); |
239 | $acs = $this->getAuthContentStore(); |
239 | if (is_null($acs)) return; |
240 | if (is_null($acs)) return; |
240 | $acs->raLogoutEx($email, $loginfo); |
241 | $acs->raLogoutEx($email, $loginfo); |
241 | 242 | ||
242 | OIDplus::logger()->log("[OK]RA(%1)!", "RA '%1' logged out (%2)", $email, $loginfo); |
243 | OIDplus::logger()->log("V2:[OK]RA(%1)", "RA '%1' logged out (%2)", $email, $loginfo); |
243 | 244 | ||
244 | if (($this->raNumLoggedIn() == 0) && (!$this->isAdminLoggedIn())) { |
245 | if (($this->raNumLoggedIn() == 0) && (!$this->isAdminLoggedIn())) { |
245 | // Nobody logged in anymore. Destroy session cookie to make GDPR people happy |
246 | // Nobody logged in anymore. Destroy session cookie to make GDPR people happy |
246 | $acs->destroySession(); |
247 | $acs->destroySession(); |
247 | } else { |
248 | } else { |
Line 352... | Line 353... | ||
352 | } |
353 | } |
353 | } |
354 | } |
354 | $logmsg = "Admin logged in"; |
355 | $logmsg = "Admin logged in"; |
355 | if ($origin != '') $logmsg .= " via $origin"; |
356 | if ($origin != '') $logmsg .= " via $origin"; |
356 | if ($loginfo != '') $logmsg .= " ($loginfo)"; |
357 | if ($loginfo != '') $logmsg .= " ($loginfo)"; |
357 | OIDplus::logger()->log("[OK]A!", "%1", $logmsg); |
358 | OIDplus::logger()->log("V2:[OK]A", "%1", $logmsg); |
358 | } |
359 | } |
359 | 360 | ||
360 | /** |
361 | /** |
361 | * @return void |
362 | * @return void |
362 | * @throws OIDplusException |
363 | * @throws OIDplusException |
Line 374... | Line 375... | ||
374 | } else { |
375 | } else { |
375 | // Get a new token for the remaining users |
376 | // Get a new token for the remaining users |
376 | $acs->activate(); |
377 | $acs->activate(); |
377 | } |
378 | } |
378 | 379 | ||
379 | OIDplus::logger()->log("[OK]A!", "Admin logged out (%1)", $loginfo); |
380 | OIDplus::logger()->log("V2:[OK]A", "Admin logged out (%1)", $loginfo); |
380 | } |
381 | } |
381 | 382 | ||
382 | // Authentication keys for validating arguments (e.g. sent by mail) |
383 | // Authentication keys for validating arguments (e.g. sent by mail) |
383 | 384 | ||
384 | /** |
385 | /** |