2

我设法通过向数据库添加字段并调整 xml 文件和 php 文件来编辑大部分注册表单。我什至发现了一个免费插件,它允许使用电子邮件而不是用户名登录。

但我想不出一种完全删除用户名的方法。或者至少从表单中删除它并创建一个自动用户名(用户甚至不需要看到)

我很清楚将电子邮件作为用户名插件,但希望没有它我也能做到。

4

2 回答 2

7

So this is going to be a bit tricky. Joomla doesn't allow the email to be passed to the authentication plugin so you are going to have to proxy it through the username field.

On the site, I'd create a new login module that simply changed the label of the username field to "Email". You still need to keep the name of the field as username.

Then, in the Joomla Authentication plugin, see https://github.com/joomla/joomla-cms/blob/master/plugins/authentication/joomla/joomla.php#L50

try changing that line to:

->where('email=' . $db->quote($credentials['username']));

Just try that hack for now and see if it works. If it does all you need to do is copy that plugin, with the modification, and rename it to something else (remember to restore the old code in the original plugin). Let me know how you go.

于 2013-12-20T00:27:42.510 回答
1

它不会更简单:

登记

  • 隐藏用户名字段 (CSS)

  • 保存(在创建和编辑期间),用该电子邮件的值填写用户名字段。(我不是开发人员,在这里无法提供帮助)也许,您有什么想法/建议吗?

登录

  • 使用简单的语言覆盖将“用户名”标签更改为“电子邮件”(在电子邮件和警报中相同)
于 2020-04-30T17:09:19.663 回答