Khóa chức năng export style Xenforo

  • Thread starter Thread starter PVS
  • Ngày gửi Ngày gửi

PVS

Super Moderator
Thành viên BQT
Bạn đang cần giúp đỡ, hay set quyền admin cho 1 tài khoản nào đó, mà lo sợ người đó sẽ export styles thân yêu của bạn, cách này sẽ giúp bạn bỏ đi phần export này, khi nào cần thì dán lại để dùng.

- Đầu tiên mở thư mục " ..\library\XenForo\ControllerAdmin "
- Copy file style.php và lưu nó ra chỗ khác ( sau này dùng lại nếu có lỗi phát sinh hoặc bạn muốn export style )

Xong rồi rồi mở file style.php trong thư mục ControllerAdmin lên, tìm đến đoạn code này
Mã:
public function actionExport()
    {
        $styleId = $this->_input->filterSingle('style_id', XenForo_Input::UINT);
        $style = $this->_getStyleOrError($styleId);

        if ($this->isConfirmedPost())
        {
            $input = $this->_input->filter(array(
                'addon_id' => XenForo_Input::STRING,
                'independent' => XenForo_Input::UINT
            ));

            $this->_routeMatch->setResponseType('xml');

            $addOnId = ($input['addon_id'] ? $input['addon_id'] : null);

            $viewParams = array(
                'style' => $style,
                'xml' => $this->_getStyleModel()->getStyleXml($style, $addOnId, $input['independent'])
            );

            return $this->responseView('XenForo_ViewAdmin_Style_ExportXml', '', $viewParams);
        }
        else
        {
            $viewParams = array(
                'style' => $style,
                'addOnOptions' => $this->getModelFromCache('XenForo_Model_AddOn')->getAddOnOptionsList(false, true)
            );

            return $this->responseView('XenForo_ViewAdmin_Style_Export', 'style_export', $viewParams);
        }
    }

Xóa nó đi , rồi f5 admincp export thử xem , nếu làm như trên khi export sẽ có thông báo như này.
the following error has occurred


Nguồn: muaban47.net​
 
  • Like
Reactions: THB
Back
Top