class siteNoticiaForm extends BasesiteNoticiaForm { public function configure() { $this->setWidget('sf_guard_user_id', new sfWidgetFormInputHidden()); $this->setDefault('sf_guard_user_id', $this->getOption(sfContext::getInstance()->getUser()->getGuardUser()->getId())); unset($this['created_at'],$this['updated_at'] ); } }
i put some like this and it works!!! thanks a lot fRAnKEnSTEin!!! On Wed, Apr 14, 2010 at 8:06 AM, fRAnKEnSTEin <shirkav...@gmail.com> wrote: > Maybe this help a bit: > > Assuming the field you talk about "author field" is a select widget in > the form you can set its default value in the options section of the > widget, to get the logged user, use something like: > > class myUser extends sfGuardSecurityUser > { > public function getUserId() > { > if($this->isAuthenticated()) > return $this->getGuardUser()->getId(); //here retirns what > user is logged in > else > return 0; > } > } > > cheers > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.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 > symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > > To unsubscribe, reply using "remove me" as the subject. > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.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 symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en