public function __construct() { parent::__construct(); if ($this->user == FALSE && $this->uri->segment(2) != 'auth') { redirect('admin/auth/login'); } }
public function __construct() { parent::__construct(); $this->load->library(['api/json_rpc/Request' => NULL, 'api/json_rpc/Response' => NULL]); $inputRaw = file_get_contents('php://input'); $this->request = new Request($inputRaw); $this->response = new Response($this->request, $this->errors); Info(get_class($this) . ' Initialized'); }
public function __construct() { parent::__construct(); $this->url = $this->uri->segment_array(); // Possible Language code detection if (isset($this->url[0]) && strlen($this->url[0]) == 2) { $this->language = $this->url[0]; unset($this->url[0]); } $this->url_string = '/' . implode('/', $this->url); //$this->output->enable_profiler( TRUE ); }
/** * Resources constructor * * It's parsing the URL and getting the $this->url, $this->type, $this->file values * Also checking the file existence and returning 404 when it's missing */ public function __construct() { parent::__construct(); $this->url = $this->uri->uri_string(); $this->type = $this->uri->segment(1, NULL); $this->file = $this->url; $this->extension = pathinfo($this->file, PATHINFO_EXTENSION); // Checking the not allowed situations if (!in_array($this->extension, $this::ALLOWED_EXTENSIONS)) { show_404(); } if (!in_array($this->type, $this::ALLOWED_FOLDERS)) { show_404(); } // Checking the file existence @TODO: Theme folder check if (!file_exists(APPPATH . $this->file)) { show_404(); } }
public function __construct() { parent::__construct(); // Getting the scriptss folder path in the theme $this->base_path = key($this->ionize->themes_basepath) . DS . 'themes' . DS . $this->ionize->theme . DS; $this->url_string = $this->uri->uri_string(); $this->url_string = preg_replace('/(' . implode('|', $this->folders) . ')/i', '', $this->url_string, 1); Debug($this->url_string, '$this->url_string'); // Checking all theme folders $folders = array(); foreach ($this->folders as $folder) { $folder_variable = "{$folder}_path"; $this->{$folder_variable} = $this->base_path . $folder . DS; if (!file_exists($this->{$folder_variable})) { $this->{$folder_variable} = NULL; } else { $folders[$folder] =& $this->{$folder_variable}; } } $this->folders = $folders; }
public function __construct() { parent::__construct(); }