[-] Project : #PSFV-781 - Profile and access cannot be managed by SHOP

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14432 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2012-04-03 15:14:09 +00:00
parent 298f174e6f
commit 69cc3a8563
2 changed files with 11 additions and 9 deletions
+4 -3
View File
@@ -35,9 +35,10 @@ class AdminAccessControllerCore extends AdminController
public function __construct() public function __construct()
{ {
$this->table = 'access'; $this->table = 'access';
$this->className = 'Profile'; $this->className = 'Profile';
$this->lang = false; $this->multishop_context = Shop::CONTEXT_ALL;
$this->lang = false;
$this->context = Context::getContext(); $this->context = Context::getContext();
// Blacklist AdminLogin // Blacklist AdminLogin
@@ -235,6 +236,6 @@ class AdminAccessControllerCore extends AdminController
*/ */
public function getCurrentProfileId() public function getCurrentProfileId()
{ {
return (isset($_GET['id_profile']) && !empty($_GET['id_profile']) && is_numeric($_GET['id_profile'])) ? (int)$_GET['id_profile'] : 1; return (isset($_GET['id_profile']) && !empty($_GET['id_profile']) && is_numeric($_GET['id_profile'])) ? (int)$_GET['id_profile'] : 1;
} }
} }
@@ -30,14 +30,15 @@ class AdminProfilesControllerCore extends AdminController
public function __construct() public function __construct()
{ {
$this->context = Context::getContext(); $this->context = Context::getContext();
$this->table = 'profile'; $this->table = 'profile';
$this->className = 'Profile'; $this->className = 'Profile';
$this->lang = true; $this->multishop_context = Shop::CONTEXT_ALL;
$this->lang = true;
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $this->addRowAction('delete');
$this->addRowActionSkipList('delete', array(1)); $this->addRowActionSkipList('delete', array(1));
$this->bulk_actions = array( $this->bulk_actions = array(
'delete' => array('text' => $this->l('Delete selected'), 'delete' => array('text' => $this->l('Delete selected'),
'confirm' => $this->l('Delete selected items?')) 'confirm' => $this->l('Delete selected items?'))
); );
@@ -83,7 +84,7 @@ class AdminProfilesControllerCore extends AdminController
public function postProcess() public function postProcess()
{ {
/* PrestaShop demo mode */ /* PrestaShop demo mode */
if (_PS_MODE_DEMO_) if (_PS_MODE_DEMO_)
{ {
$this->errors[] = Tools::displayError('This functionality has been disabled.'); $this->errors[] = Tools::displayError('This functionality has been disabled.');
@@ -91,7 +92,7 @@ class AdminProfilesControllerCore extends AdminController
} }
/* PrestaShop demo mode*/ /* PrestaShop demo mode*/
if (isset($_GET['delete'.$this->table]) && $_GET[$this->identifier] == (int)(_PS_ADMIN_PROFILE_)) if (isset($_GET['delete'.$this->table]) && $_GET[$this->identifier] == (int)(_PS_ADMIN_PROFILE_))
$this->errors[] = $this->l('For security reasons, you cannot delete the Administrator profile'); $this->errors[] = $this->l('For security reasons, you cannot delete the Administrator profile');
else else
parent::postProcess(); parent::postProcess();