Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-05-2007, 02:19 AM
Member
 
Join Date: Jun 2007
Posts: 33
Default Question about retrieving identity information

This is what I'm using to write the data after a user is logged in:

Code:
//$auth is this -> $auth = Zend_Auth::getInstance();
$data = $authAdapter->getResultRowObject(null,'password');
$auth->setStorage()->write($data);
I understand that it uses sessions to write the data, but how do i get it back to read it?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-05-2007, 04:21 AM
Member
 
Join Date: Jun 2007
Posts: 33
Default

I think I figured it out. You can use:
$store = $auth->getStorage();
$store is an object, so you can then do:
$values = store->read();

$values is then an array of the values.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-05-2007, 04:58 AM
Member
 
Join Date: Jun 2007
Posts: 33
Default

Ok, not quite as clever as I thought. I can't seem to figure out how to get the $auth back on the other pages.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-05-2007, 05:49 AM
SpotSec's Avatar
Senior Member
 
Join Date: Feb 2007
Location: United States
Posts: 116
Default

have a look at $auth->getIdentity();
by the way, $auth->getStorage()->write() isn't a exactly the easiest or cleanest way to do that...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-05-2007, 06:26 PM
Member
 
Join Date: Jun 2007
Posts: 33
Default

It's a little cryptic to me, in the API manual it says of getIdentity(): Returns the identity from storage or null if no identity is available

Does that mean it returns what was passed to it? In my case being the array of values?

I think my confusion comes from my programming in .Net, where they have a similar thing to this, but when you check the identity it returns the ID only of the user.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:43 PM.