/** * CONSTRUCTOR * * @return @e void */ public function __construct() { $this->registry = ipsRegistry::instance(); $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->lang = $this->registry->getClass('class_localization'); ipsRegistry::getClass('class_localization')->loadLanguageFile(array('public_lang'), 'syncApp'); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); $sqlPassed = FALSE; $classname = "db_driver_Mysql"; $sync_DB = new $classname(); $sync_DB->obj['sql_database'] = $this->settings['syncapp_realm_database']; $sync_DB->obj['sql_user'] = $this->settings['syncapp_mysql_user']; $sync_DB->obj['sql_pass'] = $this->settings['syncapp_mysql_password']; $sync_DB->obj['sql_host'] = $this->settings['syncapp_mysql_ip']; $sync_DB->return_die = true; if (!$sync_DB->connect()) { $fail = 1; return $fail; /* At this point we dont have a connection so ABORT! else database driver error */ } if ($this->settings['syncapp_mysql_user'] || $this->settings['syncapp_mysql_password'] || $fail != 1) { $this->sqlPassed = TRUE; $this->registry->dbFunctions()->setDB('mysql', 'auth_DB', array('sql_database' => $this->settings['syncapp_realm_database'], 'sql_user' => $this->settings['syncapp_mysql_user'], 'sql_pass' => $this->settings['syncapp_mysql_password'], 'sql_host' => $this->settings['syncapp_mysql_ip'])); } else { return; } }
/** * Constructor * * @access public * @param object Registry object * @return void */ public function __construct(ipsRegistry $registry) { /* Make object */ $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); }
/** * Method constructor * * @return @e void */ public function __construct() { /* Make object */ $this->registry = ipsRegistry::instance(); $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); }
/** * CONSTRUCTOR * * @param object Registry * @return @e void */ public function __construct(ipsRegistry $registry) { /* Make registry objects */ $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->lang = $this->registry->getClass('class_localization'); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); }
/** * Constructor * * @param object $registry Registry object * @return @e void */ public function __construct(ipsRegistry $registry) { /* Make object */ $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->lang = $this->registry->getClass('class_localization'); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); //----------------------------------------- // Need to reset? //----------------------------------------- if ($this->memberData['msg_count_reset']) { $this->memberData['pconversation_filters'] = $this->resetMembersFolderCounts($this->memberData['member_id']); $this->resetMembersTotalTopicCount($this->memberData['member_id']); $this->resetMembersNewTopicCount($this->memberData['member_id']); } /* Load parser */ $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser'); $this->Parser = new $classToLoad(); /* Set up parser */ $this->Parser->set(array('memberData' => $this->memberData, 'parseBBCode' => 1, 'parseArea' => 'pms', 'parseHtml' => 0, 'parseEmoticons' => 1)); //----------------------------------------- // INIT Folder contents //----------------------------------------- $folderContents = array(); //----------------------------------------- // Do a little set up, do a litle dance, get // down tonight! *boogie* //----------------------------------------- $this->_dirData = $this->explodeFolderData($this->memberData['pconversation_filters']); //----------------------------------------- // Do we have VID? // No, it's just the way we walk! Haha, etc. //----------------------------------------- if ($this->request['folderID'] and $this->request['folderID']) { $this->_currentFolderID = $this->request['folderID']; } else { /* Got any new messages? If so, show that. If not, show myconvo I'm sure you could have figured that out without this silly comment...*/ $this->_currentFolderID = $this->_dirData['new']['count'] ? 'new' : 'myconvo'; } //----------------------------------------- // Print folder links //----------------------------------------- foreach ($this->_dirData as $id => $data) { if ($data['protected'] and $id != 'myconvo') { continue; } $folderContents[] = "<option value='move_{$id}'>{$data['real']}</option>"; } if (count($folderContents) > 1) { $this->_jumpMenu = implode("\n", $folderContents); } else { $this->_jumpMenu = ''; } }
/** * Constructor * * @access public * @param object ipsRegistry * @return void */ public function __construct(ipsRegistry $registry) { $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->lang = $this->registry->getClass('class_localization'); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $plugin = $this->settings['bot_antispam_type']; if (!file_exists(IPS_KERNEL_PATH . 'classCaptchaPlugin/' . $plugin . '.php')) { $plugin = 'default'; } require_once IPS_KERNEL_PATH . 'classCaptchaPlugin/' . $plugin . '.php'; $this->_plugInClass = new captchaPlugIn($registry); }
/** * Method constructor * * @access public * @param string Application * @return @e void * */ public function __construct($app = 'core') { /* Make object */ $this->registry = ipsRegistry::instance(); $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->lang = $this->registry->getClass('class_localization'); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); /* Set local data */ $this->setApp($app); /* Load application file */ $this->_loadExtension(); }
/** * Constructor * * @param object ipsRegistry reference * @return @e void */ public function __construct(ipsRegistry $registry) { /* Make object */ $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); //----------------------------------------- // Do not set member, memberData or lang // Causes issues with SSO implementations //----------------------------------------- }
/** * CONSTRUCTOR * * @access public * @param object ipsRegistry reference * @return void */ public function __construct(ipsRegistry $registry) { //----------------------------------------- // Set IPS CLASS //----------------------------------------- $this->registry = $registry; $this->request = $this->registry->fetchRequest(); /* Load the Blog functions library */ require_once IPS_ROOT_PATH . 'applications_addon/ips/blog/sources/lib/lib_blogfunctions.php'; $registry->setClass('blog_std', new blogFunctions($registry)); //----------------------------------------- // Load allowed methods and build dispatch // list //----------------------------------------- require_once DOC_IPS_ROOT_PATH . 'interface/blog/apis/methods_metaweblog.php'; if (is_array($_METAWEBLOG_ALLOWED_METHODS) and count($_METAWEBLOG_ALLOWED_METHODS)) { foreach ($_METAWEBLOG_ALLOWED_METHODS as $_method => $_data) { $this->__dispatch_map[$_method] = $_data; } } }
/** * Constructor * * @param object Registry Object */ public function __construct(ipsRegistry $registry) { $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->lang = $this->registry->getClass('class_localization'); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); /* Settings */ $this->gd_version = $this->settings['gd_version']; $this->path_background = DOC_IPS_ROOT_PATH . 'public/style_captcha/captcha_backgrounds'; $this->path_fonts = DOC_IPS_ROOT_PATH . 'public/style_captcha/captcha_fonts'; }
/** * Constructor * * @access public * @param object Registry Object * @return void */ public function __construct(ipsRegistry $registry) { $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->lang = $this->registry->getClass('class_localization'); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); /* Settings */ $this->public_key = trim($this->settings['recaptcha_public_key']); $this->private_key = trim($this->settings['recaptcha_private_key']); $this->useSSL = $this->settings['logins_over_https']; }
/** * Constructor * * @access public * @param object Registry object * @return void */ public function __construct(ipsRegistry $registry) { /* Make object */ $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->lang = $this->registry->getClass('class_localization'); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); $this->lang->loadLanguageFile(array('public_profile')); }
/** * Constructor * * @access public * @param object Registry object * @param object Parent bbcode class * @return @e void */ public function __construct(ipsRegistry $registry, $_parent = null) { /* Make object */ $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->lang = $this->registry->getClass('class_localization'); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); $this->_parentBBcode = $_parent; /* Retrieve bbcode data */ $bbcodeCache = $this->cache->getCache('bbcode'); $this->_bbcode = $bbcodeCache[$this->currentBbcode]; }
/** * Constructor * * @param object Registry object * @param string Parsing method to use * @return @e void */ public function __construct(ipsRegistry $registry, $method = 'normal') { /* Make object */ $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->lang = $this->registry->getClass('class_localization'); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); $this->pre_edit_parse_method = $method; /* Initialize our bbcode class */ $this->_loadClasses(); /* And some default properties */ $this->bypass_badwords = $this->memberData ? intval($this->memberData['g_bypass_badwords']) : 0; $this->strip_quotes = $this->settings['strip_quotes']; }
/** * CONSTRUCTOR * * @param object Registry * @return @e void */ public function __construct(ipsRegistry $registry) { /* Make registry objects */ $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->lang = $this->registry->getClass('class_localization'); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); /* Just to be sure */ $this->setBypassPermissionCheck(false); /* Just for now */ $this->settings['su_parse_url'] = 1; $this->settings['tc_parse_tags'] = 1; $this->settings['tc_parse_names'] = 1; }
/** * Method constructor * * @access public * @param object Registry Object * @param array Array of settings: * [ 'sqlPrimaryID' (the SQL table field for the item ID) * 'sqlParentID' (the SQL table field for the parent ID) * 'sqlFolderFlag' (the SQL table field that tells if the row is a folder or not *Optional) * 'sqlTitle' (the SQL table field for the item title) * 'sqlOrder' (the SQL table field(s) to order on or by) * 'sqlTable' (the SQL table name) * 'sqlWhere' (Any additional 'where' information *Optional) ] * @return void */ public function __construct(ipsRegistry $registry, $settings) { /* Make object */ $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); /* Sort out settings */ $this->_sqlPrimaryID = isset($settings['sqlPrimaryID']) ? $settings['sqlPrimaryID'] : ''; $this->_sqlParentID = isset($settings['sqlParentID']) ? $settings['sqlParentID'] : ''; $this->_sqlFolderFlag = isset($settings['sqlFolderFlag']) ? $settings['sqlFolderFlag'] : ''; $this->_sqlTitle = isset($settings['sqlTitle']) ? $settings['sqlTitle'] : ''; $this->_sqlOrder = isset($settings['sqlOrder']) ? $settings['sqlOrder'] : ''; $this->_sqlTable = isset($settings['sqlTable']) ? $settings['sqlTable'] : ''; $this->_sqlWhere = isset($settings['sqlWhere']) ? $settings['sqlWhere'] : ''; /* Build the tiers */ $this->_buildTiers(); }
/** * Constructor * * @access public * @param object Registry object * @return void */ public function __construct(ipsRegistry $registry) { /* Make object */ $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->lang = $this->registry->getClass('class_localization'); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); foreach ($this->cache->getCache('bbcode') as $bbcode) { if ($bbcode['bbcode_tag'] == $this->currentBbcode) { $this->_bbcode = $bbcode; break; } } }
/** * Constructor :: Authorizes the session * * @param boolean $noAutoParsingSessions No auto parsing of sessions - set as true when using API-like methods * @return @e mixed Void normally, but can print error message */ public function __construct($noAutoParsingSessions = false) { /* Make object */ $this->registry = ipsRegistry::instance(); $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); $this->_member = self::instance(); $this->_memberData =& self::instance()->fetchMemberData(); /* Delete immediately */ $this->_deleteNow = true; /** * If the sso.php file is present in this folder, we'll load it. * This file can be used to easily integrate single-sign on in * situations where you need to check session data */ if (is_file(IPS_ROOT_PATH . '/sources/classes/session/sso.php')) { $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . '/sources/classes/session/sso.php', 'ssoSessionExtension'); if (class_exists($classToLoad)) { $this->sso = new $classToLoad($this->registry); } } //----------------------------------------- // INIT //----------------------------------------- $cookie = array(); $this->_userAgent = substr($this->_member->user_agent, 0, 200); //----------------------------------------- // Fix up app / section / module //----------------------------------------- $this->current_appcomponent = IPS_APP_COMPONENT; $this->current_module = IPSText::alphanumericalClean($this->request['module']); $this->current_section = IPSText::alphanumericalClean($this->request['section']); $this->settings['session_expiration'] = $this->settings['session_expiration'] ? $this->settings['session_expiration'] : 3600; //----------------------------------------- // Return as guest if running a task //----------------------------------------- if (IPS_IS_TASK) { self::$data_store = IPSMember::setUpGuest(); self::$data_store['last_activity'] = time(); self::$data_store['last_visit'] = time(); return true; } /* Not auto parsing sessions? */ if ($noAutoParsingSessions === true) { return true; } //----------------------------------------- // no new headers if we're simply viewing an attachment.. //----------------------------------------- if ($this->request['section'] == 'attach') { $this->settings['no_print_header'] = 1; } //----------------------------------------- // no new headers if we're updating chat //----------------------------------------- if (IPS_IS_AJAX && ($this->request['section'] != 'login' && $this->request['section'] != 'skin') or $this->request['section'] == 'attach' or $this->request['section'] == 'captcha') { $this->settings['no_print_header'] = 1; $this->do_update = 0; } //----------------------------------------- // IPS Connect //----------------------------------------- $ipsConnectEnabled = FALSE; foreach ($this->caches['login_methods'] as $k => $data) { if ($data['login_folder_name'] == 'ipsconnect' and $data['login_enabled']) { $ipsConnectEnabled = TRUE; $ipsConnectSettings = unserialize($data['login_custom_config']); } } //----------------------------------------- // Continue! //----------------------------------------- $cookie['session_id'] = IPSCookie::get('session_id'); $cookie['member_id'] = IPSCookie::get('member_id'); $cookie['pass_hash'] = IPSCookie::get('pass_hash'); if ($cookie['session_id'] && empty($this->request['_nsc'])) { $this->getSession($cookie['session_id']); $this->session_type = 'cookie'; } elseif (!empty($this->request['s'])) { $this->getSession($this->request['s']); $this->session_type = 'url'; } else { $this->session_id = 0; $this->session_type = 'url'; } //----------------------------------------- // Do we have a valid session ID? //----------------------------------------- if ($this->session_id) { $haveMember = FALSE; $forceNoMember = FALSE; /* Check we're not specifically logged out of IPS Connect */ if ($ipsConnectEnabled and isset($_COOKIE['ipsconnect_' . md5($ipsConnectSettings['master_url'])]) and !$_COOKIE['ipsconnect_' . md5($ipsConnectSettings['master_url'])]) { $forceNoMember = TRUE; } /* Check Local */ if (!empty($this->session_user_id) and !$forceNoMember) { self::setMember($this->session_user_id); if (self::$data_store['member_id'] and self::$data_store['member_id'] != 0) { $haveMember = TRUE; } } /* Check IPS Connect */ if (!$haveMember and !$forceNoMember) { if ($ipsConnectEnabled and isset($_COOKIE['ipsconnect_' . md5($ipsConnectSettings['master_url'])])) { if ($_COOKIE['ipsconnect_' . md5($ipsConnectSettings['master_url'])]) { require_once IPS_KERNEL_PATH . 'classFileManagement.php'; $cfm = new classFileManagement(); $return = $cfm->getFileContents($ipsConnectSettings['master_url'] . '?' . http_build_query(array('act' => 'cookies', 'data' => json_encode($_COOKIE)))); if ($return = @json_decode($return, TRUE)) { if ($return['connect_status'] == 'SUCCESS') { $this->_handleIpsConnect($return); $haveMember = TRUE; } } } } } /* Handle */ if ($haveMember) { $this->_updateMemberSession(); /** * If we have an SSO object, run it for the update member call */ if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForMember')) { $this->sso->checkSSOForMember('update'); } } else { $this->_updateGuestSession(); /** * If we have an SSO object, run it for the update guest session call */ if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForGuest')) { $this->sso->checkSSOForGuest('update'); } } } else { //----------------------------------------- // We didn't have a session, or the session didn't validate // Do we have cookies stored? //----------------------------------------- $haveMember = FALSE; if ($ipsConnectEnabled and isset($_COOKIE['ipsconnect_' . md5($ipsConnectSettings['master_url'])])) { if ($_COOKIE['ipsconnect_' . md5($ipsConnectSettings['master_url'])]) { require_once IPS_KERNEL_PATH . 'classFileManagement.php'; $cfm = new classFileManagement(); $return = $cfm->getFileContents($ipsConnectSettings['master_url'] . '?' . http_build_query(array('act' => 'cookies', 'data' => json_encode($_COOKIE)))); if ($return = @json_decode($return, TRUE)) { if ($return['connect_status'] == 'SUCCESS') { $this->_handleIpsConnect($return); $haveMember = TRUE; } } } } elseif ($cookie['member_id'] != "" and $cookie['pass_hash'] != "") { self::setMember($cookie['member_id']); if (self::$data_store['member_id'] and self::$data_store['member_login_key'] == $cookie['pass_hash'] and (!$this->settings['login_key_expire'] or time() <= self::$data_store['member_login_key_expire'])) { $haveMember = TRUE; } } //----------------------------------------- // Handle //----------------------------------------- if ($haveMember) { $this->_createMemberSession(); /** * If we have an SSO object, run it for the create member call */ if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForMember')) { $this->sso->checkSSOForMember('create'); } } else { self::setMember(0); $this->_createGuestSession(); /** * If we have an SSO object, run it for the create guest call */ if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForGuest')) { $this->sso->checkSSOForGuest('create'); } } } //----------------------------------------- // Knock out Google Web Accelerator //----------------------------------------- if (ipsRegistry::$settings['disable_prefetching']) { if (my_getenv('HTTP_X_MOZ') and strstr(strtolower(my_getenv('HTTP_X_MOZ')), 'prefetch') and self::$data_store['member_id']) { if (isset($_SERVER['SERVER_PROTOCOL']) and strstr($_SERVER['SERVER_PROTOCOL'], '/1.0')) { @header('HTTP/1.0 403 Forbidden'); } else { @header('HTTP/1.1 403 Forbidden'); } @header("Cache-Control: no-cache, must-revalidate, max-age=0"); @header("Expires: 0"); @header("Pragma: no-cache"); print "Prefetching or precaching is not allowed. If you have Google Accelerator enabled, please disable"; exit; } } //----------------------------------------- // Still no member id and not a bot? //----------------------------------------- if (empty(self::$data_store['member_id']) and !$this->_member->is_not_human) { self::setMember(0); self::$data_store['last_activity'] = time(); $this->request['last_visit'] = time(); } //----------------------------------------- // Set a session ID cookie //----------------------------------------- $this->_member->session_type = $this->session_type; $this->_member->session_id = $this->session_id; IPSCookie::set("session_id", $this->session_id, -1); }
/** * Constructor * * @access public * @param object Registry object * @return @e void */ public function __construct(ipsRegistry $registry) { /* Make object */ $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->lang = $this->registry->getClass('class_localization'); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); $_NOW = IPSDebug::getMemoryDebugFlag(); $this->initOurBbcodes(); IPSDebug::setMemoryDebugFlag("BBCodes initialized", $_NOW); /* Check for emoticons */ if (!$this->cache->exists('emoticons')) { $emoticons = $this->cache->getCache('emoticons'); /* Fallback on recache */ if (!is_array($emoticons) or !count($emoticons)) { $this->cache->rebuildCache('emoticons', 'global'); } } }
/** * Constructor * * @access public * @param object Registry object * @return @e void */ public function __construct() { /* Make object */ $this->registry = ipsRegistry::instance(); $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->lang = $this->registry->getClass('class_localization'); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); /* Load and init BBCodes */ foreach ($this->cache->getCache('bbcode') as $bbcode) { /* Allowed this BBCode? */ if ($bbcode['bbcode_sections'] != 'all' && parent::$Perms['parseArea'] != 'global') { $pass = false; $sections = explode(',', $bbcode['bbcode_sections']); foreach ($sections as $section) { if ($section == parent::$Perms['parseArea']) { $pass = true; break; } } if (!$pass) { continue; } } /* Cheat a bit */ if (in_array($bbcode['bbcode_tag'], array('code', 'acronym', 'img'))) { $bbcode['bbcode_no_auto_url_parse'] = 1; } /* Store */ $this->_bbcodes[$bbcode['bbcode_tag']] = $bbcode; } /* Can we parse URLs */ if (isset($this->_bbcodes['url'])) { /* Allowed to use this? */ if ($this->_bbcodes['url']['bbcode_groups'] != 'all' and parent::$Perms['memberData']['member_group_id']) { $pass = false; $groups = array_diff(explode(',', $this->_bbcodes['url']['bbcode_groups']), array('')); $mygroups = array(parent::$Perms['memberData']['member_group_id']); if (parent::$Perms['memberData']['mgroup_others']) { $mygroups = array_diff(array_merge($mygroups, explode(',', IPSText::cleanPermString(parent::$Perms['memberData']['mgroup_others']))), array('')); } foreach ($groups as $g_id) { if (in_array($g_id, $mygroups)) { $pass = true; break; } } if (!$pass) { $this->_urlsEnabled = false; } } } /* Check for emoticons */ if (!$this->cache->exists('emoticons')) { $emoticons = $this->cache->getCache('emoticons'); /* Fallback on recache */ if (!is_array($emoticons) or !count($emoticons)) { $this->cache->rebuildCache('emoticons', 'global'); } } }
/** * Constructor * * @access public * @param object Registry object * @return void */ public function __construct(ipsRegistry $registry) { /* Make object */ $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->lang = $this->registry->getClass('class_localization'); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); //require_once( IPS_ROOT_PATH . 'sources/interfaces/interface_bbcode.php' ); $_NOW = IPSDebug::getMemoryDebugFlag(); $this->initOurBbcodes(); IPSDebug::setMemoryDebugFlag("BBCodes initialized", $_NOW); /* Check for emoticons */ if (!is_array($this->caches['emoticons']) or !count($this->caches['emoticons'])) { $this->cache->rebuildCache('emoticons', 'global'); } }
/** * Constructor :: Authorizes the session * * @access public * @return mixed Void normally, but can print error message */ public function __construct() { /* Make object */ $this->registry = ipsRegistry::instance(); $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); $this->_member = self::instance(); $this->_memberData =& self::instance()->fetchMemberData(); /* Delete immediately */ $this->_deleteNow = true; /** * If the sso.php file is present in this folder, we'll load it. * This file can be used to easily integrate single-sign on in * situations where you need to check session data */ if (file_exists(IPS_ROOT_PATH . '/sources/classes/session/sso.php')) { require_once IPS_ROOT_PATH . '/sources/classes/session/sso.php'; if (class_exists("ssoSessionExtension")) { $this->sso = new ssoSessionExtension($this->registry); } } //----------------------------------------- // INIT //----------------------------------------- $cookie = array(); $this->_userAgent = substr($this->_member->user_agent, 0, 200); //----------------------------------------- // Fix up app / section / module //----------------------------------------- $this->current_appcomponent = IPS_APP_COMPONENT; $this->current_module = IPSText::alphanumericalClean($this->request['module']); $this->current_section = IPSText::alphanumericalClean($this->request['section']); $this->settings['session_expiration'] = $this->settings['session_expiration'] ? $this->settings['session_expiration'] : 3600; //----------------------------------------- // Return as guest if running a task //----------------------------------------- if (IPS_IS_TASK) { self::$data_store = IPSMember::setUpGuest(); self::$data_store['last_activity'] = time(); self::$data_store['last_visit'] = time(); return true; } //----------------------------------------- // no new headers if we're simply viewing an attachment.. //----------------------------------------- if ($this->request['section'] == 'attach') { $this->settings['no_print_header'] = 1; } //----------------------------------------- // no new headers if we're updating chat //----------------------------------------- if (IPS_IS_AJAX && $this->request['section'] != 'login' or $this->request['section'] == 'attach' or $this->request['section'] == 'captcha') { $this->settings['no_print_header'] = 1; $this->do_update = 0; } //----------------------------------------- // Continue! //----------------------------------------- $cookie['session_id'] = IPSCookie::get('session_id'); $cookie['member_id'] = IPSCookie::get('member_id'); $cookie['pass_hash'] = IPSCookie::get('pass_hash'); if ($cookie['session_id']) { $this->getSession($cookie['session_id']); $this->session_type = 'cookie'; } elseif (isset($this->request['s']) and $this->request['s']) { $this->getSession($this->request['s']); $this->session_type = 'url'; } else { $this->session_id = 0; } //----------------------------------------- // Do we have a valid session ID? //----------------------------------------- if ($this->session_id) { //----------------------------------------- // We've checked the IP addy and browser, so we can assume that this is // a valid session. //----------------------------------------- if ($this->session_user_id != 0 and !empty($this->session_user_id)) { //----------------------------------------- // It's a member session, so load the member. //----------------------------------------- self::setMember($this->session_user_id); //----------------------------------------- // Did we get a member? //----------------------------------------- if (!self::$data_store['member_id'] or self::$data_store['member_id'] == 0) { $this->_updateGuestSession(); /** * If we have an SSO object, run it for the update guest session call */ if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForGuest')) { $this->sso->checkSSOForGuest('update'); } } else { $this->_updateMemberSession(); /** * If we have an SSO object, run it for the update member call */ if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForMember')) { $this->sso->checkSSOForMember('update'); } } } else { $this->_updateGuestSession(); /** * If we have an SSO object, run it for the update guest call */ if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForGuest')) { $this->sso->checkSSOForGuest('update'); } } } else { //----------------------------------------- // We didn't have a session, or the session didn't validate // Do we have cookies stored? //----------------------------------------- if ($cookie['member_id'] != "" and $cookie['pass_hash'] != "") { //----------------------------------------- // Load member //----------------------------------------- self::setMember($cookie['member_id']); //----------------------------------------- // INIT log in key stuff //----------------------------------------- $_ok = 1; $_days = 0; $_sticky = 1; $_time = $this->settings['login_key_expire'] ? time() + intval($this->settings['login_key_expire']) * 86400 : 0; if (!self::$data_store['member_id'] or self::$data_store['member_id'] == 0) { $this->_createGuestSession(); /** * If we have an SSO object, run it for the create guest call */ if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForGuest')) { $this->sso->checkSSOForGuest('create'); } } else { if (self::$data_store['member_login_key'] == $cookie['pass_hash']) { //----------------------------------------- // Key expired? //----------------------------------------- if ($this->settings['login_key_expire']) { $_sticky = 0; $_days = $this->settings['login_key_expire']; if (time() > self::$data_store['member_login_key_expire']) { $_ok = 0; } } if ($_ok == 1) { $this->_createMemberSession(); /** * If we have an SSO object, run it for the create member call */ if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForMember')) { $this->sso->checkSSOForMember('create'); } //----------------------------------------- // Change the log in key to make each authentication // use a unique token. This means that if a cookie is // stolen, the hacker can only use the auth once. //----------------------------------------- if ($this->settings['login_change_key']) { self::$data_store['member_login_key'] = IPSMember::generateAutoLoginKey(); IPSMember::save(self::$data_store['member_id'], array('core' => array('member_login_key' => self::$data_store['member_login_key'], 'member_login_key_expire' => $_time))); IPSCookie::set("pass_hash", self::$data_store['member_login_key'], $_sticky, $_days); } } else { self::setMember(0); $this->_createGuestSession(); /** * If we have an SSO object, run it for the create guest call */ if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForGuest')) { $this->sso->checkSSOForGuest('create'); } } } else { self::setMember(0); $this->_createGuestSession(); /** * If we have an SSO object, run it for the create guest call */ if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForGuest')) { $this->sso->checkSSOForGuest('create'); } } } } else { $this->_createGuestSession(); /** * If we have an SSO object, run it for the create guest call */ if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForGuest')) { $this->sso->checkSSOForGuest('create'); } } } //----------------------------------------- // Knock out Google Web Accelerator //----------------------------------------- if (ipsRegistry::$settings['disable_prefetching']) { if (my_getenv('HTTP_X_MOZ') and strstr(strtolower(my_getenv('HTTP_X_MOZ')), 'prefetch') and self::$data_store['member_id']) { if (IPB_PHP_SAPI == 'cgi-fcgi' or IPB_PHP_SAPI == 'cgi') { @header('Status: 403 Forbidden'); } else { @header('HTTP/1.1 403 Forbidden'); } @header("Cache-Control: no-cache, must-revalidate, max-age=0"); @header("Expires: 0"); @header("Pragma: no-cache"); print "Prefetching or precaching is not allowed. If you have Google Accelerator enabled, please disable"; exit; } } //----------------------------------------- // Still no member id and not a bot? //----------------------------------------- if (!self::$data_store['member_id'] and !$this->_member->is_not_human) { self::setMember(0); self::$data_store['last_activity'] = time(); $this->request['last_visit'] = time(); } //----------------------------------------- // Set a session ID cookie //----------------------------------------- $this->_member->session_type = $this->session_type; $this->_member->session_id = $this->session_id; IPSCookie::set("session_id", $this->session_id, -1); }