Esempio n. 1
0
 /**
  * Called after the kernel initializes a service
  * @return	void
  */
 public static function loadService($params, $event)
 {
     switch ($params['name']) {
         case "config":
             global $xoopsOption, $icmsConfig;
             if (!isset($xoopsOption['nodebug']) || !$xoopsOption['nodebug']) {
                 if ($icmsConfig['debug_mode'] == 1 || $icmsConfig['debug_mode'] == 2) {
                     error_reporting(E_ALL);
                     icms::$logger->enableRendering();
                     icms::$logger->usePopup = $icmsConfig['debug_mode'] == 2;
                     if (icms::$db) {
                         icms_Event::attach('icms_db_IConnection', 'prepare', array(__CLASS__, 'prepareQuery'));
                         icms_Event::attach('icms_db_IConnection', 'execute', array(__CLASS__, 'executeQuery'));
                     }
                 } else {
                     // ICMS_ERROR_LOG_SEVERITY ADDED BY FREEFORM SOLUTIONS
                     if (defined("ICMS_ERROR_LOG_SEVERITY")) {
                         ini_set('display_errors', 0);
                     } else {
                         error_reporting(0);
                     }
                     icms::$logger->activated = false;
                 }
             }
             break;
     }
 }
Esempio n. 2
0
 public function query()
 {
     $args = func_get_args();
     $sql = $args[0];
     icms_Event::trigger('icms_db_IConnection', 'execute', $this, array('sql' => $args[0]));
     return call_user_func_array(array('parent', 'query'), $args);
 }
Esempio n. 3
0
 /**
  * Initialize the icms::$security service
  */
 public static function service()
 {
     $instance = new icms_core_Security();
     $instance->checkSuperglobals();
     if ($_SERVER['REQUEST_METHOD'] != 'POST' || !$instance->checkReferer(XOOPS_DB_CHKREF)) {
         define('XOOPS_DB_PROXY', 1);
     }
     icms_Event::attach('icms', 'loadService-config', array($instance, 'checkBadips'));
     return $instance;
 }
Esempio n. 4
0
	/**
	 * Called after the kernel initializes a service
	 * @return	void
	 */
	static public function loadService($params, $event) {
		switch ($params['name']) {
		case "config":
			global $xoopsOption, $icmsConfig;
			if (!isset($xoopsOption['nodebug']) || !$xoopsOption['nodebug']) {
				if ($icmsConfig['debug_mode'] == 1 || $icmsConfig['debug_mode'] == 2) {
					error_reporting(E_ALL);
					icms::$logger->enableRendering();
					icms::$logger->usePopup = ( $icmsConfig['debug_mode'] == 2 );
					if (icms::$db) {
						icms_Event::attach('icms_db_IConnection', 'prepare', array(__CLASS__, 'prepareQuery'));
						icms_Event::attach('icms_db_IConnection', 'execute', array(__CLASS__, 'executeQuery'));
					}
				} else {
					error_reporting(0);
					icms::$logger->activated = false;
				}
			}
			break;
		}
	}
Esempio n. 5
0
	/**
	 * Attaches the multilanguage handler to the event handler
	 * 
	 */
	static public function setup() {
		icms_Event::attach('icms', 'loadService-session', array(__CLASS__, 'initMultilang'));
	}
Esempio n. 6
0
 /**
  * Triggers a specific event on all the libraries
  *
  * Here are the currently supported events:
  * - startCoreBoot : this event is triggered at the  start of the core booting process (start  of include/common.php)
  * - finishCoreBoot : this event is triggered at the end of the core booting process (end of include/common.php)
  * - adminHeader : this event is triggered when calling icms_cp_header() and is used to output content in the head section of the admin side
  * - beforeFooter : this event is triggered when include/footer.php is called, at the begining of the file
  * - startOutputInit : this event is triggered when starting to output the content, in include/header.php after instantiation of $xoopsTpl
  *
  * @param $event string name of the event to trigger
  * @param $array mixed container to pass any arguments to be used by the library
  *
  * @return	TRUE if successful, FALSE if not
  */
 public function triggerEvent($event, $array = array())
 {
     $event = strtolower($event);
     icms_Event::trigger('icms', $event, null, $array);
 }
Esempio n. 7
0
 public static function setup()
 {
     icms_Event::attach('icms', 'loadService', array(__CLASS__, 'loadService'));
     icms_Event::attach('icms', 'finishcoreboot', array(__CLASS__, 'finishCoreBoot'));
     icms_Event::attach('icms', '*', array(__CLASS__, 'backwardCompatibility'));
 }
Esempio n. 8
0
 /**
  * Creates Session ID & Starts the session
  * removes Expired Custom Sessions after session Start
  * @param   string  $sslpost_name    sets the session_id as ssl Name defined in preferences (if SSL enabled)
  * @return
  **/
 public function sessionStart($sslpost_name = '')
 {
     global $icmsConfig;
     if ($icmsConfig['use_ssl'] && isset($sslpost_name) && $sslpost_name != '') {
         session_id($sslpost_name);
     } elseif ($icmsConfig['use_mysession'] && $icmsConfig['session_name'] != '' && $icmsConfig['session_expire'] > 0) {
         if (isset($_COOKIE[$icmsConfig['session_name']])) {
             session_id($_COOKIE[$icmsConfig['session_name']]);
         }
         if (function_exists('session_cache_expire')) {
             session_cache_expire($icmsConfig['session_expire']);
         }
         @ini_set('session.gc_maxlifetime', $icmsConfig['session_expire'] * 60);
     }
     if ($icmsConfig['use_mysession'] && $icmsConfig['session_name'] != '') {
         session_name($icmsConfig['session_name']);
     } else {
         session_name('ICMSSESSION');
     }
     session_start();
     self::removeExpiredCustomSession('xoopsUserId');
     icms_Event::trigger('icms_core_Session', 'sessionStart', $this);
     return;
 }
Esempio n. 9
0
 /**
  * Instanciate the specified service
  * @param string $name
  * @param mixed $factory
  * @param array $args
  * @return object
  */
 public static function loadService($name, $factory, $args = array())
 {
     self::${$name} = self::create($factory, $args);
     icms_Event::trigger('icms', 'loadService', null, array('name' => $name, 'service' => self::${$name}));
     icms_Event::trigger('icms', 'loadService-' . $name, null, array('name' => $name, 'service' => self::${$name}));
 }
Esempio n. 10
0
	static public function setup() {
		icms_Event::attach('icms_core_Session', 'sessionStart', array(__CLASS__, 'onSessionStart'));
		icms_Event::attach('icms_core_Session', 'sessionClose', array(__CLASS__, 'onSessionClose'));
	}