public function __construct() { parent::__construct(); $module_path = $this->cms_module_path(); $module_list = $this->cms_get_module_list(); foreach ($module_list as $module_info) { if ($module_info['module_path'] == $module_path) { $this->NAME = $module_info['module_name']; $this->IS_ACTIVE = $module_info['active']; $this->IS_OLD = $module_info['old']; $this->OLD_VERSION = $module_info['old_version']; $this->VERSION = $module_info['current_version']; $this->DESCRIPTION = $module_info['description']; } } // load dbforge to be used later $this->load->dbforge(); // get subsite authorization $subsite_auth_file = FCPATH . 'modules/' . $this->cms_module_path() . '/subsite_auth.php'; if (file_exists($subsite_auth_file)) { unset($public); unset($subsite_allowed); include $subsite_auth_file; if (isset($public) && is_bool($public)) { $this->PUBLIC = $public; } if (isset($subsite_allowed) && is_array($subsite_allowed)) { $this->SUBSITE_ALLOWED = $subsite_allowed; } } }
public function __construct() { parent::__construct(); $this->load->helper('inflector'); $this->load->library('nordrassil/NordrassilLib'); $this->nds = new NordrassilLib(); }
public function __construct() { parent::__construct(); $this->load->helper('inflector'); $this->load->library('nordrassil/nordrassillib'); $this->nds = $this->nordrassillib; set_time_limit(60); }
function __construct() { parent::__construct(); isLogged(); $this->_checkAuth(); $this->shellFile = THEME . 'shell'; $this->load->model('user/usermodel'); self::init(); }
public function __construct() { parent::__construct(); $this->load->helper('inflector'); $this->load->library('nordrassil/nordrassillib'); $this->nds = $this->nordrassillib; $this->load->model($this->cms_module_path() . '/nds_model'); set_time_limit(60); }
public function __construct() { // Constructor to auto-load HybridAuthLib parent::__construct(); if (in_array('curl', get_loaded_extensions())) { try { $this->load->library('HybridAuthLib'); } catch (Exception $e) { redirect(''); } } else { redirect(''); } }
public function __construct() { parent::__construct(); $this->URL_MAP = $this->do_override_url_map($this->URL_MAP); $uriString = $this->uri->uri_string(); $navigation_name = null; if (isset($this->URL_MAP[$uriString])) { if (!isset($navigation_name)) { $navigation_name = $this->cms_navigation_name($this->URL_MAP[$uriString]); } if (!isset($navigation_name)) { $navigation_name = $this->URL_MAP[$uriString]; } } else { foreach ($this->URL_MAP as $key => $value) { if ($uriString == $this->cms_parse_keyword($key)) { if (!isset($navigation_name)) { $navigation_name = $this->cms_navigation_name($key); } if (!isset($navigation_name)) { $navigation_name = $this->URL_MAP[$key]; } break; } } } if (!isset($navigation_name)) { $navigation_name = $this->cms_navigation_name($uriString); } $this->cms_guard_page($navigation_name); if (!$this->__cms_dynamic_widget && $uriString != '' && !$this->ALLOW_UNKNOWN_NAVIGATION_NAME && !isset($navigation_name)) { if ($this->input->is_ajax_request()) { $response = array('success' => false, 'message' => 'unauthorized access'); $this->cms_show_json($response); die; } else { $this->cms_redirect(); } } $this->navigation_name = $navigation_name; }
public function __construct() { parent::__construct(); }
public function __construct() { parent::__construct(); $query = $this->db->select('version')->from(cms_table_name('main_module'))->where(array('module_name' => $this->NAME, 'module_path' => $this->cms_module_path()))->get(); if ($query->num_rows() == 0) { $this->IS_ACTIVE = FALSE; $this->IS_OLD = FALSE; $this->OLD_VERSION = '0.0.0'; } else { $this->IS_ACTIVE = TRUE; $row = $query->row(); $this->OLD_VERSION = $row->version; if ($this->OLD_VERSION == '') { $this->OLD_VERSION = '0.0.0'; } if (version_compare($this->VERSION, $this->OLD_VERSION) > 0) { $this->IS_OLD = TRUE; } else { $this->IS_OLD = FALSE; } } $this->load->dbforge(); }
public function __construct() { parent::__construct(); $this->theme = $this->cms_get_config('site_theme'); }
public function __construct() { parent::__construct(); $this->article_per_page = 5; }
/** * Constructor function * @todo Document more please. */ public function __construct() { parent::__construct(); $this->_zlib_oc = @ini_get('zlib.output_compression'); // Lets grab the config and get ready to party $this->load->config('rest'); // let's learn about the request $this->request = new stdClass(); // Is it over SSL? $this->request->ssl = $this->_detect_ssl(); // How is this request being made? POST, DELETE, GET, PUT? $this->request->method = $this->_detect_method(); // Create argument container, if nonexistent if (!isset($this->{'_' . $this->request->method . '_args'})) { $this->{'_' . $this->request->method . '_args'} = array(); } // Set up our GET variables $this->_get_args = array_merge($this->_get_args, $this->uri->ruri_to_assoc()); $this->load->helper('security'); // This library is bundled with REST_Controller 2.5+, but will eventually be part of CodeIgniter itself $this->load->library('format'); // Try to find a format for the request (means we have a request body) $this->request->format = $this->_detect_input_format(); // Some Methods cant have a body $this->request->body = NULL; $this->{'_parse_' . $this->request->method}(); // Now we know all about our request, let's try and parse the body if it exists if ($this->request->format and $this->request->body) { $this->request->body = $this->format->factory($this->request->body, $this->request->format)->to_array(); // Assign payload arguments to proper method container $this->{'_' . $this->request->method . '_args'} = $this->request->body; } // Merge both for one mega-args variable $this->_args = array_merge($this->_get_args, $this->_put_args, $this->_post_args, $this->_delete_args, $this->{'_' . $this->request->method . '_args'}); // Which format should the data be returned in? $this->response = new stdClass(); $this->response->format = $this->_detect_output_format(); // Which format should the data be returned in? $this->response->lang = $this->_detect_lang(); // Developers can extend this class and add a check in here $this->early_checks(); // Check if there is a specific auth type for the current class/method $this->auth_override = $this->_auth_override_check(); // When there is no specific override for the current class/method, use the default auth value set in the config if ($this->auth_override !== TRUE) { if ($this->config->item('rest_auth') == 'basic') { $this->_prepare_basic_auth(); } elseif ($this->config->item('rest_auth') == 'digest') { $this->_prepare_digest_auth(); } elseif ($this->config->item('rest_ip_whitelist_enabled')) { $this->_check_whitelist_auth(); } } $this->rest = new StdClass(); // Load DB if its enabled if (config_item('rest_database_group') and (config_item('rest_enable_keys') or config_item('rest_enable_logging'))) { $this->rest->db = $this->load->database(config_item('rest_database_group'), TRUE); } elseif (@$this->db) { $this->rest->db = $this->db; } // Checking for keys? GET TO WORK! if (config_item('rest_enable_keys')) { $this->_allow = $this->_detect_api_key(); } // only allow ajax requests if (!$this->input->is_ajax_request() and config_item('rest_ajax_only')) { $this->response(array('status' => false, 'error' => 'Only AJAX requests are accepted.'), 505); } }
function __construct() { parent::__construct(); $this->checkAuth(); }
/** * @author goFrendiAsgard * @desc this is the constructor, everything you write here will automatically */ public function __construct() { parent::__construct(); $this->data = array("anchors" => array(array("url" => $this->cms_module_path('gofrendi.noCMS.example') . '/index', "title" => 'index()', "description" => '$this->view(\'example/example_index\', $this->data, \'example_index\');' . br() . 'This is the most common call'), array("url" => $this->cms_module_path('gofrendi.noCMS.example') . '/view_1', "title" => 'view_1()', "description" => '$this->view(\'example/example_index\', $this->data);' . br() . 'Navigation_name will be guessed by the system'), array("url" => $this->cms_module_path('gofrendi.noCMS.example') . '/view_2', "title" => 'view_2()', "description" => 'echo $this->view(\'example/example_index\', $this->data, true);' . br() . 'The result would be a string, that\'s why we use echo'), array("url" => $this->cms_module_path('gofrendi.noCMS.example') . '/view_3', "title" => 'view_3()', "description" => '$this->view(\'example/example_index\', $this->data, NULL, NULL, \'orange\');' . br() . 'Change the theme into orange for only this request'), array("url" => $this->cms_module_path('gofrendi.noCMS.example') . '/view_4', "title" => 'view_4()', "description" => '$this->view(\'example/example_index\', $this->data, NULL, NULL, \'neutral\', \'mobile\');' . br() . 'Change the theme into neutral and layout into mobile for only this request'))); }
public function __construct() { parent::__construct(); $this->load->model($this->cms_module_path() . '/article_model'); }
public function __construct() { parent::__construct(); // get module name & module path $query = $this->db->select('version')->from(cms_table_name('main_module'))->where(array('module_name' => $this->NAME, 'module_path' => $this->cms_module_path()))->get(); if ($query->num_rows() == 0) { $this->IS_ACTIVE = FALSE; $this->IS_OLD = FALSE; $this->OLD_VERSION = '0.0.0'; } else { $this->IS_ACTIVE = TRUE; $row = $query->row(); // TODO: the suck sqlite returning array $row = json_decode(json_encode($row), FALSE); if ($this->OLD_VERSION == '') { $this->OLD_VERSION = $row->version; } if (version_compare($this->VERSION, $this->OLD_VERSION) > 0) { $this->IS_OLD = TRUE; } else { $this->IS_OLD = FALSE; } } // load dbforge to be used later $this->load->dbforge(); // get subsite authorization $subsite_auth_file = FCPATH . 'modules/' . $this->cms_module_path() . '/subsite_auth.php'; if (file_exists($subsite_auth_file)) { unset($public); unset($subsite_allowed); include $subsite_auth_file; if (isset($public) && is_bool($public)) { $this->PUBLIC = $public; } if (isset($subsite_allowed) && is_array($subsite_allowed)) { $this->SUBSITE_ALLOWED = $subsite_allowed; } } }