Permalink
Browse files

Fixed call to undefined methods and calling method on null object

  • Loading branch information...
1 parent 9e5aa27 commit f9105bf21b9b3d77cfde69578a46f0e39e6bfdfc @mrnfrancesco mrnfrancesco committed Jun 21, 2015
@@ -120,6 +120,7 @@ public function index() {
protected function validate() {
// Check how many login attempts have been made.
+ $this->load->model('account/customer');
$login_info = $this->model_account_customer->getLoginAttempts($this->request->post['email']);
if ($login_info && ($login_info['total'] >= $this->config->get('config_login_attempts')) && strtotime('-1 hour') < strtotime($login_info['date_modified'])) {
@@ -137,9 +138,9 @@ protected function validate() {
if (!$this->affiliate->login($this->request->post['email'], $this->request->post['password'])) {
$this->error['warning'] = $this->language->get('error_login');
- $this->model_affiliate_affiliate->addLoginAttempt($this->request->post['email']);
+ $this->model_account_customer->addLoginAttempt($this->request->post['email']);
} else {
- $this->model_affiliate_affiliate->deleteLoginAttempts($this->request->post['email']);
+ $this->model_account_customer->deleteLoginAttempts($this->request->post['email']);
}
}
@@ -17,6 +17,7 @@ public function index() {
$affiliate_id = $this->model_affiliate_affiliate->addAffiliate($this->request->post);
// Clear any previous login attempts in not registered.
+ $this->load->model('account/customer');
$this->model_account_customer->deleteLoginAttempts($this->request->post['email']);
$this->affiliate->login($this->request->post['email'], $this->request->post['password']);

0 comments on commit f9105bf

Please sign in to comment.