Skip to content

Commit

Permalink
Merge pull request #10172 from prabhatkumaroc082/fix-maintenance
Browse files Browse the repository at this point in the history
Fixed multiple IP issue of login attempts
  • Loading branch information
WebkulOpencart committed Aug 25, 2021
2 parents 8c06097 + fc42c7d commit 8b4144e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion upload/admin/model/user/user.php
Expand Up @@ -107,7 +107,7 @@ public function getTotalUsersByEmail($email) {
}

public function addLoginAttempt($username) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer_login WHERE email = '" . $this->db->escape(utf8_strtolower((string)$username)) . "' AND ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "'");
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer_login WHERE email = '" . $this->db->escape(utf8_strtolower((string)$username)) . "'");

if (!$query->num_rows) {
$this->db->query("INSERT INTO " . DB_PREFIX . "customer_login SET email = '" . $this->db->escape(utf8_strtolower((string)$username)) . "', ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "', total = 1, date_added = '" . $this->db->escape(date('Y-m-d H:i:s')) . "', date_modified = '" . $this->db->escape(date('Y-m-d H:i:s')) . "'");
Expand Down
2 changes: 1 addition & 1 deletion upload/catalog/model/account/customer.php
Expand Up @@ -107,7 +107,7 @@ public function getIps($customer_id) {
}

public function addLoginAttempt($email) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer_login WHERE email = '" . $this->db->escape(utf8_strtolower((string)$email)) . "' AND ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "'");
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer_login WHERE email = '" . $this->db->escape(utf8_strtolower((string)$email)) . "'");

if (!$query->num_rows) {
$this->db->query("INSERT INTO " . DB_PREFIX . "customer_login SET email = '" . $this->db->escape(utf8_strtolower((string)$email)) . "', ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "', total = 1, date_added = '" . $this->db->escape(date('Y-m-d H:i:s')) . "', date_modified = '" . $this->db->escape(date('Y-m-d H:i:s')) . "'");
Expand Down

0 comments on commit 8b4144e

Please sign in to comment.