mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
"Fixes #3640, Auth component and i18n conflict"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6084 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
cae5d5bb31
commit
586ff7201c
1 changed files with 10 additions and 4 deletions
|
@ -164,7 +164,7 @@ class AuthComponent extends Object {
|
|||
* @var string
|
||||
* @access public
|
||||
*/
|
||||
var $loginError = '';
|
||||
var $loginError = null;
|
||||
/**
|
||||
* Error to display when user attempts to access an object or action to which they do not have
|
||||
* acccess.
|
||||
|
@ -172,7 +172,7 @@ class AuthComponent extends Object {
|
|||
* @var string
|
||||
* @access public
|
||||
*/
|
||||
var $authError = '';
|
||||
var $authError = null;
|
||||
/**
|
||||
* Determines whether AuthComponent will automatically redirect and exit if login is successful.
|
||||
*
|
||||
|
@ -226,8 +226,6 @@ class AuthComponent extends Object {
|
|||
$this->params = $controller->params;
|
||||
$crud = array('create', 'read', 'update', 'delete');
|
||||
$this->actionMap = am($this->actionMap, array_combine($crud, $crud));
|
||||
$this->loginError = __('Login failed. Invalid username or password.', true);
|
||||
$this->authError = __('You are not authorized to access that location.', true);
|
||||
|
||||
$admin = Configure::read('Routing.admin');
|
||||
if (!empty($admin)) {
|
||||
|
@ -256,6 +254,14 @@ class AuthComponent extends Object {
|
|||
* @access public
|
||||
*/
|
||||
function startup(&$controller) {
|
||||
if (!$this->loginError) {
|
||||
$this->loginError = __('Login failed. Invalid username or password.', true);
|
||||
}
|
||||
|
||||
if (!$this->authError) {
|
||||
$this->authError = __('You are not authorized to access that location.', true);
|
||||
}
|
||||
|
||||
if (low($controller->name) == 'app' || (low($controller->name) == 'tests' && Configure::read() > 0)) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue