添加Joomla登录参数 [英] Add Joomla login parameters
问题描述
我使用的是joomla 3.1,我是新手.
I work with joomla 3.1, and im a newbie..
我建议用户以两种方式进行连接. -首先采用传统的方式,该方式已经可以使用电子邮件地址(例如email@domain.com)和密码在生产环境中使用 -其次,我想允许他们使用他们使用的电话应用程序ID登录(例如4456544485)和密码(与第一种方法相同)
I would suggest users to connect in two ways. - First with the traditional way that is allready in production with Email address (like email@domain.com) and password - Second, i would like to allow them to login with the phone application ID that they use.(like 4456544485) and password(same as the first way)
使用的登录系统是com_users组件. 电话应用程序ID在另一个数据库(phoneapp)中,并且具有电子邮件字段.
The login system used is the com_users component. the phone application ID is in another DataBase (phoneapp) and has a email field.
但是我不知道我必须编辑女巫文件吗??
But i don't know witch file i have to edit..?
谢谢您的帮助
推荐答案
编写身份验证插件应该不太难 https://github.com/joomla/joomla-cms/blob/master/plugins/authentication/joomla/joomla.php 喜欢
Writing an authentication plugin should not be too hard http://docs.joomla.org/J3.2:Creating_an_Authentication_Plugin_for_Joomla. I suggest to extend then your phone app plugin from the default Joomla authentication plugin https://github.com/joomla/joomla-cms/blob/master/plugins/authentication/joomla/joomla.php like
JLoadder::import('authentication.joomla.joomla', JPATH_PLUGINS);
class PlgAuthenticationPhone extends PlgAuthenticationJoomla
{
public function onUserAuthenticate($credentials, $options, &$response)
{
// Do your authentication with the number on the other database
.....
// if it failed do the fallback to Joomla
return parent::onUserAuthenticate($credentials, $options, $response);
}
}
这篇关于添加Joomla登录参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!