Example #1
0
 /**
  * setSessionHash - set session hash
  */
 public function setSessionHash()
 {
     $random = str_random(64);
     $this->cookie->set('ls', $random);
     $login_hash = $this->generate_password_hash(AUTH_KEY . $random . LhpBrowser::getUserAgent());
     $this->set("session_id", $login_hash);
     return $login_hash;
 }
Example #2
0
 /**
  * check_tokens - Check md5 hash token for form validation
  */
 public function check_tokens(&$cookie, &$user)
 {
     if ($this->get('action') == 'save' && !$user->getBypass()) {
         return LhpBrowser::getRequestMethod() == 'post' && ($cookie->get('SESSIONID') !== null && $this->get('token') == md5(LhpBrowser::getUserAgent() . FORM_KEY . $cookie->get('SESSIONID') . $this->get('token_hash')) || $user->getBypass());
     } else {
         return true;
     }
 }