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

This commit is contained in:
mDeflotte committed 2012-04-03 15:14:09 +00:00
1 parent 49946ada4c
commit f2423aa235
2 files changed
+11 -9

No files matched your search

+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();