【问题标题】:Remove default password value in drupal 6 password_confirm删除 drupal 6 password_confirm 中的默认密码值
【发布时间】:2013-01-16 15:52:56
【问题描述】:

我有一个电子邮件设置表单的代码,用户将输入电子邮件地址、密码等。

$form['mail_settings']['user_pass'] = array(
'#type' => 'password_confirm',
'#description' => t('your password')
);

$form['mail_settings']['user_signature'] = array(
'#type' => 'textfield'
'#description' => t('custm signature')
);

我想要实现的是让用户能够随时更改他的签名,而无需重新输入他的密码。

现在发生的情况是,每次我加载此设置页面时,密码都有一个默认值,密码确认为空白。

因此,如果用户忘记再次输入密码,表单会显示错误。或者更确切地说,它会产生一个验证错误。

这里应该做什么?

【问题讨论】:

    标签: drupal-6 password-confirmation


    【解决方案1】:

    想出了一个不同的解决方案。原来是我浏览器的密码链(保存的密码)负责在密码字段中添加默认值。

    解决方案是,如果密码字段为空:使用旧密码更新密码; else if not empty 用新密码更新密码。

    【讨论】:

      猜你喜欢
      • 2015-01-31
      • 2011-06-29
      • 1970-01-01
      • 2015-08-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-06
      相关资源
      最近更新 更多