Skip to content

Commit

Permalink
Fixed call to undefined methods and calling method on null object
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnfrancesco committed Jun 21, 2015
1 parent 9e5aa27 commit f9105bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions upload/catalog/controller/affiliate/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand All @@ -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']);
}
}

Expand Down
1 change: 1 addition & 0 deletions upload/catalog/controller/affiliate/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit f9105bf

Please sign in to comment.