42b0b1d7c7a264a54bde0d3880610a1a00c29fd7
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Classes / Authentication / FrontendUserAuthentication.php
1 <?php
2 namespace TYPO3\CMS\Frontend\Authentication;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Core\Authentication\AbstractUserAuthentication;
18 use TYPO3\CMS\Core\Database\ConnectionPool;
19 use TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser;
20 use TYPO3\CMS\Core\Utility\GeneralUtility;
21
22 /**
23 * Extension class for Front End User Authentication.
24 */
25 class FrontendUserAuthentication extends AbstractUserAuthentication
26 {
27 /**
28 * form field with 0 or 1
29 * 1 = permanent login enabled
30 * 0 = session is valid for a browser session only
31 * @var string
32 */
33 public $formfield_permanent = 'permalogin';
34
35 /**
36 * Lifetime of session data in seconds.
37 * @var int
38 */
39 protected $sessionDataLifetime = 86400;
40
41 /**
42 * Session timeout (on the server)
43 *
44 * If >0: session-timeout in seconds.
45 * If 0: no timeout.
46 *
47 * @var int
48 */
49 public $sessionTimeout = 6000;
50
51 /**
52 * @var string
53 */
54 public $usergroup_column = 'usergroup';
55
56 /**
57 * @var string
58 */
59 public $usergroup_table = 'fe_groups';
60
61 /**
62 * @var array
63 */
64 public $groupData = [
65 'title' => [],
66 'uid' => [],
67 'pid' => []
68 ];
69
70 /**
71 * Used to accumulate the TSconfig data of the user
72 * @var array
73 */
74 public $TSdataArray = [];
75
76 /**
77 * @var array
78 */
79 public $userTS = [];
80
81 /**
82 * @var bool
83 */
84 public $userTSUpdated = false;
85
86 /**
87 * Session and user data:
88 * There are two types of data that can be stored: UserData and Session-Data.
89 * Userdata is for the login-user, and session-data for anyone viewing the pages.
90 * 'Keys' are keys in the internal data array of the data.
91 * When you get or set a key in one of the data-spaces (user or session) you decide the type of the variable (not object though)
92 * 'Reserved' keys are:
93 * - 'recs': Array: Used to 'register' records, eg in a shopping basket. Structure: [recs][tablename][record_uid]=number
94 * - sys: Reserved for TypoScript standard code.
95 *
96 * @var array
97 */
98 public $sesData = [];
99
100 /**
101 * @var bool
102 */
103 public $sesData_change = false;
104
105 /**
106 * @var bool
107 */
108 public $userData_change = false;
109
110 /**
111 * @var bool
112 */
113 public $is_permanent = false;
114
115 /**
116 * @var int|NULL
117 */
118 protected $sessionDataTimestamp = null;
119
120 /**
121 * @var bool
122 */
123 protected $loginHidden = false;
124
125 /**
126 * Default constructor.
127 */
128 public function __construct()
129 {
130 parent::__construct();
131
132 // Disable cookie by default, will be activated if saveSessionData() is called,
133 // a user is logging-in or an existing session is found
134 $this->dontSetCookie = true;
135
136 $this->session_table = 'fe_sessions';
137 $this->name = self::getCookieName();
138 $this->get_name = 'ftu';
139 $this->loginType = 'FE';
140 $this->user_table = 'fe_users';
141 $this->username_column = 'username';
142 $this->userident_column = 'password';
143 $this->userid_column = 'uid';
144 $this->lastLogin_column = 'lastlogin';
145 $this->enablecolumns = [
146 'deleted' => 'deleted',
147 'disabled' => 'disable',
148 'starttime' => 'starttime',
149 'endtime' => 'endtime'
150 ];
151 $this->formfield_uname = 'user';
152 $this->formfield_uident = 'pass';
153 $this->formfield_status = 'logintype';
154 $this->sendNoCacheHeaders = false;
155 $this->getFallBack = true;
156 $this->getMethodEnabled = true;
157 }
158
159 /**
160 * Returns the configured cookie name
161 *
162 * @return string
163 */
164 public static function getCookieName()
165 {
166 $configuredCookieName = trim($GLOBALS['TYPO3_CONF_VARS']['FE']['cookieName']);
167 if (empty($configuredCookieName)) {
168 $configuredCookieName = 'fe_typo_user';
169 }
170 return $configuredCookieName;
171 }
172
173 /**
174 * Starts a user session
175 *
176 * @return void
177 * @see AbstractUserAuthentication::start()
178 */
179 public function start()
180 {
181 if ((int)$this->sessionTimeout > 0 && $this->sessionTimeout < $this->lifetime) {
182 // If server session timeout is non-zero but less than client session timeout: Copy this value instead.
183 $this->sessionTimeout = $this->lifetime;
184 }
185 $this->sessionDataLifetime = (int)$GLOBALS['TYPO3_CONF_VARS']['FE']['sessionDataLifetime'];
186 if ($this->sessionDataLifetime <= 0) {
187 $this->sessionDataLifetime = 86400;
188 }
189 parent::start();
190 }
191
192 /**
193 * Returns a new session record for the current user for insertion into the DB.
194 *
195 * @param array $tempuser
196 * @return array User session record
197 */
198 public function getNewSessionRecord($tempuser)
199 {
200 $insertFields = parent::getNewSessionRecord($tempuser);
201 $insertFields['ses_permanent'] = $this->is_permanent ? 1 : 0;
202 return $insertFields;
203 }
204
205 /**
206 * Determine whether a session cookie needs to be set (lifetime=0)
207 *
208 * @return bool
209 * @internal
210 */
211 public function isSetSessionCookie()
212 {
213 return ($this->newSessionID || $this->forceSetCookie)
214 && ($this->lifetime == 0 || !isset($this->user['ses_permanent']) || !$this->user['ses_permanent']);
215 }
216
217 /**
218 * Determine whether a non-session cookie needs to be set (lifetime>0)
219 *
220 * @return bool
221 * @internal
222 */
223 public function isRefreshTimeBasedCookie()
224 {
225 return $this->lifetime > 0 && isset($this->user['ses_permanent']) && $this->user['ses_permanent'];
226 }
227
228 /**
229 * Returns an info array with Login/Logout data submitted by a form or params
230 *
231 * @return array
232 * @see AbstractUserAuthentication::getLoginFormData()
233 */
234 public function getLoginFormData()
235 {
236 $loginData = parent::getLoginFormData();
237 if ($GLOBALS['TYPO3_CONF_VARS']['FE']['permalogin'] == 0 || $GLOBALS['TYPO3_CONF_VARS']['FE']['permalogin'] == 1) {
238 if ($this->getMethodEnabled) {
239 $isPermanent = GeneralUtility::_GP($this->formfield_permanent);
240 } else {
241 $isPermanent = GeneralUtility::_POST($this->formfield_permanent);
242 }
243 if (strlen($isPermanent) != 1) {
244 $isPermanent = $GLOBALS['TYPO3_CONF_VARS']['FE']['permalogin'];
245 } elseif (!$isPermanent) {
246 // To make sure the user gets a session cookie and doesn't keep a possibly existing time based cookie,
247 // we need to force setting the session cookie here
248 $this->forceSetCookie = true;
249 }
250 $isPermanent = (bool)$isPermanent;
251 } elseif ($GLOBALS['TYPO3_CONF_VARS']['FE']['permalogin'] == 2) {
252 $isPermanent = true;
253 } else {
254 $isPermanent = false;
255 }
256 $loginData['permanent'] = $isPermanent;
257 $this->is_permanent = $isPermanent;
258 return $loginData;
259 }
260
261 /**
262 * Creates a user session record and returns its values.
263 * However, as the FE user cookie is normally not set, this has to be done
264 * before the parent class is doing the rest.
265 *
266 * @param array $tempuser User data array
267 * @return array The session data for the newly created session.
268 */
269 public function createUserSession($tempuser)
270 {
271 // At this point we do not know if we need to set a session or a "permanant" cookie
272 // So we force the cookie to be set after authentication took place, which will
273 // then call setSessionCookie(), which will set a cookie with correct settings.
274 $this->dontSetCookie = false;
275 return parent::createUserSession($tempuser);
276 }
277
278 /**
279 * Will select all fe_groups records that the current fe_user is member of
280 * and which groups are also allowed in the current domain.
281 * It also accumulates the TSconfig for the fe_user/fe_groups in ->TSdataArray
282 *
283 * @return int Returns the number of usergroups for the frontend users (if the internal user record exists and the usergroup field contains a value)
284 */
285 public function fetchGroupData()
286 {
287 $this->TSdataArray = [];
288 $this->userTS = [];
289 $this->userTSUpdated = false;
290 $this->groupData = [
291 'title' => [],
292 'uid' => [],
293 'pid' => []
294 ];
295 // Setting default configuration:
296 $this->TSdataArray[] = $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultUserTSconfig'];
297 // Get the info data for auth services
298 $authInfo = $this->getAuthInfoArray();
299 if ($this->writeDevLog) {
300 if (is_array($this->user)) {
301 GeneralUtility::devLog('Get usergroups for user: ' . GeneralUtility::arrayToLogString($this->user, [$this->userid_column, $this->username_column]), __CLASS__);
302 } else {
303 GeneralUtility::devLog('Get usergroups for "anonymous" user', __CLASS__);
304 }
305 }
306 $groupDataArr = [];
307 // Use 'auth' service to find the groups for the user
308 $serviceChain = '';
309 $subType = 'getGroups' . $this->loginType;
310 while (is_object($serviceObj = GeneralUtility::makeInstanceService('auth', $subType, $serviceChain))) {
311 $serviceChain .= ',' . $serviceObj->getServiceKey();
312 $serviceObj->initAuth($subType, [], $authInfo, $this);
313 $groupData = $serviceObj->getGroups($this->user, $groupDataArr);
314 if (is_array($groupData) && !empty($groupData)) {
315 // Keys in $groupData should be unique ids of the groups (like "uid") so this function will override groups.
316 $groupDataArr = $groupData + $groupDataArr;
317 }
318 unset($serviceObj);
319 }
320 if ($this->writeDevLog && $serviceChain) {
321 GeneralUtility::devLog($subType . ' auth services called: ' . $serviceChain, __CLASS__);
322 }
323 if ($this->writeDevLog && empty($groupDataArr)) {
324 GeneralUtility::devLog('No usergroups found by services', __CLASS__);
325 }
326 if ($this->writeDevLog && !empty($groupDataArr)) {
327 GeneralUtility::devLog(count($groupDataArr) . ' usergroup records found by services', __CLASS__);
328 }
329 // Use 'auth' service to check the usergroups if they are really valid
330 foreach ($groupDataArr as $groupData) {
331 // By default a group is valid
332 $validGroup = true;
333 $serviceChain = '';
334 $subType = 'authGroups' . $this->loginType;
335 while (is_object($serviceObj = GeneralUtility::makeInstanceService('auth', $subType, $serviceChain))) {
336 $serviceChain .= ',' . $serviceObj->getServiceKey();
337 $serviceObj->initAuth($subType, [], $authInfo, $this);
338 if (!$serviceObj->authGroup($this->user, $groupData)) {
339 $validGroup = false;
340 if ($this->writeDevLog) {
341 GeneralUtility::devLog($subType . ' auth service did not auth group: ' . GeneralUtility::arrayToLogString($groupData, 'uid,title'), __CLASS__, 2);
342 }
343 break;
344 }
345 unset($serviceObj);
346 }
347 unset($serviceObj);
348 if ($validGroup && (string)$groupData['uid'] !== '') {
349 $this->groupData['title'][$groupData['uid']] = $groupData['title'];
350 $this->groupData['uid'][$groupData['uid']] = $groupData['uid'];
351 $this->groupData['pid'][$groupData['uid']] = $groupData['pid'];
352 $this->groupData['TSconfig'][$groupData['uid']] = $groupData['TSconfig'];
353 }
354 }
355 if (!empty($this->groupData) && !empty($this->groupData['TSconfig'])) {
356 // TSconfig: collect it in the order it was collected
357 foreach ($this->groupData['TSconfig'] as $TSdata) {
358 $this->TSdataArray[] = $TSdata;
359 }
360 $this->TSdataArray[] = $this->user['TSconfig'];
361 // Sort information
362 ksort($this->groupData['title']);
363 ksort($this->groupData['uid']);
364 ksort($this->groupData['pid']);
365 }
366 return !empty($this->groupData['uid']) ? count($this->groupData['uid']) : 0;
367 }
368
369 /**
370 * Returns the parsed TSconfig for the fe_user
371 * The TSconfig will be cached in $this->userTS.
372 *
373 * @return array TSconfig array for the fe_user
374 */
375 public function getUserTSconf()
376 {
377 if (!$this->userTSUpdated) {
378 // Parsing the user TS (or getting from cache)
379 $this->TSdataArray = TypoScriptParser::checkIncludeLines_array($this->TSdataArray);
380 $userTS = implode(LF . '[GLOBAL]' . LF, $this->TSdataArray);
381 $parseObj = GeneralUtility::makeInstance(TypoScriptParser::class);
382 $parseObj->parse($userTS);
383 $this->userTS = $parseObj->setup;
384 $this->userTSUpdated = true;
385 }
386 return $this->userTS;
387 }
388
389 /*****************************************
390 *
391 * Session data management functions
392 *
393 ****************************************/
394 /**
395 * Fetches the session data for the user (from the fe_session_data table) based on the ->id of the current user-session.
396 * The session data is restored to $this->sesData
397 * 1/100 calls will also do a garbage collection.
398 *
399 * @return void
400 * @access private
401 * @see storeSessionData()
402 */
403 public function fetchSessionData()
404 {
405 // Gets SesData if any AND if not already selected by session fixation check in ->isExistingSessionRecord()
406 if ($this->id && empty($this->sesData)) {
407 $sesDataRow = GeneralUtility::makeInstance(ConnectionPool::class)
408 ->getConnectionForTable('fe_session_data')->select(
409 ['*'],
410 'fe_session_data',
411 ['hash' => $this->id]
412 )->fetch();
413 if ($sesDataRow !== null) {
414 $this->sesData = unserialize($sesDataRow['content']);
415 $this->sessionDataTimestamp = $sesDataRow['tstamp'];
416 }
417 }
418 }
419
420 /**
421 * Will write UC and session data.
422 * If the flag $this->userData_change has been set, the function ->writeUC is called (which will save persistent user session data)
423 * If the flag $this->sesData_change has been set, the fe_session_data table is updated with the content of $this->sesData
424 * If the $this->sessionDataTimestamp is NULL there was no session record yet, so we need to insert it into the database
425 *
426 * @return void
427 * @see fetchSessionData(), getKey(), setKey()
428 */
429 public function storeSessionData()
430 {
431 // Saves UC and SesData if changed.
432 if ($this->userData_change) {
433 $this->writeUC('');
434 }
435 $databaseConnection = GeneralUtility::makeInstance(ConnectionPool::class)
436 ->getConnectionForTable('fe_session_data');
437 if ($this->sesData_change && $this->id) {
438 if (empty($this->sesData)) {
439 // Remove session-data
440 $this->removeSessionData();
441 // Remove cookie if not logged in as the session data is removed as well
442 if (empty($this->user['uid']) && !$this->loginHidden && $this->isCookieSet()) {
443 $this->removeCookie($this->name);
444 }
445 } elseif ($this->sessionDataTimestamp === null) {
446 // Write new session-data
447 $insertFields = [
448 'hash' => $this->id,
449 'content' => serialize($this->sesData),
450 'tstamp' => $GLOBALS['EXEC_TIME']
451 ];
452 $this->sessionDataTimestamp = $GLOBALS['EXEC_TIME'];
453 $databaseConnection->insert('fe_session_data', $insertFields);
454 // Now set the cookie (= fix the session)
455 $this->setSessionCookie();
456 } else {
457 // Update session data
458 $updateFields = [
459 'content' => serialize($this->sesData),
460 'tstamp' => $GLOBALS['EXEC_TIME']
461 ];
462 $this->sessionDataTimestamp = $GLOBALS['EXEC_TIME'];
463 $databaseConnection->update('fe_session_data', $updateFields, ['hash' => $this->id]);
464 }
465 }
466 }
467
468 /**
469 * Removes data of the current session.
470 *
471 * @return void
472 */
473 public function removeSessionData()
474 {
475 $this->sessionDataTimestamp = null;
476 GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('fe_session_data')->delete(
477 'fe_session_data',
478 ['hash' => $this->id]
479 );
480 }
481
482 /**
483 * Log out current user!
484 * Removes the current session record, sets the internal ->user array to a blank string
485 * Thereby the current user (if any) is effectively logged out!
486 * Additionally the cookie is removed
487 *
488 * @return void
489 */
490 public function logoff()
491 {
492 parent::logoff();
493 // Remove the cookie on log-off, but only if we do not have an anonymous session
494 if (!$this->isExistingSessionRecord($this->id) && $this->isCookieSet()) {
495 $this->removeCookie($this->name);
496 }
497 }
498
499 /**
500 * Regenerate the id, take separate session data table into account
501 * and set cookie again
502 */
503 protected function regenerateSessionId()
504 {
505 $oldSessionId = $this->id;
506 parent::regenerateSessionId();
507 // Update session data with new ID
508 GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('fe_session_data')
509 ->update(
510 'fe_session_data',
511 ['hash' => $this->id],
512 ['hash' => $oldSessionId]
513 );
514
515 // We force the cookie to be set later in the authentication process
516 $this->dontSetCookie = false;
517 }
518
519 /**
520 * Executes the garbage collection of session data and session.
521 * The lifetime of session data is defined by $TYPO3_CONF_VARS['FE']['sessionDataLifetime'].
522 *
523 * @return void
524 */
525 public function gc()
526 {
527 $timeoutTimeStamp = (int)($GLOBALS['EXEC_TIME'] - $this->sessionDataLifetime);
528 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('fe_session_data');
529 $queryBuilder->delete('fe_session_data')
530 ->where(
531 $queryBuilder->expr()->lt(
532 'tstamp',
533 $queryBuilder->createNamedParameter($timeoutTimeStamp, \PDO::PARAM_INT)
534 )
535 )
536 ->execute();
537 parent::gc();
538 }
539
540 /**
541 * Returns session data for the fe_user; Either persistent data following the fe_users uid/profile (requires login)
542 * or current-session based (not available when browse is closed, but does not require login)
543 *
544 * @param string $type Session data type; Either "user" (persistent, bound to fe_users profile) or "ses" (temporary, bound to current session cookie)
545 * @param string $key Key from the data array to return; The session data (in either case) is an array ($this->uc / $this->sesData) and this value determines which key to return the value for.
546 * @return mixed Returns whatever value there was in the array for the key, $key
547 * @see setKey()
548 */
549 public function getKey($type, $key)
550 {
551 if (!$key) {
552 return null;
553 }
554 $value = null;
555 switch ($type) {
556 case 'user':
557 $value = $this->uc[$key];
558 break;
559 case 'ses':
560 $value = $this->sesData[$key];
561 break;
562 }
563 return $value;
564 }
565
566 /**
567 * Saves session data, either persistent or bound to current session cookie. Please see getKey() for more details.
568 * When a value is set the flags $this->userData_change or $this->sesData_change will be set so that the final call to ->storeSessionData() will know if a change has occurred and needs to be saved to the database.
569 * Notice: The key "recs" is already used by the function record_registration() which stores table/uid=value pairs in that key. This is used for the shopping basket among other things.
570 * Notice: Simply calling this function will not save the data to the database! The actual saving is done in storeSessionData() which is called as some of the last things in \TYPO3\CMS\Frontend\Http\RequestHandler. So if you exit before this point, nothing gets saved of course! And the solution is to call $GLOBALS['TSFE']->storeSessionData(); before you exit.
571 *
572 * @param string $type Session data type; Either "user" (persistent, bound to fe_users profile) or "ses" (temporary, bound to current session cookie)
573 * @param string $key Key from the data array to store incoming data in; The session data (in either case) is an array ($this->uc / $this->sesData) and this value determines in which key the $data value will be stored.
574 * @param mixed $data The data value to store in $key
575 * @return void
576 * @see setKey(), storeSessionData(), record_registration()
577 */
578 public function setKey($type, $key, $data)
579 {
580 if (!$key) {
581 return;
582 }
583 switch ($type) {
584 case 'user':
585 if ($this->user['uid']) {
586 if ($data === null) {
587 unset($this->uc[$key]);
588 } else {
589 $this->uc[$key] = $data;
590 }
591 $this->userData_change = true;
592 }
593 break;
594 case 'ses':
595 if ($data === null) {
596 unset($this->sesData[$key]);
597 } else {
598 $this->sesData[$key] = $data;
599 }
600 $this->sesData_change = true;
601 break;
602 }
603 }
604
605 /**
606 * Returns the session data stored for $key.
607 * The data will last only for this login session since it is stored in the session table.
608 *
609 * @param string $key
610 * @return mixed
611 */
612 public function getSessionData($key)
613 {
614 return $this->getKey('ses', $key);
615 }
616
617 /**
618 * Saves the tokens so that they can be used by a later incarnation of this class.
619 *
620 * @param string $key
621 * @param mixed $data
622 * @return void
623 */
624 public function setAndSaveSessionData($key, $data)
625 {
626 $this->setKey('ses', $key, $data);
627 $this->storeSessionData();
628 }
629
630 /**
631 * Registration of records/"shopping basket" in session data
632 * This will take the input array, $recs, and merge into the current "recs" array found in the session data.
633 * If a change in the recs storage happens (which it probably does) the function setKey() is called in order to store the array again.
634 *
635 * @param array $recs The data array to merge into/override the current recs values. The $recs array is constructed as [table]][uid] = scalar-value (eg. string/integer).
636 * @param int $maxSizeOfSessionData The maximum size of stored session data. If zero, no limit is applied and even confirmation of cookie session is discarded.
637 * @return void
638 */
639 public function record_registration($recs, $maxSizeOfSessionData = 0)
640 {
641 // Storing value ONLY if there is a confirmed cookie set,
642 // otherwise a shellscript could easily be spamming the fe_sessions table
643 // with bogus content and thus bloat the database
644 if (!$maxSizeOfSessionData || $this->isCookieSet()) {
645 if ($recs['clear_all']) {
646 $this->setKey('ses', 'recs', []);
647 }
648 $change = 0;
649 $recs_array = $this->getKey('ses', 'recs');
650 foreach ($recs as $table => $data) {
651 if (is_array($data)) {
652 foreach ($data as $rec_id => $value) {
653 if ($value != $recs_array[$table][$rec_id]) {
654 $recs_array[$table][$rec_id] = $value;
655 $change = 1;
656 }
657 }
658 }
659 }
660 if ($change && (!$maxSizeOfSessionData || strlen(serialize($recs_array)) < $maxSizeOfSessionData)) {
661 $this->setKey('ses', 'recs', $recs_array);
662 }
663 }
664 }
665
666 /**
667 * Determine whether there's an according session record to a given session_id
668 * in the database. Don't care if session record is still valid or not.
669 *
670 * This calls the parent function but additionally tries to look up the session ID in the "fe_session_data" table.
671 *
672 * @param int $id Claimed Session ID
673 * @return bool Returns TRUE if a corresponding session was found in the database
674 */
675 public function isExistingSessionRecord($id)
676 {
677 // Perform check in parent function
678 $count = parent::isExistingSessionRecord($id);
679 // Check if there are any fe_session_data records for the session ID the client claims to have
680 if ($count == false) {
681 $sesDataRow = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('fe_session_data')
682 ->select(['content', 'tstamp'], 'fe_session_data', ['hash' => $id])->fetch();
683
684 if ($sesDataRow !== null) {
685 $count = true;
686 $this->sesData = unserialize($sesDataRow['content']);
687 $this->sessionDataTimestamp = $sesDataRow['tstamp'];
688 }
689 }
690 return $count;
691 }
692
693 /**
694 * Hide the current login
695 *
696 * This is used by the fe_login_mode feature for pages.
697 * A current login is unset, but we remember that there has been one.
698 *
699 * @return void
700 */
701 public function hideActiveLogin()
702 {
703 $this->user = null;
704 $this->loginHidden = true;
705 }
706 }