OpenCart 🇺🇦

Схема

public mixed login ( $email, $password )

Аргументы

Аргумент Возможный тип Описание
$email
$password

Описание

Метод пока еще не документирован.

Исходный код

$affiliate_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "affiliate WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "' AND (password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, SHA1('" . $this->db->escape($password) . "'))))) OR password = '" . $this->db->escape(md5($password)) . "') AND status = '1' AND approved = '1'");

if ($affiliate_query->num_rows) {
	$this->session->data['affiliate_id'] = $affiliate_query->row['affiliate_id'];	

	$this->affiliate_id = $affiliate_query->row['affiliate_id'];
	$this->firstname = $affiliate_query->row['firstname'];
	$this->lastname = $affiliate_query->row['lastname'];
	$this->email = $affiliate_query->row['email'];
	$this->telephone = $affiliate_query->row['telephone'];
	$this->fax = $affiliate_query->row['fax'];
	$this->code = $affiliate_query->row['code'];

	return true;
} else {
	return false;
}