<commit_before><?php

require_once dirname(__FILE__)."/pfcglobalconfig.class.php";

class pfcUserConfig
{
  var $nick;
  var $channels;
  var $privmsg;
  var $active;
  
  var $timeout;
  var $nickid;
  var $serverid;
  
  //  var $is_init = false; // used internaly to know if the chat config is initialized
  //  var $errors = array();
  
  function pfcUserConfig()
  {
    $c =& pfcGlobalConfig::Instance();

    // start the session : session is used for locking purpose and cache purpose
    session_name( "phpfreechat" );
    if(session_id() == "") session_start();

    // the nickid is a public identifier shared between all the chatters
    // this is why the session_id must not be assigned directly to the nickid
    $this->nickid = sha1(session_id());

    // user parameters are cached in sessions
    $this->_getParam("nick");
    if (!isset($this->nick)) $this->_setParam("nick",""); // setup a blank nick if it is not yet in session
    $this->_getParam("active");
    if (!isset($this->active)) $this->_setParam("active",false);   
    $this->_getParam("channels");
    if (!isset($this->channels)) $this->_setParam("channels",array());
    $this->_getParam("privmsg");
    if (!isset($this->privmsg)) $this->_setParam("privmsg",array());
    $this->_getParam("serverid");
    if (!isset($this->privmsg)) $this->_setParam("serverid",$c->serverid);
  }

  function &Instance()
  {
    static $i;
    
    if (!isset($i))
    {<commit_msg>Remove the specific session_name value. From now phpfreechat totaly share the sessions data with the whole website. This should simplify integrations. (thanks to <NAME> aka x-man for the suggestion)<commit_after><?php

require_once dirname(__FILE__)."/pfcglobalconfig.class.php";

class pfcUserConfig
{
  var $nick;
  var $channels;
  var $privmsg;
  var $active;
  
  var $timeout;
  var $nickid;
  var $serverid;
  
  //  var $is_init = false; // used internaly to know if the chat config is initialized
  //  var $errors = array();
  
  function pfcUserConfig()
  {
    $c =& pfcGlobalConfig::Instance();

    // start the session : session is used for locking purpose and cache purpose
    if(session_id() == "") session_start();

    // the nickid is a public identifier shared between all the chatters
    // this is why the session_id must not be assigned directly to the nickid
    $this->nickid = sha1(session_id());

    // user parameters are cached in sessions
    $this->_getParam("nick");
    if (!isset($this->nick)) $this->_setParam("nick",""); // setup a blank nick if it is not yet in session
    $this->_getParam("active");
    if (!isset($this->active)) $this->_setParam("active",false);   
    $this->_getParam("channels");
    if (!isset($this->channels)) $this->_setParam("channels",array());
    $this->_getParam("privmsg");
    if (!isset($this->privmsg)) $this->_setParam("privmsg",array());
    $this->_getParam("serverid");
    if (!isset($this->privmsg)) $this->_setParam("serverid",$c->serverid);
  }

  function &Instance()
  {
    static $i;
    
    if (!isset($i))
    {
{'fraction_non_alphanumeric': 0.1566383257030739, 'fraction_numerical': 0.0006540222367560497, 'mean_word_length': 3.620845921450151, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5909399', 'n_tokens_mistral': 952, 'n_tokens_neox': 934, 'n_words': 274}