I have de same proble please help me, the example line is
if ($this->id_employee AND Validate::isUnsignedId($this->id_employee) AND Employee::checkPassword(intval($this->id_employee), $this->passwd) AND (!isset($this->_content['remote_addr']) OR $this->_content['remote_addr'] == ip2long(Tools::getRemoteAddr())))
but my line is a little diferent like this
if ($this->id_employee AND Validate::isUnsignedId($this->id_employee) AND Employee::checkPassword(intval($this->id_employee), $this->passwd) AND (!isset($this->_content['remote_addr']) OR $this->_content['remote_addr'] == ip2long($_SERVER['REMOTE_ADDR'])))
I'm from argentina please help my code, How should be?
function __set($key, $value)
{
if (is_array($value))
die(Tools::displayError());
if (preg_match('/¤|\|/', $key) OR preg_match('/¤|\|/', $value))
throw new Exception('Forbidden chars in cookie');
$this->_content[$key] = $value;
$this->write();
}
/**
* Magic method wich delete data into _content array
*
* @param $key key wanted
*/
function __unset($key)
{
unset($this->_content[$key]);
$this->write();
}
/**
* Check customer informations saved into cookie and return customer validity
*
* @return boolean customer validity
*/
function isLogged()
{
/* Customer is valid only if it can be load and if cookie password is the same as database one */
if ($this->logged == 1 AND $this->id_customer AND Validate::isUnsignedId($this->id_customer) AND Customer::checkPassword(intval($this->id_customer), $this->passwd))
return true;
return false;
}
/**
* Check employee informations saved into cookie and return employee validity
*
* @return boolean employee validity
*/
function isLoggedBack()
{
/* Employee is valid only if it can be load and if cookie password is the same as database one */
if ($this->id_employee AND Validate::isUnsignedId($this->id_employee) AND Employee::checkPassword(intval($this->id_employee), $this->passwd) AND (!isset($this->_content['remote_addr']) OR $this->_content['remote_addr'] == ip2long($_SERVER['REMOTE_ADDR'])))
return true;
return false;
}
/**
* Delete cookie
*/
function logout()
{
$this->_content = array();
$this->_setcookie();
unset($_COOKIE[$this->_name]);
}