简体   繁体   English

添加Joomla登录参数

[英]Add Joomla login parameters

I work with joomla 3.1, and im a newbie.. 我使用的是joomla 3.1,并且是新手。

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) -首先,使用已经可以使用电子邮件地址(例如email@domain.com)和密码生产的传统方式-其次,我想允许他们使用他们使用的电话应用程序ID(例如4456544485)和密码登录。 (与第一种方法相同)

The login system used is the com_users component. 使用的登录系统是com_users组件。 the phone application ID is in another DataBase (phoneapp) and has a email field. 电话应用程序ID在另一个数据库(phoneapp)中,并且具有电子邮件字段。

But i don't know witch file i have to edit..? 但是我不知道我必须编辑女巫文件吗?

Thank you for your help 谢谢您的帮助

Writing an authentication plugin should not be too hard http://docs.joomla.org/J3.2:Creating_an_Authentication_Plugin_for_Joomla . 编写身份验证插件应该不太麻烦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 我建议从默认的Joomla身份验证插件https://github.com/joomla/joomla-cms/blob/master/plugins/authentication/joomla/joomla.php扩展您的电话应用程序插件,例如

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);
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM