includes/sessions.php
changeset 782 96848f04bbba
parent 776 f37b60d393bc
child 801 eb8b23f11744
equal deleted inserted replaced
781:93a61032d33d 782:96848f04bbba
  1005     }
  1005     }
  1006     $this->user_id = 1;
  1006     $this->user_id = 1;
  1007     // This is a VERY special case we are allowing. It lets the installer create languages using the Enano API.
  1007     // This is a VERY special case we are allowing. It lets the installer create languages using the Enano API.
  1008     if ( !defined('ENANO_ALLOW_LOAD_NOLANG') )
  1008     if ( !defined('ENANO_ALLOW_LOAD_NOLANG') )
  1009     {
  1009     {
  1010       $language = ( isset($_GET['lang']) && preg_match('/^[a-z0-9_]+$/', @$_GET['lang']) ) ? $_GET['lang'] : intval(getConfig('default_language'));
  1010       $language = ( isset($_GET['lang']) && preg_match('/^[a-z0-9-_]+$/', @$_GET['lang']) ) ? $_GET['lang'] : intval(getConfig('default_language'));
  1011       $lang = new Language($language);
  1011       $lang = new Language($language);
  1012       @setlocale(LC_ALL, $lang->lang_code);
  1012       @setlocale(LC_ALL, $lang->lang_code);
  1013     }
  1013     }
  1014     // make a CSRF token
  1014     // make a CSRF token
  1015     $this->csrf_token = sha1($_SERVER['REMOTE_ADDR'] . sha1($this->private_key));
  1015     $this->csrf_token = sha1($_SERVER['REMOTE_ADDR'] . sha1($this->private_key));