2

每次我安装一个新的扩展时,我都会收到这个错误:

错误:您无权访问此页面,请咨​​询您的系统管理员。

我已经进入系统 > 用户组,并为新的扩展模块添加权限(访问权限和修改权限),但没有运气。

我尝试安装“2checkout”“Ajax Quick CheckOut”“并得到同样的错误。

4

3 回答 3

7

Most likely you're trying to install an extension that is not compatible with OpenCart 2.3.0.2. OpenCart 2.3.X introduced some changes related to extension structure, so you will have to make those changes first


Path change:

All of the extension types have now moved under a new directory named extension.

For example if you have a payment extension then its old structure looked like:

admin/controller/payment/xxx.php
admin/model/payment/xxx.php
admin/language/en-gb/payment/xxx.php
admin/view/template/payment/xxx.php

Now you must change it to:

admin/controller/extension/payment/xxx.php
admin/model/extension/payment/xxx.php
admin/language/en-gb/extension/payment/xxx.php
admin/view/template/extension/payment/xxx.php

Module load path and URL changes:

And while loading the module you must include extension in the path. i.e $this->load->model('module/:') now becomes$this->load->model('extension/module/mymod').

This is true for admin URL links as well. $this->url->link('payment/mymod', 'token=' . $this->session->data['token'], 'SSL') now becomes $this->url->link('extension/payment/mymod', 'token=' . $this->session->data['token'], 'SSL').

Class name changes:

Next change is related to class names. A class named ControllerModuleMyMod should be renamed to ControllerExtensionModuleMyMod.

These changes are applicable to both admin and catalog.


Related threads:

于 2016-10-12T06:57:19.650 回答
0

转到管理员 - 系统 - 用户 - 用户组 编辑您的管理员并全选然后保存。问题将得到解决。

于 2017-11-16T14:07:04.053 回答
0

可能需要更改模块中管理控制器的 validate() 例程:

if (!$this->user->hasPermission('modify', 'module/oldmodule')) {

}

至:

if (!$this->user->hasPermission('modify', 'extension/module/oldmodule')) {

}
于 2017-07-27T13:20:22.710 回答