Просмотр исходного кода

Merge branch 'master' of https://github.com/unaio/una

AntonLV 3 лет назад
Родитель
Сommit
17899dc983
2 измененных файлов с 6 добавлено и 1 удалено
  1. 4 1
      inc/classes/BxDolSession.php
  2. 2 0
      inc/profiles.inc.php

+ 4 - 1
inc/classes/BxDolSession.php

@@ -96,7 +96,10 @@ class BxDolSession extends BxDolFactory implements iBxDolSingleton
 		if (!$this->sId)
             $this->sId = genRndPwd(32, true);
 
-        bx_setcookie(BX_DOL_SESSION_COOKIE, $this->sId, time() + BX_DOL_SESSION_LIFETIME, 'auto', '', 'auto', true);
+        $iTime = time() + BX_DOL_SESSION_LIFETIME;
+        if (getParam('sys_session_auth') && $this->isValue('remember_me') && !$this->getValue('remember_me'))
+            $iTime = 0;
+        bx_setcookie(BX_DOL_SESSION_COOKIE, $this->sId, $iTime, 'auto', '', 'auto', true);
 
         $this->save();
         return true;

+ 2 - 0
inc/profiles.inc.php

@@ -115,6 +115,8 @@ function bx_login($iId, $bRememberMe = false)
     }
 
     BxDolSession::getInstance()->setUserId($iId);
+    if (getParam('sys_session_auth'))
+        BxDolSession::getInstance()->setValue('remember_me', $bRememberMe);
 
     $oAccountQuery->updateLoggedIn($iId);