OpenCart

Класс Affiliate { ... }

Название свойства Описание
Affiliate::$affiliate_id private mixed $affiliate_id
Affiliate::$firstname private mixed $firstname
Affiliate::$lastname private mixed $lastname
Affiliate::$email private mixed $email
Affiliate::$telephone private mixed $telephone
Affiliate::$fax private mixed $fax
Affiliate::$code private mixed $code
Тип Возвр. Описание
public mixed __construct ( $registry )
Исходный код метода:
$this->config = $registry->get('config');
$this->db = $registry->get('db');
$this->request = $registry->get('request');
$this->session = $registry->get('session');

if (isset($this->session->data['affiliate_id'])) { 
	$affiliate_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "affiliate WHERE affiliate_id = '" . (int)$this->session->data['affiliate_id'] . "' AND status = '1'");

	if ($affiliate_query->num_rows) {
		$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'];

		$this->db->query("UPDATE " . DB_PREFIX . "affiliate SET ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "' WHERE affiliate_id = '" . (int)$this->session->data['affiliate_id'] . "'");
	} else {
		$this->logout();
	}
}
public mixed login ( $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;
}
public mixed logout ( )
Исходный код метода:
unset($this->session->data['affiliate_id']);

$this->affiliate_id = '';
$this->firstname = '';
$this->lastname = '';
$this->email = '';
$this->telephone = '';
$this->fax = '';
public mixed isLogged ( )
Исходный код метода:
return $this->affiliate_id;
public mixed getId ( )
Исходный код метода:
return $this->affiliate_id;
public mixed getFirstName ( )
Исходный код метода:
return $this->firstname;
public mixed getLastName ( )
Исходный код метода:
return $this->lastname;
public mixed getEmail ( )
Исходный код метода:
return $this->email;
public mixed getTelephone ( )
Исходный код метода:
return $this->telephone;
public mixed getFax ( )
Исходный код метода:
return $this->fax;
public mixed getCode ( )
Исходный код метода:
return $this->code;

Связанные классы:

Название класса Роль
class DB { ... } Компонент Db используется в данном классе
class Request { ... } Компонент Request используется в данном классе
class Session { ... } Компонент Session используется в данном классе

Комментарии