コード例 #1
0
ファイル: Morfy.php プロジェクト: zorca/morfy
 /**
  * Constructor.
  *
  * @access protected
  */
 protected function __construct()
 {
     // Init Config
     Config::init();
     // Turn on output buffering
     ob_start();
     // Display Errors
     Config::get('system.errors.display') and error_reporting(-1);
     // Set internal encoding
     function_exists('mb_language') and mb_language('uni');
     function_exists('mb_regex_encoding') and mb_regex_encoding(Config::get('system.charset'));
     function_exists('mb_internal_encoding') and mb_internal_encoding(Config::get('system.charset'));
     // Set default timezone
     date_default_timezone_set(Config::get('system.timezone'));
     // Start the session
     Session::start();
     // Init Cache
     Cache::init();
     // Init Plugins
     Plugins::init();
     // Init Blocks
     Blocks::init();
     // Init Pages
     Pages::init();
     // Flush (send) the output buffer and turn off output buffering
     ob_end_flush();
 }
コード例 #2
0
                }
            }
        }
    }
    // ------------------------------------------------------------------------
    private static function _filter_pages_authorization($row)
    {
        // If the page group != 0, then get the page group and check the restriction
        if ($row['id_group'] != 0) {
            self::$ci->load->model('connect_model');
            $page_group = FALSE;
            $groups = self::$ci->connect_model->get_groups();
            // Get the page group
            foreach ($groups as $group) {
                if ($group['id_group'] == $row['id_group']) {
                    $page_group = $group;
                }
            }
            // If the current connected user has access to the page return TRUE
            if (self::$user !== FALSE && $page_group != FALSE && self::$user['group']['level'] >= $page_group['level']) {
                return TRUE;
            }
            // If nothing found, return FALSE
            return FALSE;
        }
        return TRUE;
    }
}
Pages::init();
/* End of file Pages.php */
/* Location: /application/libraries/Pages.php */