简体   繁体   中英

Add Joomla login parameters

I work with joomla 3.1, and im a newbie..

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)

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..?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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