function __construct() { parent::__construct(); $this->template->this_page = 'upgrade'; $upgrade = new Upgrade(); $latest_version = $upgrade->_fetch_core_version(); // limit access to only superadmin if (!$this->auth->logged_in('superadmin') && $latest_version != "") { url::redirect('admin/dashboard'); } }
public function __construct() { parent::__construct(); // Load cache $this->cache = new Cache(); // Load session $this->session = new Session(); // Load database $this->db = new Database(); $upgrade = new Upgrade(); $this->auth = new Auth(); $this->session = Session::instance(); $this->auth->auto_login(); if (!$this->auth->logged_in('admin') && !$this->auth->logged_in('login')) { url::redirect('login'); } //fetch latest version of ushahidi $version_number = $upgrade->_fetch_core_version(); $this->template->version = $version_number; // Get version coded numbers to display $this->template->code_version = Kohana::config('version.ushahidi_version'); $this->template->db_version = Kohana::config('version.ushahidi_db_version'); // Get version from the db $this->template->actual_code_version = Kohana::config('settings.ushahidi_version'); $this->template->actual_db_version = Kohana::config('settings.db_version'); // Get Session Information $user = new User_Model($_SESSION['auth_user']->id); $this->template->admin_name = $user->name; // Retrieve Default Settings $this->template->site_name = Kohana::config('settings.site_name'); $this->template->mapstraction = Kohana::config('settings.mapstraction'); $this->template->api_url = Kohana::config('settings.api_url'); // Javascript Header $this->template->map_enabled = FALSE; $this->template->flot_enabled = FALSE; $this->template->treeview_enabled = FALSE; $this->template->protochart_enabled = FALSE; $this->template->colorpicker_enabled = FALSE; $this->template->editor_enabled = FALSE; $this->template->js = ''; // Initialize some variables for raphael impact charts $this->template->raphael_enabled = FALSE; $this->template->impact_json = ''; // Generate main tab navigation list. Key = Page (/admin/???), Val = Tab Name $tabs = array('dashboard' => Kohana::lang('ui_admin.dashboard'), 'reports' => Kohana::lang('ui_admin.reports'), 'comments' => Kohana::lang('ui_admin.comments'), 'messages' => Kohana::lang('ui_admin.messages'), 'feedback' => Kohana::lang('ui_admin.feedback'), 'stats' => Kohana::lang('ui_admin.stats'), 'apilogs' => Kohana::lang('ui_admin.api_logs')); if (Kohana::config('config.enable_mhi') == TRUE && Kohana::config('settings.subdomain') == '') { $tabs['mhi'] = Kohana::lang('ui_admin.mhi'); } $this->template->tabs = $tabs; // Load profiler // $profiler = new Profiler; }
public function __construct() { parent::__construct(); // Load cache $this->cache = new Cache(); // Load session $this->session = new Session(); // Load database $this->db = new Database(); $upgrade = new Upgrade(); $this->auth = new Auth(); $this->session = Session::instance(); $this->auth->auto_login(); if (!$this->auth->logged_in('login')) { url::redirect('login'); } // Set Table Prefix $this->table_prefix = Kohana::config('database.default.table_prefix'); //fetch latest version of ushahidi $version_number = $upgrade->_fetch_core_version(); $this->template->version = $version_number; // Get Session Information $this->user = new User_Model($_SESSION['auth_user']->id); $this->template->admin_name = $this->user->name; // Retrieve Default Settings $this->template->site_name = Kohana::config('settings.site_name'); $this->template->mapstraction = Kohana::config('settings.mapstraction'); $this->template->api_url = Kohana::config('settings.api_url'); // Javascript Header $this->template->map_enabled = FALSE; $this->template->flot_enabled = FALSE; $this->template->treeview_enabled = FALSE; $this->template->protochart_enabled = FALSE; $this->template->colorpicker_enabled = FALSE; $this->template->editor_enabled = FALSE; $this->template->js = ''; $this->template->form_error = FALSE; // Initialize some variables for raphael impact charts $this->template->raphael_enabled = FALSE; $this->template->impact_json = ''; // Generate main tab navigation list. $this->template->main_tabs = admin::main_tabs(); // Generate sub navigation list (in default layout, sits on right side). $this->template->main_right_tabs = admin::main_right_tabs($this->auth); $this->template->this_page = ""; // Load profiler // $profiler = new Profiler; }
public function __construct() { parent::__construct(); // Load cache $this->cache = new Cache(); // Load session $this->session = new Session(); // Load database $this->db = new Database(); $upgrade = new Upgrade(); $this->auth = new Auth(); $this->session = Session::instance(); $this->auth->auto_login(); if ($this->auth->logged_in('login')) { // url::redirect('main'); // Get Session Information $this->user = new User_Model($_SESSION['auth_user']->id); $this->template->admin_name = $this->user->name; } //fetch latest version of ushahidi $version_number = $upgrade->_fetch_core_version(); $this->template->version = $version_number; // Retrieve Default Settings $this->template->site_name = Kohana::config('settings.site_name'); $this->template->mapstraction = Kohana::config('settings.mapstraction'); $this->template->api_url = Kohana::config('settings.api_url'); // Javascript Header $this->template->map_enabled = FALSE; $this->template->flot_enabled = FALSE; $this->template->protochart_enabled = FALSE; $this->template->colorpicker_enabled = FALSE; $this->template->editor_enabled = FALSE; $this->template->js = ''; // Initialize some variables for raphael impact charts $this->template->raphael_enabled = FALSE; $this->template->impact_json = ''; // Load profiler // $profiler = new Profiler; }