// Fix token on adminHome

This commit is contained in:
rMalie committed 2011-09-26 08:24:38 +00:00
1 parent ea8a38b22c
commit 71a2a66abc
2 files changed
+8 -4

No files matched your search

+3 -3
View File
@@ -419,7 +419,7 @@ function generateShopList()
/** /**
* for retrocompatibility with old AdminTab, old index.php * for retrocompatibility with old AdminTab, old index.php
* *
* @return void * @return void
*/ */
function runAdminTab() function runAdminTab()
@@ -456,12 +456,12 @@ if ($adminObj = checkingTab($tab))
$bread .= ' <img src="../img/admin/separator_breadcrum.png" style="margin-right:5px" alt="&gt;" />'; $bread .= ' <img src="../img/admin/separator_breadcrum.png" style="margin-right:5px" alt="&gt;" />';
if (count($tabs) - 1 > $key) if (count($tabs) - 1 > $key)
$bread .= '<a href="?tab='.$item['class_name'].'&token='.Tools::getAdminToken($item['class_name'].intval($item['id_tab']).(int)Context::getContext()->employee->id).'">'; $bread .= '<a href="?tab='.$item['class_name'].'&token='.Tools::getAdminToken($item['class_name'].intval($item['id_tab']).(int)Context::getContext()->employee->id).'">';
$bread .= $item['name']; $bread .= $item['name'];
if (count($tabs) - 1 > $key) if (count($tabs) - 1 > $key)
$bread .= '</a>'; $bread .= '</a>';
} }
// @TODO : a way to desactivate this feature // @TODO : a way to desactivate this feature
echo'<script type="text/javascript"> echo'<script type="text/javascript">
+5 -1
View File
@@ -38,7 +38,7 @@ class AdminControllerCore extends Controller
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
// if this->template is empty, // if this->template is empty,
// generate the filename from the classname, without "Controller" suffix // generate the filename from the classname, without "Controller" suffix
if (empty($this->template)) if (empty($this->template))
{ {
@@ -78,6 +78,10 @@ class AdminControllerCore extends Controller
$this->token = Tools::getAdminToken($className.(int)$this->id.(int)$this->context->employee->id); $this->token = Tools::getAdminToken($className.(int)$this->id.(int)$this->context->employee->id);
// Fix for AdminHome
if ($className == 'AdminHome')
$_POST['token'] = $this->token;
if (!Shop::isMultiShopActivated()) if (!Shop::isMultiShopActivated())
$this->shopLinkType = ''; $this->shopLinkType = '';
} }