// ajax.php clean and bug fixes

This commit is contained in:
rGaillard
2012-06-15 13:22:07 +00:00
parent 4c555b4e6d
commit 54675df666
20 changed files with 383 additions and 328 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ class CmsControllerCore extends FrontController
/* assignCase (1 = CMS page, 2 = CMS category) */
if (Validate::isLoadedObject($this->cms)
&& ($this->cms->isAssociatedToShop() && $this->cms->active || (Tools::getValue('adtoken') == Tools::encrypt('PreviewCMS'.$this->cms->id))))
&& ($this->cms->isAssociatedToShop() && $this->cms->active || (Tools::getValue('adtoken') == Tools::getAdminToken('AdminCmsContent'.(int)Tab::getIdFromClassName('AdminCmsContent').(int)Tools::getValue('id_employee')))))
$this->assignCase = 1;
else if (Validate::isLoadedObject($this->cms_category))
$this->assignCase = 2;
+2 -2
View File
@@ -94,8 +94,8 @@ class ProductControllerCore extends FrontController
* In all the others cases => 404 "Product is no longer available"
*/
if (!$this->product->isAssociatedToShop()
|| ((!$this->product->active && ((Tools::getValue('adtoken') != Tools::encrypt('PreviewProduct'.$this->product->id))
|| !file_exists(_PS_ROOT_DIR_.'/'.Tools::getValue('ad').'/ajax.php')))))
|| ((!$this->product->active && ((Tools::getValue('adtoken') != Tools::getAdminToken('AdminProducts'.(int)Tab::getIdFromClassName('AdminProducts').(int)Tools::getValue('id_employee')))
|| !file_exists(_PS_ROOT_DIR_.'/'.Tools::getValue('ad').'/index.php')))))
{
header('HTTP/1.1 404 page not found');
$this->errors[] = Tools::displayError('Product is no longer available.');