我無法設置電子郵件在我的網站上執行登錄。我創建一個插件認證,以取代舊,我改變SQL查詢來選擇ID和密碼:用電子郵件作爲用戶名登錄joomla 3.4
$query = $db->getQuery(true)
->select('id, password')
->from('#__users')
->where('**email**=' . $db->quote($credentials['username']));
我也試過如下修改login.xml
:
<field name="username"
type="email"
class="validate-email"
filter="email"
label="COM_USERS_LOGIN_EMAIL_LABEL"
size="25"
required="true"
validate="email"
/>
當我嘗試登錄我得到:
You can't access to the private section of the site
有人可以幫我嗎?
您是否檢查過$ credentials ['username']'和'$ credentials'中包含的內容? – dhh
我做了憑證數組的回顯,它包含了郵件和密碼。也許在服務器端驗證有問題? –
我偏袒解決....我重寫了控制器user.php獲取郵件中的用戶名從郵件傳遞與查詢MySQL的形式。但現在登錄後,我曾經重定向到家...在重定向工作正常之前工作正常頁面...如何工作返回網址? –