I am using symfony 1.4.8 and Propel as ORM. To create a login system I am using sfGuardPlugin. I have configured everything, and the login system is working. But I have a problem in getting the sfGuard user data such as sfGuardUser id, and on login I am getting the back button problem; as I login and press the back button, it again shows the Login Page.
Here is the code that I am using in the view to check whether the user is logged in:
<?php if($sf_user->isAuthenticated()): ?>
<?php echo link_to('Logout', '/logout') ?>
<?php else: ?>
<?php echo link_to('Login', '/login') ?>
<?php endif; ?>
and if I use this method to get sfGuardUser id:
if($this->getUser())
{
$login_id=$this->getUser();
$c=new Criteria();
$c->add(SfGuardUserPeer::USERNAME,$login_id);
$sf_guard_user=SfGuardUserPeer::doSelectOne($c);
if($sf_guard_user)
{
$sf_id=$sf_guard_user->getId();
}
}
it gives me the error:
(Fatal error: Nesting level too deep - recursive dependency? in D:\development\sfprojects\proj\lib\vendor\symfony\lib\plugins\sfPropelPlugin\lib\vendor\propel\util\DebugPDOStatement.php on line 124)