如何在Joomla 3.x中将邮件设置为用户名? [英] How do I set email as username in Joomla 3.x?

查看:133
本文介绍了如何在Joomla 3.x中将邮件设置为用户名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I managed to edit most of the registration form by adding fields to the database and tweaking the xml files and the php files. I even found a free plugin that allows login with an email and not the username.

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

But I can't figure out a way to remove the username entirely. or at least remove it from the form and creating an automatic username (that the user doesn't even really needs to see ever)

我很清楚< a href =http://ideas.joomla.org/forums/84261-joomla-idea-pool/suggestions/2226083-remove-username-field-since-email-must-be-unique =nofollow>电子邮件作为用户名插件,但希望我可以做到没有它。

I'm well aware of the Email as Username plugin but hope I can do it without it.

推荐答案

所以这将是一个棘手。 Joomla不允许将电子邮件传递给身份验证插件,因此您将不得不通过用户名字段进行代理。

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.

在网站上,我将创建一个新的登录模块,只需将用户名字段的标签更改为电子邮件。您仍然需要将该字段的名称保留为 username

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.

然后,在Joomla验证插件中, https://github.com/joomla/joomla-cms/ blob / master / plugins / authentication / joomla / joomla.php#L50

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

尝试将该行更改为:

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

现在就尝试这个hack,看看它是否有效。如果它做的所有你需要做的是复制该插件,修改,并将其重命名为别的东西(记住要恢复原始插件中的旧代码)。让我知道你怎么走。

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.

这篇关于如何在Joomla 3.x中将邮件设置为用户名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆