Exemplo n.º 1
0
 public function __construct()
 {
     parent::__construct();
     $this->load->helper('inflector');
     $this->load->library('nordrassil/NordrassilLib');
     $this->nds = new NordrassilLib();
 }
Exemplo n.º 2
0
 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;
         }
     }
 }
Exemplo n.º 3
0
 public function __construct()
 {
     parent::__construct();
     $this->load->helper('inflector');
     $this->load->library('nordrassil/nordrassillib');
     $this->nds = $this->nordrassillib;
     set_time_limit(60);
 }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
 function __construct()
 {
     parent::__construct();
     isLogged();
     $this->_checkAuth();
     $this->shellFile = THEME . 'shell';
     $this->load->model('user/usermodel');
     self::init();
 }
Exemplo n.º 6
0
 public function setup()
 {
     $this->auth_realm = CMS::$admin_realm;
     if (isset(CMS::$cfg->vars->use_tinymce)) {
         $s = trim(CMS::$cfg->vars->use_tinymce);
         if ($s == '' || $s == '0') {
             $this->use_tinymce = false;
         }
     }
     return parent::setup()->use_views_from(CMS::views_path('admin/vars'));
 }
Exemplo n.º 7
0
 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('');
     }
 }
Exemplo n.º 8
0
 public function setup()
 {
     $this->orm_module = $this->getp('orm_module');
     $this->admin_module = $this->getp('admin_module');
     $this->schema_module = $this->getp('schema_module');
     $this->orm_fields = $this->getp('orm_fields');
     $this->admin_fields = $this->getp('admin_fields');
     $this->component = $this->getp('component');
     $this->component_module = "Component.{$this->component}";
     $this->admin_tabs = (bool) $this->getp('admin_tabs', 0);
     $this->item_name = "{$this->orm_module}.Item";
     $this->urls = WS::env()->urls->cmscomponentfactory;
     $this->auth_realm = CMS::$admin_realm;
     return parent::setup()->use_views_from(CMS::views_path('admin/factory'))->render_defaults('tables', 'urls', 'table', 'fields', 'key_field');
 }
Exemplo n.º 9
0
 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;
         }
     }
 }
Exemplo n.º 10
0
 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();
 }
Exemplo n.º 11
0
 public function setup()
 {
     $this->setup_config();
     return parent::setup();
 }
Exemplo n.º 12
0
 public function view($view_url, $data = null, $navigation_name = null, $config = null, $return_as_string = false)
 {
     if (is_bool($navigation_name) && count($config) == 0) {
         $return_as_string = $navigation_name;
         $navigation_name = null;
         $config = null;
     } elseif (is_bool($config)) {
         $return_as_string = $config;
         $config = null;
     }
     if (!isset($config) || !is_array($config)) {
         $config = array();
     }
     $navigation_name = $this->cms_override_navigation_name($navigation_name);
     $config = $this->cms_override_config($config);
     return parent::view($view_url, $data, $navigation_name, $config, $return_as_string);
 }
Exemplo n.º 13
0
 protected function view($view_url, $data = NULL, $navigation_name = NULL, $config = NULL, $return_as_string = FALSE)
 {
     if (is_bool($navigation_name) && count($config) == 0) {
         $return_as_string = $navigation_name;
         $navigation_name = NULL;
         $config = NULL;
     } else {
         if (is_bool($config)) {
             $return_as_string = $config;
             $config = NULL;
         }
     }
     if (!isset($config) || !is_array($config)) {
         $config = array();
     }
     $navigation_name = $this->cms_override_navigation_name($navigation_name);
     $config = $this->cms_override_config($config);
     parent::view($view_url, $data, $navigation_name, $config, $return_as_string);
 }
Exemplo n.º 14
0
 public function __construct()
 {
     parent::__construct();
     $this->article_per_page = 5;
 }
Exemplo n.º 15
0
 function __construct()
 {
     parent::__construct();
     $this->checkAuth();
 }
Exemplo n.º 16
0
 /**
  * @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')));
 }
Exemplo n.º 17
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model($this->cms_module_path() . '/article_model');
 }
Exemplo n.º 18
0
 public function __construct()
 {
     parent::__construct();
 }
Exemplo n.º 19
0
 public function __construct()
 {
     parent::__construct();
     $this->theme = $this->cms_get_config('site_theme');
 }
 /**
  * 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);
     }
 }
Exemplo n.º 21
0
 /**
  * @return CMS_Controller_PageView
  */
 public function setup()
 {
     return parent::setup()->render_defaults('perpage');
 }