// Context part 31

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8087 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-08-17 10:07:12 +00:00
parent b8706ddd8a
commit cb3d802346
57 changed files with 200 additions and 165 deletions

View File

@@ -36,8 +36,7 @@ class getFileControllerCore extends FrontController
public function process()
{
$cookie = $this->context->cookie;
if ($cookie->isLoggedBack() AND Tools::getValue('file'))
if (isset($this->context->employee) && $this->context->employee->isLoggedBack() AND Tools::getValue('file'))
{
/* Admin can directly access to file */
$filename = Tools::getValue('file');
@@ -62,11 +61,10 @@ class getFileControllerCore extends FrontController
if (!($key = Tools::getValue('key')))
$this->displayCustomError('Invalid key.');
$cookie = new Cookie('ps');
Tools::setCookieLanguage();
if (!$cookie->isLogged() AND !Tools::getValue('secure_key') AND !Tools::getValue('id_order'))
if (!$this->context->customer->isLogged() AND !Tools::getValue('secure_key') AND !Tools::getValue('id_order'))
Tools::redirect('index.php?controller=authentication&back=get-file.php&key='.$key);
elseif (!$cookie->isLogged() AND Tools::getValue('secure_key') AND Tools::getValue('id_order'))
elseif (!$this->context->customer->isLogged() AND Tools::getValue('secure_key') AND Tools::getValue('id_order'))
{
$order = new Order((int)Tools::getValue('id_order'));
if (!Validate::isLoadedObject($order))