60 $this->_model = $model;
70 $this->_sessionNamespace = $namespace;
80 $this->_fields = $fields;
90 protected function _check($username, $password)
93 if (strpos($_SERVER[
'HTTP_REFERER'], $_SERVER[
'HTTP_HOST']) === FALSE) {
94 self::log(
'INTENTO HACK IP ' . $_SERVER[
'HTTP_REFERER']);
100 $password = hash($this->_algos, $password);
102 $username = filter_var($username, FILTER_SANITIZE_MAGIC_QUOTES);
105 if ($user = $Model->find_first(
"$this->_login = '$username' AND $this->_pass = '$password'")) {
107 foreach ($this->_fields as $field) {
108 Session::set($field, $user->$field, $this->_sessionNamespace);