sfDoctrineGuardPlugin中用于创建新用户的action.class在哪里?

发布于 2024-11-18 08:01:10 字数 1069 浏览 2 评论 0原文

我为 Symfony 1.4.11 安装了 sfDoctrineGuardUser,但找不到注册用户的 action.class。我只找到 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);
    $user->setIsSuperAdmin($options['is-super-admin']);
    $user->save();

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

但这不是这个...

我找不到任何地方,例如 $user->setFirstName($arguments['first_name']);< /strong> 并修改为:

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

sfDoctrineGuardPlugin 中用于创建新用户的action.class 在哪里?

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);
    $user->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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

难如初 2024-11-25 08:01:10

基本上,您不需要该操作(或自定义它)来创建新用户。只需创建一个自定义操作来生成您的注册表单并处理帖子:

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

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();
空城仅有旧梦在 2024-11-25 08:01:10

尝试

cache\frontend\prod\modules\autoSfGuardUser\actions

或类似的东西,

如果这就是您正在寻找的内容,请不要在那里重写它!
相反,将操作复制到普通的 sfGuard 模块并在那里进行编辑

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文