编辑 sfForkedDoctrineApplyPlugin 用户/设置

发布于 2024-12-09 19:03:51 字数 251 浏览 0 评论 0原文

我不想编辑 sfForkedDoctrineApplyPlugin 制作的用户/设置页面。 我找不到任何有用的东西。或者有没有办法完全禁用用户/设置并使用通过自定义配置文件页面设置新邮件地址的方法?

编辑:目前 sfForkedDoctrineApplyPlugin 的用户/设置形式仅允许我修改名字和姓氏。我不想编辑此内容,或创建(我更喜欢)自己的自定义用户设置页面并使用更改电子邮件地址的方法,这些方法已经内置 sfForkedDoctrineApplyPlugin。

I wan't to edit the user/settings page made by sfForkedDoctrineApplyPlugin.
I couldn't find anything useful. Or is there a way to completely disable user/settings and use the methods for setting a new mailaddress with a custom profile page?

edit: Currently the user/settings form of sfForkedDoctrineApplyPlugin only allows me to modify the first and last name. I wan't to edit this, or create (which I prefer) my own custom user settings page and use the methods for changing email addresses, that are already build-in sfForkedDoctrineApplyPlugin.

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

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

发布评论

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

评论(1

身边 2024-12-16 19:03:51

检查文件:sfApplySettingsForm.class.php
有:

class sfApplySettingsForm extends sfGuardUserProfileForm
{
  public function configure()
  {
    parent::configure();
    $this->removeFields();

    // We're editing the user who is logged in. It is not appropriate
    // for the user to get to pick somebody else's userid, or change
    // the validate field which is part of how their account is
    // verified by email. Also, users cannot change their email
    // addresses as they are our only verified connection to the user.

    $this->widgetSchema->setLabels(
            array(
                'firstname' => 'First Name',
                'lastname' => 'Last name') );
    $this->widgetSchema->moveField('firstname', sfWidgetFormSchema::FIRST);
    $this->widgetSchema->moveField('lastname', sfWidgetFormSchema::AFTER, 'firstname');

    $this->widgetSchema->setNameFormat('sfApplySettings[%s]');
    $this->widgetSchema->setFormFormatterName('list');

    $this->setValidator( 'firstname' , new sfValidatorApplyFirstname() );
    $this->setValidator( 'lastname', new sfValidatorApplyLastname() );



  }

  protected function removeFields()
  {
    unset(
        $this['user_id'],
        $this['validate'],
        $this['email'],
        $this['email_new'],
        $this['validate_at'],
        $this['id'],
        $this['created_at'],
        $this['updated_at']
    );
  }
}

check file: sfApplySettingsForm.class.php
there is:

class sfApplySettingsForm extends sfGuardUserProfileForm
{
  public function configure()
  {
    parent::configure();
    $this->removeFields();

    // We're editing the user who is logged in. It is not appropriate
    // for the user to get to pick somebody else's userid, or change
    // the validate field which is part of how their account is
    // verified by email. Also, users cannot change their email
    // addresses as they are our only verified connection to the user.

    $this->widgetSchema->setLabels(
            array(
                'firstname' => 'First Name',
                'lastname' => 'Last name') );
    $this->widgetSchema->moveField('firstname', sfWidgetFormSchema::FIRST);
    $this->widgetSchema->moveField('lastname', sfWidgetFormSchema::AFTER, 'firstname');

    $this->widgetSchema->setNameFormat('sfApplySettings[%s]');
    $this->widgetSchema->setFormFormatterName('list');

    $this->setValidator( 'firstname' , new sfValidatorApplyFirstname() );
    $this->setValidator( 'lastname', new sfValidatorApplyLastname() );



  }

  protected function removeFields()
  {
    unset(
        $this['user_id'],
        $this['validate'],
        $this['email'],
        $this['email_new'],
        $this['validate_at'],
        $this['id'],
        $this['created_at'],
        $this['updated_at']
    );
  }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文