Conflict Auth and I18n #6092

16 views
Skip to first unread message

francky06l

unread,
Nov 27, 2007, 4:57:28 PM11/27/07
to CakePHP Bleeding Edge
I still have a problem with the Auth component and the I18n.
I used to remove the __() in the Auth initialize function. This has
been modified and placed into startup, that's great.
However, because I need to set a message for errorLoging etc.. for the
Auth, I have set in my app_controller.php, beforeFilter :

if(isset($this->Auth))
{
$this->Auth->errorLogin = __('checkaccount', true);
$this->Auth->authError = __('accessviolation',
true);
$this->Auth->ajaxLogin = 'ajaxlogin';
$this->Auth->loginAction = '/users/login';
$this->Auth->authorize = 'actions';
}

Well it use to work, but now, if I want it to work I have to remove my
own message from app_controller .. I have searched, can't find any
solution this time..
I store the language in Configure::write('Config.language'), I work in
Cyrillic and English, but it seems the call to the first __() when the
Auth component is set does not take in account the value or reset it
some how to 'eng'. I have seen the cache persistent directory with
us_eng (default of l10n), bul (for Bulgarian) and eng (for English
british)...
If I remove the Auth, everything is working ...
Someone has got some hints ?

Thanks

francky06l

unread,
Nov 29, 2007, 6:05:09 AM11/29/07
to CakePHP Bleeding Edge
The solution I found is to set the Auth login/error in afterFilter of
the app_controller

function afterFilter()
{
Reply all
Reply to author
Forward
0 new messages