<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Logging in Users using Doctrine and Zend_Auth</title>
	<atom:link href="http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/</link>
	<description>free Zend Framework screencasts. Video tutorials to get you up to speed with different parts of the Zend Framework and enterprise PHP development.</description>
	<lastBuildDate>Wed, 01 Feb 2012 00:49:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: Fromz</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-21950</link>
		<dc:creator>Fromz</dc:creator>
		<pubDate>Wed, 10 Aug 2011 06:19:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-21950</guid>
		<description>Hey, I was wondering how you would go about making a persistent session?</description>
		<content:encoded><![CDATA[<p>Hey, I was wondering how you would go about making a persistent session?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julien</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-9094</link>
		<dc:creator>Julien</dc:creator>
		<pubDate>Wed, 04 Aug 2010 15:08:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-9094</guid>
		<description>Hi,

Very usefull tutorial, thanks for that !
I have a question though, if you still answer the questions on your older tutorials...

You mention at the end of the webcast that it could be good to put this logic in a Controller Plugin. 
I have indeed an application where every single action needs the user to be logged in.
So this is typically a Controller PLugin case, I guess...

I created and registered the plugin, added a preDispatch method in it... but there I am stuck.I am new to zend so, I can understand that you could put the logic in here, but what about the views? I mean, let&#039;s say I check whether the user is identified in this preDispatch action...well how can I from there on lead the user to the login form ? Do I have to forward him to another controller, a normal one with views? Or am I missing something ?
This concept of &quot;Login/logout&quot; in a Controller Plugin is not all to clear to me...could you please give me some hints?

Thanks in advance !</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Very usefull tutorial, thanks for that !<br />
I have a question though, if you still answer the questions on your older tutorials&#8230;</p>
<p>You mention at the end of the webcast that it could be good to put this logic in a Controller Plugin.<br />
I have indeed an application where every single action needs the user to be logged in.<br />
So this is typically a Controller PLugin case, I guess&#8230;</p>
<p>I created and registered the plugin, added a preDispatch method in it&#8230; but there I am stuck.I am new to zend so, I can understand that you could put the logic in here, but what about the views? I mean, let&#8217;s say I check whether the user is identified in this preDispatch action&#8230;well how can I from there on lead the user to the login form ? Do I have to forward him to another controller, a normal one with views? Or am I missing something ?<br />
This concept of &#8220;Login/logout&#8221; in a Controller Plugin is not all to clear to me&#8230;could you please give me some hints?</p>
<p>Thanks in advance !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JohnB</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-6414</link>
		<dc:creator>JohnB</dc:creator>
		<pubDate>Wed, 31 Mar 2010 21:29:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-6414</guid>
		<description>If you are using apc chache on top of public/index.php you have to put:

function shutdown()
{
 Zend_Session::writeClose(true);
}
register_shutdown_function(&#039;shutdown&#039;);

otherwise it&#039;ll crash.
here is more about that:
http://stackoverflow.com/questions/1364750/opcode-apc-xcache-zend-doctrine-and-autoloaders</description>
		<content:encoded><![CDATA[<p>If you are using apc chache on top of public/index.php you have to put:</p>
<p>function shutdown()<br />
{<br />
 Zend_Session::writeClose(true);<br />
}<br />
register_shutdown_function(&#8216;shutdown&#8217;);</p>
<p>otherwise it&#8217;ll crash.<br />
here is more about that:<br />
<a href="http://stackoverflow.com/questions/1364750/opcode-apc-xcache-zend-doctrine-and-autoloaders" rel="nofollow">http://stackoverflow.com/questions/1364750/opcode-apc-xcache-zend-doctrine-and-autoloaders</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rik</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-6355</link>
		<dc:creator>Rik</dc:creator>
		<pubDate>Sun, 28 Mar 2010 11:03:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-6355</guid>
		<description>@shaded:
I could be wrong, but i think that formatting is the xdebug extension doing it&#039;s thing.

I&#039;ve got xdebug installed and when I do a var_dump my output gets automatically formatted. Just like a stack trace when an exception has occurred.</description>
		<content:encoded><![CDATA[<p>@shaded:<br />
I could be wrong, but i think that formatting is the xdebug extension doing it&#8217;s thing.</p>
<p>I&#8217;ve got xdebug installed and when I do a var_dump my output gets automatically formatted. Just like a stack trace when an exception has occurred.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shaded</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-6315</link>
		<dc:creator>shaded</dc:creator>
		<pubDate>Thu, 25 Mar 2010 16:27:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-6315</guid>
		<description>Great set, i was finally about to merge the series on zend_db, zend_acl and zend_auth to come up with a decent demo:) 

How do you get your var_dump output to be formatted so nicely? &lt;pre&gt; tags help, but still not as nice as yours.</description>
		<content:encoded><![CDATA[<p>Great set, i was finally about to merge the series on zend_db, zend_acl and zend_auth to come up with a decent demo:) </p>
<p>How do you get your var_dump output to be formatted so nicely?
<pre> tags help, but still not as nice as yours.</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Whisher</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5907</link>
		<dc:creator>Whisher</dc:creator>
		<pubDate>Sun, 07 Mar 2010 14:39:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5907</guid>
		<description>Hi,
As usual excellent tutorial :)
Do you think is it the right approach 
to get auth either with username or with email
public static function authenticate($usernameOrEmail, $password)
  {
    try{
      if(false !== filter_var($usernameOrEmail, FILTER_VALIDATE_EMAIL)){
        $user = self::findOneByEmail($usernameOrEmail);
      }
      else{
        $user = self::findOneByUsername($usernameOrEmail);
      }
    } 
    catch(Exception $e){
      throw new Exception(self::DB_TROUBLES);
    }   
    if (false !== $user){
      if ($user-&gt;password == $password){
        if($user-&gt;status === &#039;1&#039;){
          return $user;
        }
        throw new Exception(self::WRONG_STATUS);
      }
      throw new Exception(self::WRONG_PW);
    }
    throw new Exception(self::NOT_FOUND);
  }

Bye.
PS

My 5 cents to avoid storing the password
in session
public function authenticate()
  {
    try
    {
      $this-&gt;user = Model_User::authenticate($this-&gt;usernameOrEmail, $this-&gt;password);
    }
    catch (Exception $e)
    {
      if ($e-&gt;getMessage() == Model_User::DB_TROUBLES){
        return $this-&gt;result(Zend_Auth_Result::FAILURE, self::DB_TROUBLES_MESSAGE);
      }
      if ($e-&gt;getMessage() == Model_User::NOT_FOUND){
        return $this-&gt;result(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, self::NOT_FOUND_MESSAGE);
      }
      if ($e-&gt;getMessage() == Model_User::WRONG_PW){
        return $this-&gt;result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, self::BAD_PW_MESSAGE);
      }
      if ($e-&gt;getMessage() == Model_User::WRONG_STATUS){
        return $this-&gt;result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, self::BAD_STATUS_MESSAGE);
      }
    }
    $this-&gt;user-&gt;password = null;
    return $this-&gt;result(Zend_Auth_Result::SUCCESS);
  }

You never know :)</description>
		<content:encoded><![CDATA[<p>Hi,<br />
As usual excellent tutorial <img src='http://www.zendcasts.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Do you think is it the right approach<br />
to get auth either with username or with email<br />
public static function authenticate($usernameOrEmail, $password)<br />
  {<br />
    try{<br />
      if(false !== filter_var($usernameOrEmail, FILTER_VALIDATE_EMAIL)){<br />
        $user = self::findOneByEmail($usernameOrEmail);<br />
      }<br />
      else{<br />
        $user = self::findOneByUsername($usernameOrEmail);<br />
      }<br />
    }<br />
    catch(Exception $e){<br />
      throw new Exception(self::DB_TROUBLES);<br />
    }<br />
    if (false !== $user){<br />
      if ($user-&gt;password == $password){<br />
        if($user-&gt;status === &#8217;1&#8242;){<br />
          return $user;<br />
        }<br />
        throw new Exception(self::WRONG_STATUS);<br />
      }<br />
      throw new Exception(self::WRONG_PW);<br />
    }<br />
    throw new Exception(self::NOT_FOUND);<br />
  }</p>
<p>Bye.<br />
PS</p>
<p>My 5 cents to avoid storing the password<br />
in session<br />
public function authenticate()<br />
  {<br />
    try<br />
    {<br />
      $this-&gt;user = Model_User::authenticate($this-&gt;usernameOrEmail, $this-&gt;password);<br />
    }<br />
    catch (Exception $e)<br />
    {<br />
      if ($e-&gt;getMessage() == Model_User::DB_TROUBLES){<br />
        return $this-&gt;result(Zend_Auth_Result::FAILURE, self::DB_TROUBLES_MESSAGE);<br />
      }<br />
      if ($e-&gt;getMessage() == Model_User::NOT_FOUND){<br />
        return $this-&gt;result(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, self::NOT_FOUND_MESSAGE);<br />
      }<br />
      if ($e-&gt;getMessage() == Model_User::WRONG_PW){<br />
        return $this-&gt;result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, self::BAD_PW_MESSAGE);<br />
      }<br />
      if ($e-&gt;getMessage() == Model_User::WRONG_STATUS){<br />
        return $this-&gt;result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, self::BAD_STATUS_MESSAGE);<br />
      }<br />
    }<br />
    $this-&gt;user-&gt;password = null;<br />
    return $this-&gt;result(Zend_Auth_Result::SUCCESS);<br />
  }</p>
<p>You never know <img src='http://www.zendcasts.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: martin</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5203</link>
		<dc:creator>martin</dc:creator>
		<pubDate>Wed, 03 Feb 2010 15:57:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5203</guid>
		<description>Genius @dave !! That&#039;s right, I probe it and everything is ok and I realized that @jon&#039;s googlecode does not appear that line, I don&#039;t know where I got it. Everything ok, big thanks for you, @jon and @jim, greetings.</description>
		<content:encoded><![CDATA[<p>Genius @dave !! That&#8217;s right, I probe it and everything is ok and I realized that @jon&#8217;s googlecode does not appear that line, I don&#8217;t know where I got it. Everything ok, big thanks for you, @jon and @jim, greetings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dave</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5173</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Tue, 02 Feb 2010 12:53:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5173</guid>
		<description>@martin, I downloaded the source code and compared each file, and the cause of the issue I found was actually in the bootstrap file:

$manager-&gt;setAttribute(Doctrine::ATTR_AUTOLOAD_TABLE_CLASSES, true); 

As soon as I removed the line above, it didn&#039;t give me any error of Zend_Sessions.

Hope it helps.</description>
		<content:encoded><![CDATA[<p>@martin, I downloaded the source code and compared each file, and the cause of the issue I found was actually in the bootstrap file:</p>
<p>$manager-&gt;setAttribute(Doctrine::ATTR_AUTOLOAD_TABLE_CLASSES, true); </p>
<p>As soon as I removed the line above, it didn&#8217;t give me any error of Zend_Sessions.</p>
<p>Hope it helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marsbomber</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5163</link>
		<dc:creator>marsbomber</dc:creator>
		<pubDate>Tue, 02 Feb 2010 00:45:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5163</guid>
		<description>@jon tried the redirector in indexcontroller, $this-&gt;_redirector-&gt;gotoUrl(&#039;/abc&#039;); 
in my abc controller, 
        if (!Zend_Auth::getInstance()-&gt;hasIdentity()) {
                var_dump(Zend_Auth::getInstance()-&gt;getIdentity()-&gt;toArray());
        }
        else {
                echo &quot;NO GOOD&quot;;
        }

i still have no good printed.</description>
		<content:encoded><![CDATA[<p>@jon tried the redirector in indexcontroller, $this-&gt;_redirector-&gt;gotoUrl(&#8216;/abc&#8217;);<br />
in my abc controller,<br />
        if (!Zend_Auth::getInstance()-&gt;hasIdentity()) {<br />
                var_dump(Zend_Auth::getInstance()-&gt;getIdentity()-&gt;toArray());<br />
        }<br />
        else {<br />
                echo &#8220;NO GOOD&#8221;;<br />
        }</p>
<p>i still have no good printed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jon</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5162</link>
		<dc:creator>jon</dc:creator>
		<pubDate>Tue, 02 Feb 2010 00:34:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5162</guid>
		<description>@marsbomber Good catch! I got my YAML files confused.

in terms of the _redirect, you can also try the redirector: http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#zend.controller.actionhelpers.redirector</description>
		<content:encoded><![CDATA[<p>@marsbomber Good catch! I got my YAML files confused.</p>
<p>in terms of the _redirect, you can also try the redirector: <a href="http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#zend.controller.actionhelpers.redirector" rel="nofollow">http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#zend.controller.actionhelpers.redirector</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marsbomber</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5160</link>
		<dc:creator>marsbomber</dc:creator>
		<pubDate>Tue, 02 Feb 2010 00:10:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5160</guid>
		<description>@jon I downloaded the sample app, and tried to make a _redirect to a different controller after auth. for some reason, it seems like the identity does not persist. Also, there&#039;s an error in the schema yaml file from the goolecode. i think the last line should be &quot;name: string()&quot; instead.</description>
		<content:encoded><![CDATA[<p>@jon I downloaded the sample app, and tried to make a _redirect to a different controller after auth. for some reason, it seems like the identity does not persist. Also, there&#8217;s an error in the schema yaml file from the goolecode. i think the last line should be &#8220;name: string()&#8221; instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marsbomber</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5158</link>
		<dc:creator>marsbomber</dc:creator>
		<pubDate>Mon, 01 Feb 2010 22:44:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5158</guid>
		<description>@martin and @dave, if you are interested, I made another post, which shows how I introduced a auth service class to take away the auth logic from the controller. you may want to checkout.

I&#039;ll try to give Jon&#039;s sample app a shot later today and let you know if I have similar issues.</description>
		<content:encoded><![CDATA[<p>@martin and @dave, if you are interested, I made another post, which shows how I introduced a auth service class to take away the auth logic from the controller. you may want to checkout.</p>
<p>I&#8217;ll try to give Jon&#8217;s sample app a shot later today and let you know if I have similar issues.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: martin</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5152</link>
		<dc:creator>martin</dc:creator>
		<pubDate>Mon, 01 Feb 2010 17:04:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5152</guid>
		<description>Hi Dave. I couldn&#039;t solve this. It seems that Zend_Auth loose their data across the pages. I don&#039;t know how to storage this data like I have been using with Zend_Auth_Adapter_DbTable because those methods doesn&#039;t exist for Zend_Auth_Adapter_Interface or I have been doing bad calls of this methods :( I use this approach (http://blog.elinkmedia.net.au/2010/01/24/zf-authentication-using-doctrine/comment-page-1/#comment-40) and it works ok, maybe you could make a plugin to use it like Jon&#039;s did in his tutorial.</description>
		<content:encoded><![CDATA[<p>Hi Dave. I couldn&#8217;t solve this. It seems that Zend_Auth loose their data across the pages. I don&#8217;t know how to storage this data like I have been using with Zend_Auth_Adapter_DbTable because those methods doesn&#8217;t exist for Zend_Auth_Adapter_Interface or I have been doing bad calls of this methods <img src='http://www.zendcasts.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  I use this approach (<a href="http://blog.elinkmedia.net.au/2010/01/24/zf-authentication-using-doctrine/comment-page-1/#comment-40" rel="nofollow">http://blog.elinkmedia.net.au/2010/01/24/zf-authentication-using-doctrine/comment-page-1/#comment-40</a>) and it works ok, maybe you could make a plugin to use it like Jon&#8217;s did in his tutorial.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jon</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5147</link>
		<dc:creator>jon</dc:creator>
		<pubDate>Mon, 01 Feb 2010 14:50:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5147</guid>
		<description>Hi there,
1. I&#039;m going to wait till the dust settles and an &quot;official&quot; approach to doing this is published.
2. I would look at Doctrine&#039;s connection documentation: http://www.doctrine-project.org/documentation/manual/1_1/e+n/connections

Hope that helps!</description>
		<content:encoded><![CDATA[<p>Hi there,<br />
1. I&#8217;m going to wait till the dust settles and an &#8220;official&#8221; approach to doing this is published.<br />
2. I would look at Doctrine&#8217;s connection documentation: <a href="http://www.doctrine-project.org/documentation/manual/1_1/e+n/connections" rel="nofollow">http://www.doctrine-project.org/documentation/manual/1_1/e+n/connections</a></p>
<p>Hope that helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Understack</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5141</link>
		<dc:creator>Understack</dc:creator>
		<pubDate>Mon, 01 Feb 2010 08:17:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5141</guid>
		<description>Hi Jon,

Thanks for putting up wonderful tutorials. 

I;ve got 2 questions:

1. I&#039;ve noticed that you said Doctrine 2.0 would support multiple &#039;modules&#039; (default/admin etc). Doctrine 2.0 Alpha has been released. Can I expect this feature in alpha release. Are you planning for a tutorial on that :) ?

2. How can I use 2 databases with Doctrine?

Thanks.</description>
		<content:encoded><![CDATA[<p>Hi Jon,</p>
<p>Thanks for putting up wonderful tutorials. </p>
<p>I;ve got 2 questions:</p>
<p>1. I&#8217;ve noticed that you said Doctrine 2.0 would support multiple &#8216;modules&#8217; (default/admin etc). Doctrine 2.0 Alpha has been released. Can I expect this feature in alpha release. Are you planning for a tutorial on that <img src='http://www.zendcasts.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ?</p>
<p>2. How can I use 2 databases with Doctrine?</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dave</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5118</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Sun, 31 Jan 2010 12:58:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5118</guid>
		<description>Hi Joe, I followed your instructions step by step, but I also received the error which is similar to martin&#039;s when trying to execute &quot;Zend_Auth::getInstance()-&gt;clearIdentity()&quot; and &quot;!Zend_Auth::getInstance()-&gt;hasIdentity()&quot;

The error says: 

Message: Zend_Session::start() - D:\Program Files\WAMP\www\zf\library\Zend\Loader.php(Line:181): Error #2 fopen(D:\Program Files\WAMP\www\zf\application/models/UserTable.php) [function.fopen]: failed to open stream: No such file or directory 


Has anyone found a solution?</description>
		<content:encoded><![CDATA[<p>Hi Joe, I followed your instructions step by step, but I also received the error which is similar to martin&#8217;s when trying to execute &#8220;Zend_Auth::getInstance()-&gt;clearIdentity()&#8221; and &#8220;!Zend_Auth::getInstance()-&gt;hasIdentity()&#8221;</p>
<p>The error says: </p>
<p>Message: Zend_Session::start() &#8211; D:\Program Files\WAMP\www\zf\library\Zend\Loader.php(Line:181): Error #2 fopen(D:\Program Files\WAMP\www\zf\application/models/UserTable.php) [function.fopen]: failed to open stream: No such file or directory </p>
<p>Has anyone found a solution?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: martin</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5086</link>
		<dc:creator>martin</dc:creator>
		<pubDate>Fri, 29 Jan 2010 17:44:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5086</guid>
		<description>Hi Jon, everything seem to be ok, but I saw when I comment this line in Zend_Auth::getInstance()-&gt;clearIdentity(); in my logout method redirection take place without problems. The same when use  if I comment (!Zend_Auth::getInstance()-&gt;hasIdentity())
to controll access in my controller. Zend_Auth is trying to write something in a wrong place. I am using routers so maybe the problem is there. I &#039;ll check it. Thank you.</description>
		<content:encoded><![CDATA[<p>Hi Jon, everything seem to be ok, but I saw when I comment this line in Zend_Auth::getInstance()-&gt;clearIdentity(); in my logout method redirection take place without problems. The same when use  if I comment (!Zend_Auth::getInstance()-&gt;hasIdentity())<br />
to controll access in my controller. Zend_Auth is trying to write something in a wrong place. I am using routers so maybe the problem is there. I &#8216;ll check it. Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jon</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5084</link>
		<dc:creator>jon</dc:creator>
		<pubDate>Fri, 29 Jan 2010 16:20:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5084</guid>
		<description>Hi martin, 
I would double check your Doctrine configuration. It sounds like for some reason there&#039;s been a flag set for generating table classes in Doctrine in addition to the models. You&#039;ll want to disable that and regenerate the base classes. You can also compare your configuration with the one on zendcasts&#039; google code site.</description>
		<content:encoded><![CDATA[<p>Hi martin,<br />
I would double check your Doctrine configuration. It sounds like for some reason there&#8217;s been a flag set for generating table classes in Doctrine in addition to the models. You&#8217;ll want to disable that and regenerate the base classes. You can also compare your configuration with the one on zendcasts&#8217; google code site.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: martin</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5083</link>
		<dc:creator>martin</dc:creator>
		<pubDate>Fri, 29 Jan 2010 16:12:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5083</guid>
		<description>Hi, a small question. I implement this in my project but using this when the user has identity in my Controller
if(Zend_Auth::getInstance()-&gt;hasIdentity()) {                
   //$this-&gt;_forward(&#039;access&#039;);
   //Instead of use forward I want to use
   $this-&gt;_redirect(&#039;/admin/access&#039;);
   //to redirect to another 
   //module/controller

}

but when I use the code above I get this error:
Zend_Session::start() - /opt/lampp/htdocs/library_1.9/Zend/Loader.php(Line:164): Error #2 fopen(/opt/lampp/htdocs/transpanish.biz/application/models/AdministradorTable.php) [function.fopen]: failed to open stream: No existe el fichero ó directorio Array 

It seems that it want to write on AdministradorTable.php This file doesn&#039;t exist only Administrador.php in my Models directory. What is happening ?
Thank you and great videos I am learning a lot.</description>
		<content:encoded><![CDATA[<p>Hi, a small question. I implement this in my project but using this when the user has identity in my Controller<br />
if(Zend_Auth::getInstance()-&gt;hasIdentity()) {<br />
   //$this-&gt;_forward(&#8216;access&#8217;);<br />
   //Instead of use forward I want to use<br />
   $this-&gt;_redirect(&#8216;/admin/access&#8217;);<br />
   //to redirect to another<br />
   //module/controller</p>
<p>}</p>
<p>but when I use the code above I get this error:<br />
Zend_Session::start() &#8211; /opt/lampp/htdocs/library_1.9/Zend/Loader.php(Line:164): Error #2 fopen(/opt/lampp/htdocs/transpanish.biz/application/models/AdministradorTable.php) [function.fopen]: failed to open stream: No existe el fichero ó directorio Array </p>
<p>It seems that it want to write on AdministradorTable.php This file doesn&#8217;t exist only Administrador.php in my Models directory. What is happening ?<br />
Thank you and great videos I am learning a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marsbomber</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5079</link>
		<dc:creator>marsbomber</dc:creator>
		<pubDate>Fri, 29 Jan 2010 05:28:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5079</guid>
		<description>Most of the time, I found myself needing authentication on a controller by controller basis. so my approach is to write myself a custom MyApp_Controller_Action class by extending the default Zend_Controller_Action. In this custom controller action class, I basically do the Zend_Auth check and other common things that you may want to do for your authentication protected controllers. Then I&#039;ll have my auth required controllers extend MyApp_Controller_Action, and those public controllers (ie, login, index, etc) extend the default Zend_Action_Controller.

Not sure if this is a good approach, but there you go.</description>
		<content:encoded><![CDATA[<p>Most of the time, I found myself needing authentication on a controller by controller basis. so my approach is to write myself a custom MyApp_Controller_Action class by extending the default Zend_Controller_Action. In this custom controller action class, I basically do the Zend_Auth check and other common things that you may want to do for your authentication protected controllers. Then I&#8217;ll have my auth required controllers extend MyApp_Controller_Action, and those public controllers (ie, login, index, etc) extend the default Zend_Action_Controller.</p>
<p>Not sure if this is a good approach, but there you go.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rhys</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5077</link>
		<dc:creator>Rhys</dc:creator>
		<pubDate>Thu, 28 Jan 2010 22:46:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5077</guid>
		<description>I&#039;ve just finished building my first ap with zend and wish I&#039;d found your site before I started building it. I reckon I&#039;ll go through the videos from the first one you made onwards to try and learn zend properly.

Cheers</description>
		<content:encoded><![CDATA[<p>I&#8217;ve just finished building my first ap with zend and wish I&#8217;d found your site before I started building it. I reckon I&#8217;ll go through the videos from the first one you made onwards to try and learn zend properly.</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jon</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5074</link>
		<dc:creator>jon</dc:creator>
		<pubDate>Thu, 28 Jan 2010 17:47:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5074</guid>
		<description>Hey David, you&#039;re quite right about the authentication being in the wrong place! In a typical application, I would have the login code redirect to a different module in my app that&#039;s protected. I would then use a Controller_Plugin to check the module and compare the module with the Zend_Auth identity to see if the person is allowed to access the module. This example strips out those layers in favour of showing the simplicity of the actual authentication code.</description>
		<content:encoded><![CDATA[<p>Hey David, you&#8217;re quite right about the authentication being in the wrong place! In a typical application, I would have the login code redirect to a different module in my app that&#8217;s protected. I would then use a Controller_Plugin to check the module and compare the module with the Zend_Auth identity to see if the person is allowed to access the module. This example strips out those layers in favour of showing the simplicity of the actual authentication code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jon</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5073</link>
		<dc:creator>jon</dc:creator>
		<pubDate>Thu, 28 Jan 2010 17:45:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5073</guid>
		<description>hey Milan,

I haven&#039;t experimented with this personally, but I would look into Doctrine&#039;s plugin architecture and specifically it&#039;s profiler:
http://www.doctrine-project.org/documentation/manual/1_0/hu/component-overview:profiler</description>
		<content:encoded><![CDATA[<p>hey Milan,</p>
<p>I haven&#8217;t experimented with this personally, but I would look into Doctrine&#8217;s plugin architecture and specifically it&#8217;s profiler:<br />
<a href="http://www.doctrine-project.org/documentation/manual/1_0/hu/component-overview:profiler" rel="nofollow">http://www.doctrine-project.org/documentation/manual/1_0/hu/component-overview:profiler</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: milan l.</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5065</link>
		<dc:creator>milan l.</dc:creator>
		<pubDate>Thu, 28 Jan 2010 08:48:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5065</guid>
		<description>Hi Jon, 
 first off all I want to say a huge thanks for zendcasts!!

And I have a small question for you. Is there any way how to set logging in this way: &quot;Every time doctrine connects to the database write how long that request took.&quot; I mean is it possible to set this thing globaly?

thanks for answer.. Milan</description>
		<content:encoded><![CDATA[<p>Hi Jon,<br />
 first off all I want to say a huge thanks for zendcasts!!</p>
<p>And I have a small question for you. Is there any way how to set logging in this way: &#8220;Every time doctrine connects to the database write how long that request took.&#8221; I mean is it possible to set this thing globaly?</p>
<p>thanks for answer.. Milan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5061</link>
		<dc:creator>David</dc:creator>
		<pubDate>Thu, 28 Jan 2010 05:00:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5061</guid>
		<description>Thanks for the clear and straight forward tutorials.

I find login is required for most controllers. For these cases the hasIdentity check and redirect can be moved from each action to a single instance in the predispatch function for that controller.

For instance:

public function preDispatch()
{
    if (!$this-&gt;Zend_Auth::getInstance()-&gt;hasIdentity()) {
        $this-&gt;_redirect(&#039;/&#039;);
    }
}

Of course it wouldn&#039;t work so well for the controller that actually handles login and needs the unauthenticated users to reach some page to enter there credentials.</description>
		<content:encoded><![CDATA[<p>Thanks for the clear and straight forward tutorials.</p>
<p>I find login is required for most controllers. For these cases the hasIdentity check and redirect can be moved from each action to a single instance in the predispatch function for that controller.</p>
<p>For instance:</p>
<p>public function preDispatch()<br />
{<br />
    if (!$this-&gt;Zend_Auth::getInstance()-&gt;hasIdentity()) {<br />
        $this-&gt;_redirect(&#8216;/&#8217;);<br />
    }<br />
}</p>
<p>Of course it wouldn&#8217;t work so well for the controller that actually handles login and needs the unauthenticated users to reach some page to enter there credentials.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BEREGU</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5060</link>
		<dc:creator>BEREGU</dc:creator>
		<pubDate>Thu, 28 Jan 2010 04:02:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5060</guid>
		<description>Very cool.... ^^</description>
		<content:encoded><![CDATA[<p>Very cool&#8230;. ^^</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://www.zendcasts.com/logging-in-users-using-doctrine-and-zend_auth/2010/01/comment-page-1/#comment-5051</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Wed, 27 Jan 2010 18:53:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.zendcasts.com/?p=305#comment-5051</guid>
		<description>Nice &amp; easy implementation</description>
		<content:encoded><![CDATA[<p>Nice &amp; easy implementation</p>
]]></content:encoded>
	</item>
</channel>
</rss>

