2013-12-09 46 views
0

我與joomla 3.1一起工作,我是一個新手..添加Joomla登錄參數

我建議用戶以兩種方式連接。 - 首先使用電子郵件地址(例如[email protected])和密碼 生產的傳統方式 - 第二,我想允許他們使用他們使用的電話應用程序ID登錄(如4456544485)和密碼(與第一種方式相同)

使用的登錄系統是com_users組件。 手機應用程序ID在另一個數據庫(phoneapp)中,並且有一個電子郵件字段。

但我不知道女巫文件我必須編輯..?

謝謝您的幫助

+0

而是然後編輯核心文件,我可以告訴你,會導致戲,嘗試尋找有關的Joomla擴展目錄的擴展。如果你編輯核心文件,升級到Joomla 3.2將刪除所有的更改 – Lodder

+0

謝謝你的答案,我在擴展目錄中搜索,但沒有結果:( – Mazeltov

+0

在這種情況下,你將不得不編寫一個插件。看看@ Laoneo的答案,下面會讓你開始吧 – Lodder

回答

0

編寫驗證插件應該不會太難http://docs.joomla.org/J3.2:Creating_an_Authentication_Plugin_for_Joomla。我建議從默認的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); 
    } 
} 
+0

謝謝,我要看看這個:) – Mazeltov