// added 1.5.0.2 version in install script + fix deleted Adminlogin accesses
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10762 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -27,6 +27,9 @@
|
||||
|
||||
class AdminAccessController extends AdminController
|
||||
{
|
||||
/* Black list of id_tab that do not have access */
|
||||
public $accesses_black_list = array(107);
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->table = 'access';
|
||||
@@ -45,10 +48,17 @@ class AdminAccessController extends AdminController
|
||||
{
|
||||
$current_profile = (int)$this->getCurrentProfileId();
|
||||
$profiles = Profile::getProfiles($this->context->language->id);
|
||||
$tabs = Tab::getTabs($this->context->language->id);
|
||||
$accesses = array();
|
||||
foreach ($profiles as $profile)
|
||||
$accesses[$profile['id_profile']] = Profile::getProfileAccesses($profile['id_profile']);
|
||||
|
||||
// Deleted id_tab that do not have access
|
||||
foreach ($tabs as $key => $tab)
|
||||
foreach ($this->accesses_black_list as $id_tab)
|
||||
if ($tab['id_tab'] == (int)$id_tab)
|
||||
unset($tabs[$key]);
|
||||
|
||||
$modules = array();
|
||||
foreach ($profiles as $profile)
|
||||
$modules[$profile['id_profile']] = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
@@ -64,7 +74,7 @@ class AdminAccessController extends AdminController
|
||||
$this->tpl_form_vars = array(
|
||||
'profiles' => $profiles,
|
||||
'accesses' => $accesses,
|
||||
'tabs' => Tab::getTabs($this->context->language->id),
|
||||
'tabs' => $tabs,
|
||||
'current_profile' => (int)$current_profile,
|
||||
'admin_profile' => (int)_PS_ADMIN_PROFILE_,
|
||||
'access_edit' => $this->tabAccess['edit'],
|
||||
@@ -98,12 +108,12 @@ class AdminAccessController extends AdminController
|
||||
'url_post' => self::$currentIndex.'&token='.$this->token,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
public function ajaxProcessUpdateAccess()
|
||||
{
|
||||
if ($this->tabAccess['edit'] != '1')
|
||||
throw new PrestashopException(Tools::displayError('You do not have permission to edit here.'));
|
||||
|
||||
|
||||
if (Tools::isSubmit('submitAddAccess'))
|
||||
{
|
||||
$perm = Tools::getValue('perm');
|
||||
@@ -151,13 +161,13 @@ class AdminAccessController extends AdminController
|
||||
die($res);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function ajaxProcessUpdateModuleAccess()
|
||||
{
|
||||
if ($this->tabAccess['edit'] != '1')
|
||||
throw new PrestashopException(Tools::displayError('You do not have permission to edit here.'));
|
||||
/* Update Access Modules */
|
||||
|
||||
|
||||
if (Tools::isSubmit('changeModuleAccess'))
|
||||
{
|
||||
$perm = Tools::getValue('perm');
|
||||
|
||||
Reference in New Issue
Block a user