开发者

Where is the action.class in sfDoctrineGuardPlugin for create new user?

I installed sfDoctrineGuardUser for Symfony 1.4.11, but I can't find the action.class, where register user. I find only class sfGuardCreateUserTask :

  protected function execute($arguments = array(), $options = array())
  {
    $databaseManager = new sfDatabaseManager($this->configuration);

    $user = new sfGuardUser();
    $user->setEmailAddress($arguments['email_address']);
    $user->setUsername($arguments['username']);
    $user->setPassword($arguments['password']);
    $user->setFirstName($arguments['first_name']);
    $user->setLastName($arguments['last_name']);
    $user->setIsActive(true);
    $u开发者_C百科ser->setIsSuperAdmin($options['is-super-admin']);
    $user->save();

    $this->logSection('guard', sprintf('Create user "%s"', $arguments['username']));
  }

but this isn't this...

I can't find anywhere for example $user->setFirstName($arguments['first_name']); and modified to:

$user->setFirstName($arguments['first_name'] . '@');

Where is the action.class in sfDoctrineGuardPlugin for create new user?


Basically, you don't need that action (or to customize it) in order to create new users. Just create a custom action that generates your registration form and handles the post:

$user = new sfGuardUser();
$user-> // manipulate however you like
$user->save();


try

cache\frontend\prod\modules\autoSfGuardUser\actions

or something similar

if this is what you're looking for, don't rewrite it in there!! Instead, copy the action to your normal sfGuard module and edit it there


Everything you need is already published by the symfony team :

  • http://symfony.com/blog/call-the-expert-simple-registration-with-sfdoctrineguardplugin
  • for further information : http://symfony.com/blog/call-the-expert-customizing-sfdoctrineguardplugin
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜