drupal 隐藏非管理员用户的帐户电子邮件和密码更改
有没有办法阻止用户在注册后更改密码/电子邮件/用户名?
is there a way to block from user to change his password/email / username after he signed up?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
标准 Drupal 安装可以防止更改用户名,而无需添加任何额外的模块。
防止更改密码可能是一个很少被请求的功能;我从未听说过有这样的模块。
我这样做的方法是编写一个小模块,使用 hook_form_alter 来修改表单,并删除这些字段。您还需要弄清楚如何形成丢失密码功能的链接,并从适当的模板中编辑它们。通过搜索代码,您应该很容易找到这一点;如果模板文件位于 /modules 目录中,请务必将它们复制到主题目录中并刷新主题缓存。
以下是使用 hook_form_alter 的教程:http://www.lullabot。 com/articles/modifying-forms-drupal-5-and-6
请注意 Bedir 此处关于使用 #access 来防止表单元素包含在表单中的评论。
A standard Drupal install can prevent changing username, without adding any extra modules.
Preventing change of password is probably a rather rarely-requested feature; I've never heard of a module that does that.
The way I would do this would be to write a small module that uses hook_form_alter to modify the form, and remove these fields. You would also need to figure out how links to the lost password feature are formed, and edit them out of the appropriate template. This you should find easily enough by searching through the code; if the template files are located in the /modules directory, be sure to copy them into your theme directory and refresh your theme cache.
Here's a tutorial for using hook_form_alter: http://www.lullabot.com/articles/modifying-forms-drupal-5-and-6
Note Bedir's comment here about use of #access to prevent form elements from being included in the form.