Thanks sounds good :) Thanks Tom...
One more thing... Is it advised not to store objects in the session as attributes...so will I need to store all the fields as individual attributes? :| I mean, isn't it tedious, as we go on increasing the fields in user profile? On Aug 19, 5:46 pm, Tom Haskins-Vaughan <[EMAIL PROTECTED]> wrote: > Here's a simple example: > > 1. create you're User table with the columns you want > > 2. build your model > > 3. in the myUser class define proxy methods set and retrieve > the data from your User model objects: > > // in myUser.class.php > class myUser extends sfBasicSecurityUser > { > protected function getUser() > { > return UserPeer::retrieveByPk($this->getUserId()); > } > > public function signIn($user) > { > $this->setAttribute('user_id', $user->getId(), 'user'); > $this->setAuthenticated(true); > } > > public function getUserId() > { > return $this->getAttribute('user_id', '', 'user'); > } > > public function getFirstname() > { > return $this->getUser()->getFirstname(); > } > > public function signOut() > { > $this->getAttributeHolder()->removeNamespace('user'); > $this->setAuthenticated(false); > } > } > > Now in your templates you can use: > > Welcome back, <?php echo $sf_user->getFirstname() ?>, how are you? > > HTH > > Tom > > > > Sumedh wrote: > > Ok... > > > I think using sfGuard would be an overkill as of now... > > > If I simply want to - > > > 1. Create a user table and define some columns in it... > > > 2. Access this session data in actions and templates through $this- > >> getUser() method. > > > How do I do this? > > > If I simply create a UserPeer just as I do for other tables, and store > > it as an attribute in $this->getUser() object, will it be the right > > way to do this? > > > I saw that the documentation advises against storing propel objects in > > this session object...how do I do it then? > > > I saw there is a class sfBasicSecurityUser...what is it used for? I > > didn't find any mention of it in the documentation... > > > On Aug 19, 10:34 am, Dennis Benkert <[EMAIL PROTECTED]> > > wrote: > >> On 18 Aug., 14:21, Sumedh <[EMAIL PROTECTED]> wrote: > > >>> Anyone? :( > >>> I am really confused if I should use this plugin or do my own simple > >>> thing... > >>> Right now I am grappling with issues...just trying to figure out where > >>> is the code that compares user supplied credentials with DB data and > >>> decides this is a correct login...the executeSignin doesn't seem to > >>> have any code for this ??? :| > >> You'll find it in one of the validators bundeled with sfGuardPlugin. > > >>> If I want to do my own simple thing, how can I make the $this->getUser() > >>> object to point to a new object I'll create (that'll map to > >>> the new users table I'll create)? > >> maybe i misunderstand you but you can find it in your myUser class or > >> in the sfGuardSecurityUser class. Maybe take a closer look at the > >> sfGuardSecurityUser class. I think it bundles methods to log a user in > >> by hand. > > >> - Dennis > > -- > Tom Haskins-Vaughan > Temple Street Media: Design and Development for the Web > [EMAIL PROTECTED] |www.templestreetmedia.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---