Procházet zdrojové kódy

Ticket #2052 - Related issues.

AntonLV před 7 roky
rodič
revize
c3c2691c10

+ 9 - 3
inc/profiles.inc.php

@@ -148,8 +148,11 @@ function check_logged()
        BX_DOL_ROLE_MEMBER => 'member'
     );
 
-    $sID = isset($_COOKIE['memberID']) ? bx_process_input($_COOKIE['memberID']) : false;
-    $sPassword = isset($_COOKIE['memberPassword']) ? bx_process_input($_COOKIE['memberPassword']) : false;
+    $bID = isset($_COOKIE['memberID']);
+    $sID = $bID ? bx_process_input($_COOKIE['memberID']) : false;
+
+    $bPassword = isset($_COOKIE['memberPassword']);
+    $sPassword = $bPassword ? bx_process_input($_COOKIE['memberPassword']) : false;
 
     $bLogged = false;
     foreach ($aAccTypes as $iRole => $sValue) {
@@ -160,7 +163,10 @@ function check_logged()
         }
     }
 
-    if ((isset($_COOKIE['memberID']) || isset($_COOKIE['memberPassword'])) && !$bLogged)
+    if($bID && $bPassword && $bLogged)
+        bx_alert('account', 'logged', getLoggedId());
+
+    if(($bID || $bPassword) && !$bLogged)
         bx_logout(false);
 }
 

+ 1 - 1
studio/classes/BxDolStudioStore.php

@@ -316,7 +316,7 @@ class BxDolStudioStore extends BxTemplStudioPage
                 $aCounts[$aItem['item_id']] = $aItem['item_count'];
             }
 
-            $aProducts = $oJson->load($this->sStoreDataUrlPublic . 'json_browse_selected', array('products' => base64_encode(serialize($aIds))));
+            $aProducts = $oJson->load($this->sStoreDataUrlPublic . 'json_browse_selected', array('products' => base64_encode(serialize($aIds)), 'client' => $this->iClient, 'key' => $this->sClientKey));
             if(!empty($aProducts))
                 $aResult[$sVendor] = array(
                     'ids' => $aIds,

+ 9 - 8
studio/template/scripts/BxBaseStudioStore.php

@@ -445,16 +445,17 @@ class BxBaseStudioStore extends BxDolStudioStore
         foreach($aVendors as $iVendor => $aInfo) {
             $fTotal = 0;
             $sVendor = $sCurrency = '';
-            foreach($aInfo['products'] as $aProduct) {
-                $iCount = isset($aInfo['counts'][$aProduct['id']]) ? (int)$aInfo['counts'][$aProduct['id']] : 1;
-                $fTotal += $iCount * $aProduct['price_single'];
+            if(!empty($aInfo['products']) && is_array($aInfo['products']))
+                foreach($aInfo['products'] as $aProduct) {
+                    $iCount = isset($aInfo['counts'][$aProduct['id']]) ? (int)$aInfo['counts'][$aProduct['id']] : 1;
+                    $fTotal += $iCount * $aProduct['price_single'];
 
-                if($sVendor == '' && isset($aProduct['author_name']))
-                    $sVendor = $aProduct['author_name'];
+                    if($sVendor == '' && isset($aProduct['author_name']))
+                        $sVendor = $aProduct['author_name'];
 
-				if($sCurrency == '' && isset($aProduct['author_currency_sign']))
-                    $sCurrency = $aProduct['author_currency_sign'];
-            }
+                                    if($sCurrency == '' && isset($aProduct['author_currency_sign']))
+                        $sCurrency = $aProduct['author_currency_sign'];
+                }
 
             $aMenu = array(
                 array('id' => 'checkout-' . $iVendor, 'name' => 'checkout-' . $iVendor, 'link' => 'javascript:void(0)', 'onclick' => $sJsObject . ".checkoutCart(" . $iVendor . ", this);", 'target' => '_self', 'title' => '_adm_action_cpt_checkout', 'active' => 1),