// 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:
tDidierjean
2011-07-21 14:38:04 +00:00
parent ff2df3e3b3
commit 462c362191
48 changed files with 421 additions and 348 deletions
+24
View File
@@ -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;
}
}