2016-06-18 49 views
-1

設置密碼我有問題在離子驗證,版本退出用戶設置密碼:2.5.2,笨:3.1.0-dev的線程模式出現問題,在離子退出用戶驗證

在應用程序/配置/ ion_auth。 PHP的我都默認:

$config['hash_method'] = 'bcrypt'; // sha1 or bcrypt, bcrypt is STRONGLY recommended 
$config['default_rounds'] = 8;  // This does not apply if random_rounds is set to true 
$config['random_rounds'] = FALSE; 
$config['min_rounds']  = 5; 
$config['max_rounds']  = 9; 
$config['salt_prefix'] = '$2y$'; 

$config['default_group']    = 'Members';   // Default group, use name 
$config['admin_group']    = 'Admin';    // Default administrators group, use name 
$config['identity']     = 'email';    // A database column which is used to login with 
$config['min_password_length']  = 6;     // Minimum Required Length of Password 
$config['max_password_length']  = 20;     // Maximum Allowed Length of Password 
$config['email_activation']   = FALSE;    // Email Activation for registration 
$config['manual_activation']   = FALSE;    // Manual Activation for registration 
$config['remember_users']    = TRUE;    // Allow users to be remembered and enable auto-login 
//$config['user_expire']    = 986500;    // How long to remember the user (seconds). Set to zero for no expiration 
$config['user_expire']    = 0;    // How long to remember the user (seconds). Set to zero for no expiration 
$config['user_extend_on_login']  = TRUE;    // Extend the users cookies every time they auto-login 
$config['track_login_attempts']  = FALSE;    // Track the number of failed login attempts for each user or ip. 
$config['track_login_ip_address']  = TRUE;    // Track login attempts by IP Address, if FALSE will track based on identity. (Default: TRUE) 
$config['maximum_login_attempts']  = 3;     // The maximum number of failed login attempts. 
$config['lockout_time']    = 600;     // The number of seconds to lockout an account due to exceeded attempts 
$config['forgot_password_expiration'] = 0;     // The number of milliseconds after which a forgot password request will expire. If 

在我控制我運行:

$OkResult = $this->ion_auth_model->reset_password($lUserOperator['email'], $GeneratePassword) ; 
    AppUtils::deb($OkResult, '$OkResult::'); 

其中$GeneratePassword是字符串如'JKC3vmci'$lUserOperator['email']是一個有效的電子郵件ctive用戶,返回值的值OkResult = 1

查看db的更新用戶我看到密碼值,如'$2y$08$vyeSO30G4eQL3efuYbNii.VAlayDrAslKQNMDkdLYegggcsLWsQbe'和salt字段是empty string(not NULL)。但我無法登錄到系統,但我在通常的登錄下登錄正常。什麼可能是問題的原因?

而且revieing ion_auth我像post_change_passwordpost_change_password ...

您能給裁判使用此事件的例子reset_password功能觸發事件看到的代碼?

回答

1

在我控制我運行:

$OkResult = $this->ion_auth_model->reset_password(... 

你爲什麼打電話直接ion_auth_model

這是不必要的,可能是您的麻煩的原因,因爲您繞過了Ion Auth的大部分關鍵邏輯。

the developer's documentation

注意:在模型中可用的方法是通過使用PHP5魔術控制器調用。您應該在您的應用中從不使用ion_auth_model->method()


開發商已經提供了,你可以在你的項目中的任何地方使用許多相關的功能。要更新任何用戶的賬戶,包括重置其密碼時,你會更新是否成功,如果false不使用the update() class ...

$id = 12; // <- Existing user's ID 
$data = array(
    'password' => '123456789', // <- NEW password 
); 
$this->ion_auth->update($id, $data); // <- Update the user's account 

update()回報true

如果您不知道用戶的id,那麼您只需在"users"表上執行標準數據庫查詢即可根據電子郵件地址檢索其id

請問參考使用這個事件的例子嗎?

見documenation:benedmunds.com/ion_auth