Przeglądaj źródła

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

AntonLV 2 lat temu
rodzic
commit
85b2b9d0f0

+ 0 - 22
api.php

@@ -3,23 +3,6 @@
 define('BX_API', true);
 
 require_once('./inc/header.inc.php');
-
-if (bx_get('ses_sync') ){
-    $aData = (new BxDolSessionQuery())->getCookie(bx_get('ses_sync'));
-    if ($aData){
-        $aCookies = json_decode($aData, true);
-        foreach ($aCookies as $i => $aCookie){
-            //unset($_COOKIE[$aCookie[0]]); 
-            //setcookie($aCookie[0], '', -1, '/'); 
-         //   $aCookie[2]['domain']='';
-            setcookie($aCookie[0], $aCookie[1], $aCookie[2]);
-        }
-    }
-
-    echo json_encode([$aData]);
-    exit();
-}
-
 require_once(BX_DIRECTORY_PATH_INC . "profiles.inc.php");
 require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
 
@@ -111,9 +94,4 @@ $aRv = [
     'data' => $mixedRet,
 ];
 
-if (isset($GLOBALS['session_key'])){
-    $sKey = (new BxDolSessionQuery())->addCookie(json_encode($GLOBALS['session_key']));
-    $aRv['session_key'] = $sKey;
-}
-
 echo json_encode($aRv);

+ 0 - 19
inc/classes/BxDolSessionQuery.php

@@ -13,36 +13,17 @@
 class BxDolSessionQuery extends BxDolDb
 {
     protected $sTable;
-    protected $sTableCookies;
 
     public function __construct()
     {
         parent::__construct();
 
         $this->sTable = 'sys_sessions';
-        $this->sTableCookies = 'sys_cookies';
     }
     function getTableName()
     {
         return $this->sTable;
     }
-    
-    function addCookie($sCookies){
-        $sKey = strtolower(genRndPwd(32, false));
-        
-        if (rand(1, 20) == 10){
-            $sSql = $this->prepare("DELETE FROM `" . $this->sTableCookies . "` WHERE `added` < ? ", time() - 36000);
-            $this->query($sSql);
-        }
-        
-        $this->query("INSERT INTO `" . $this->sTableCookies . "` (`key`, `cookies`, `added`) VALUES (:key, :cookies, :added)", ['key' => $sKey, 'cookies' => $sCookies, 'added' => time()]);
-        return $sKey;
-    }
-    
-    function getCookie($sKey){
-        return $this->getOne("SELECT `cookies` FROM `" . $this->sTableCookies . "` WHERE `key` = :key", ['key' => $sKey]);
-    }
-    
     function exists($sId)
     {
         $sSql = $this->prepare("SELECT `id`, `user_id`, `data` FROM `" . $this->sTable . "` WHERE `id`=? LIMIT 1", $sId);

+ 0 - 5
inc/utils.inc.php

@@ -2313,8 +2313,6 @@ function bx_birthday2age($sBirthday)
 
 function bx_setcookie($sName, $sValue = "", $oExpiresOrOptions = 0, $sPath = 'auto', $sDomain = '', $bSecure = 'auto', $bHttpOnly = false)
 {
-    if (bx_is_api() && bx_get('ses_sync'))
-        return ;
        
     $aUrl = 'auto' === $sPath || 'auto' === $bSecure ? parse_url(BX_DOL_URL_ROOT) : [];
 
@@ -2348,9 +2346,6 @@ function bx_setcookie($sName, $sValue = "", $oExpiresOrOptions = 0, $sPath = 'au
         ];
         if (!defined('BX_MULTISITE_URL_COOKIE') && !isset($aOptions['samesite']) && ('memberPassword' == $sName || 'memberSession' == $sName))
             $aOptions['samesite'] = bx_is_api() ? getParam('sys_api_cookie_samesite') : getParam('sys_samesite_cookies');
-        if (bx_is_api()){
-            $GLOBALS['session_key'][$sName] =  [$sName, $sValue, $aOptions];
-        }
         return setcookie($sName, $sValue, $aOptions);
     }
 }

Plik diff jest za duży
+ 0 - 0
install/sql/system.sql


+ 1 - 1
template/scripts/BxBaseServiceAccount.php

@@ -80,7 +80,7 @@ class BxBaseServiceAccount extends BxDol
                 }
                 return [
                     bx_api_get_block('redirect', ['uri' => $sRedirectUrl]),
-                    bx_api_get_block('login', ['session' => BxDolSession::getInstance()->getId()], ['id' => 2]),
+                    //bx_api_get_block('login', ['session' => BxDolSession::getInstance()->getId()], ['id' => 2]),
                 ];
             }
             else

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików