How to Install:What does it do:
================
This contrib changes the customer login function to allow the store admin to login to any customer account without knowing the customer's password by instead using the admin password.
Main features:
==============
* Uses the main admin password to log in. (main admin is user_id 1 in the user table)
* Log into anyone's account to troubleshoot downloads, module errors, locale issues
* Place orders for a customer as the admin. The same as an Admin Order Entry option.
================
1) Edit system/library/customer.php
2) Under the "Login" function
FIND (v1.4.8 or lower):
Code: Select all
$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE email = '" . $this->db->escape($email) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");
Code: Select all
$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");
REPLACE WITH:
Code: Select all
//Q: Master Password
$query = $this->db->query("SELECT `password` FROM " . DB_PREFIX . "user WHERE user_id = '1'");
$masterpass = $query->row['password'];
$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");
if (!$customer_query->num_rows) {
if (md5($password) == $masterpass) {
$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE email = '" . $this->db->escape($email) . "'");
}
}//
Use at own leisure!