我使用的是 CakePHP 1.3,我想更改此消息:
您无权访问该位置。
到(例如):
哦对不起
消息从此代码出现:
echo $this->Session->flash('auth');
我将 app_controller 更改为
class AppController extends Controller {
var $components = array('Auth', 'Session', 'Acl');
function beforeFilter() {
$this->Auth->authorize = 'actions';
$this->Auth->autoRedirect = false;
if ($this->params['controller'] == 'pages') {
$this->Auth->allow('*');
}
$this->Auth->allow('pages');
$this->Auth->loginError = "This message shows up when the wrong credentials are used";
$this->Auth->authError = "This error shows up with the user tries to access a part of the website that is protected.";
}
}
但我面临同样的信息。