includes/sessions.php
changeset 557 26479224936a
parent 556 63e131c38876
child 568 3700f7124c2b
equal deleted inserted replaced
556:63e131c38876 557:26479224936a
  1247     {
  1247     {
  1248       $language = ( isset($_GET['lang']) && preg_match('/^[a-z0-9_]+$/', @$_GET['lang']) ) ? $_GET['lang'] : intval(getConfig('default_language'));
  1248       $language = ( isset($_GET['lang']) && preg_match('/^[a-z0-9_]+$/', @$_GET['lang']) ) ? $_GET['lang'] : intval(getConfig('default_language'));
  1249       $lang = new Language($language);
  1249       $lang = new Language($language);
  1250       @setlocale(LC_ALL, $lang->lang_code);
  1250       @setlocale(LC_ALL, $lang->lang_code);
  1251     }
  1251     }
       
  1252     // make a CSRF token
       
  1253     $this->csrf_token = sha1($_SERVER['REMOTE_ADDR'] . sha1($this->private_key));
  1252   }
  1254   }
  1253   
  1255   
  1254   /**
  1256   /**
  1255    * Validates a session key, and returns the userdata associated with the key or false
  1257    * Validates a session key, and returns the userdata associated with the key or false
  1256    * @param string $key The session key to validate
  1258    * @param string $key The session key to validate