// removing cookie from product customization
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7680 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -94,10 +94,16 @@ class CustomerCore extends ObjectModel
|
||||
public $days;
|
||||
public $months;
|
||||
|
||||
/** @var int customer id_country as determined by geolocation */
|
||||
public $geoloc_id_country;
|
||||
/** @var int customer id_state as determined by geolocation */
|
||||
public $geoloc_id_state;
|
||||
/** @var string customer postcode as determined by geolocation */
|
||||
public $geoloc_postcode;
|
||||
|
||||
/** @var boolean is the customer logged in */
|
||||
public $logged = 0;
|
||||
|
||||
protected $tables = array ('customer');
|
||||
|
||||
protected $fieldsRequired = array('lastname', 'passwd', 'firstname', 'email');
|
||||
@@ -712,4 +718,22 @@ class CustomerCore extends ObjectModel
|
||||
$this->passwd = Tools::encrypt($passwd);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check customer informations and return customer validity
|
||||
*
|
||||
* @parma boolean $withGuest
|
||||
* @return boolean customer validity
|
||||
*/
|
||||
public function isLogged($withGuest = false)
|
||||
{
|
||||
if (!$withGuest AND $this->is_guest == 1)
|
||||
return false;
|
||||
|
||||
/* Customer is valid only if it can be load and if object password is the same as database one */
|
||||
if ($this->logged == 1 AND $this->id AND Validate::isUnsignedId($this->id) AND self::checkPassword($this->id, $this->passwd))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user