(GMT 8): Australia Western, China People's Rep, Hong Kong, Malaysia
Recent Comments
Posted 09/01/2007 02:36am
Reply to comment 27 and 28. For those who cannot wait, here are the small changes you can do to enable the user to be redirected back the page where they entered.
In the function checkSession which is in the appController
function checkSession()
{
// If the session info hasn't been set...
if (!$this->Session->check('User'))
{
$this->Session->write('login_referrer',$this->params['url']['url']);
// Force the user to login
$this->redirect('/users/login');
exit();
}
}
And in the login() function in the user controller we place the follow code:
if ($success){
// some codes you might have goes here.
if ($this->Session->check('login_referrer'))
{
$loginReferrer = $this->Session->read('login_referrer');
$this->Session->delete('login_referrer'); $this->redirect($loginReferrer);
return true;
}
// the line before is the original redirect code
$this->dAuth->redirect('login_success');
return true;
}
That should be all. I am looking forward to dAuth v0.4. It had been a really good component for me so far.
Dieter,
Pardon it is me again. In IE, the warning:
"Login impossible. For security reasons, you should enable javascript."
appears even when IE has javascript running. Firefox works nicely. I am not too sure is it me and my whole office, we does that the javascript no enabled message.
A work around was to change the message from a
to a .
Under dAuth helper formheader function:
Current:
$output = "
$action $this->noClearTextErrorMessage
";
Change to:
$output = "$action $this->noClearTextErrorMessage";
It works and I guess there should not be much side effect to the display. Hope this is useful again.
Under d_auth.jsp doStage2 function:
current: var hash = stage2Hash(stage1Hash(password) + salt);
Should be: var hash = stage2Hash(stage1Hash(password),salt);
Took me few hours to find this problem. Do change it asap.
Under users_controller.php:
For those who does not have it, add the RequestHandler Component with:
var $components = array('dAuth','RequestHandler');
And the current syntax of the RequestHandler method calls are in lower case.
current: $this->requestHandler->getClientIP()
change to: $this->RequestHandler->getClientIP()
In the function checkSession which is in the appController
function checkSession()
{
// If the session info hasn't been set...
if (!$this->Session->check('User'))
{
$this->Session->write('login_referrer',$this->params['url']['url']);
// Force the user to login
$this->redirect('/users/login');
exit();
}
}
And in the login() function in the user controller we place the follow code:
if ($success){
// some codes you might have goes here.
if ($this->Session->check('login_referrer'))
{
$loginReferrer = $this->Session->read('login_referrer');
$this->Session->delete('login_referrer'); $this->redirect($loginReferrer);
return true;
}
// the line before is the original redirect code
$this->dAuth->redirect('login_success');
return true;
}
That should be all. I am looking forward to dAuth v0.4. It had been a really good component for me so far.
Pardon it is me again. In IE, the warning:
"Login impossible. For security reasons, you should enable javascript."
appears even when IE has javascript running. Firefox works nicely. I am not too sure is it me and my whole office, we does that the javascript no enabled message.
A work around was to change the message from a
to a .
Under dAuth helper formheader function:
Current:
$output = "";
Change to:
$output = "";
It works and I guess there should not be much side effect to the display. Hope this is useful again.
Some extra bugs to report:
Under d_auth.jsp doStage2 function:
current: var hash = stage2Hash(stage1Hash(password) + salt);
Should be: var hash = stage2Hash(stage1Hash(password),salt);
Took me few hours to find this problem. Do change it asap.
Under users_controller.php:
For those who does not have it, add the RequestHandler Component with:
var $components = array('dAuth','RequestHandler');
And the current syntax of the RequestHandler method calls are in lower case.
current: $this->requestHandler->getClientIP()
change to: $this->RequestHandler->getClientIP()
That is all. Hope these changes are useful.