在 Opencart 1.5.4.1 版中,如果客户在第 1 组中,我使用以下代码来限制对信息页面 7 的访问。它在禁用 SSL 的情况下工作正常,但在启用 SSL 的情况下不起作用。我该怎么做才能让它与 SSL 配合使用?
要限制对某些信息页面的访问,您可以检查请求的 information_id 和当前用户组,然后输出自定义内容:
在 catalog/controller/information/information.php 中找到第 62 行:
$this->response->setOutput($this->render());
} else {
......
之前添加:
$id = $this->customer->getCustomerGroupId();
if ($id == 1 && $information_id == 7){
$this->data['heading_title'] = 'Not allowed.';
$this->data['description'] = 'You are not allowed to view this page';
}