public function __construct() { parent::__construct(); $this->template->links = array('Home' => 'home', 'Browse' => 'folders', 'Search' => 'search', 'About' => 'about', 'Contact' => 'contact'); $this->db = Database::instance(); // makes database object available to all controllers $this->session = Session::instance(); $authentic = new Auth(); if ($authentic->logged_in() || $authentic->auto_login()) { $this->user = $authentic->get_user(); } else { $this->session->set("requested_url", "/" . url::current()); // this will redirect from the login page back to this page url::redirect('/auth/login'); } // if ($authentic->auto_login()) { // $this->user = $authentic->get_user(); // url::redirect('/document/view/1'); // } // if (!$authentic->logged_in()) { // // $this->session->set("requested_url","/".url::current()); // this will redirect from the login page back to this page // url::redirect('/auth/login'); // } else { // $this->user = $authentic->get_user(); //now you have access to user information stored in the database // } }
public function __construct() { parent::__construct(); $this->session = new Session(); // $profiler = new Profiler; }
public function __construct() { parent::__construct(); $this->administrator_model = new Administrator_Model(); $this->search = array('display' => ''); $this->_get_session_msg(); }
public function __construct() { parent::__construct(); // Load cache $this->cache = new Cache(); // Load session $this->session = new Session(); // Load database $this->db = new Database(); $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 = $this->_fetch_core_version(); $this->template->version = $this->_find_core_version($version_number); // 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->protochart_enabled = FALSE; $this->template->colorpicker_enabled = FALSE; $this->template->editor_enabled = FALSE; $this->template->js = ''; // Load profiler // $profiler = new Profiler; }
function __construct() { parent::__construct(); $session = Session::instance(); // Load Header & Footer $this->template->header = new View('mhi/mhi_header'); $this->template->footer = new View('mhi/mhi_footer'); $this->template->footer->ushahidi_stats = Stats_Model::get_javascript(); $this->template->header->site_name = Kohana::config('settings.site_name'); // Initialize JS variables. js_files is an array of ex: html::script('media/js/jquery.validate.min'); // Add the sign in box javascript $this->template->header->js = new View('mhi/mhi_js_signin'); $this->template->header->js_files = array(); // Google Analytics $google_analytics = Kohana::config('settings.google_analytics'); $this->template->footer->google_analytics = $this->_google_analytics($google_analytics); // If we aren't at the top level MHI site or MHI isn't enabled, don't allow access to any of this jazz /* if (Kohana::config('config.enable_mhi') == FALSE OR Kohana::config('settings.subdomain') != '') throw new Kohana_User_Exception('MHI Access Error', "MHI disabled for this site."); */ // Login Form variables $this->template->header->errors = ''; $this->template->header->form = array('username' => ''); $this->template->header->form_error = ''; $this->template->header->mhi_user_id = $session->get('mhi_user_id'); }
public function __construct() { parent::__construct(); $active = $this->uri->segment(2) ? $this->uri->segment(2) : 'core'; // Add the menu to the template $this->template->menu = new View('kodoc/menu', array('active' => $active)); }
public function __construct() { parent::__construct(); $this->template = new View('templates/' . $this->site['config']['TEMPLATE'] . '/client/index'); $this->articles_model = new Articles_Model(); //View }
public function __construct() { $this->test_model = new Test_Model(); $this->payment_model = new Payment_Model(); parent::__construct(); $this->_get_session_msg(); }
public function __construct() { parent::__construct(); // Create a custom 404 handler for this controller Event::clear('system.404', array('Kohana_404_Exception', 'trigger')); Event::add('system.404', array($this, 'error')); // Do we have anything cached? if (Kohana::config('userguide.cache')) { $this->cache = Cache::instance(); } if (Router::$method === 'media') { // Do not template media files $this->auto_render = FALSE; } // Use customized Markdown parser define('MARKDOWN_PARSER_CLASS', 'Kodoc_Markdown'); // Load Markdown support require Kohana::find_file('vendor', 'markdown', TRUE); // Set the base URL for links and images Kodoc_Markdown::$base_url = url::site('userguide') . '/'; Kodoc_Markdown::$image_url = url::site('userguide/media') . '/'; // Disable eAccelerator, it messes with the ReflectionClass->getDocComments() calls ini_set('eaccelerator.enable', 0); // Bind the breadcrumb $this->template->bind('breadcrumb', $this->breadcrumb); // Add the breadcrumb $this->breadcrumb = array(); $this->breadcrumb['userguide'] = 'User Guide'; if ($this->package = URI::instance()->segment(3)) { $this->breadcrumb['userguide/guide/' . $this->package] = ucfirst($this->package); } }
public function __construct() { parent::__construct(); $this->template = new View('templates/' . $this->site['config']['TEMPLATE'] . '/client/home'); // Init session $this->_get_session_template(); $this->questionnaires_model = new Questionnaires_Model(); $this->answer_model = new Answer_Model(); $this->category_model = new Category_Model(); $this->test_model = new Test_Model(); $this->testing_model = new Testing_Model(); $this->payment_model = new Payment_Model(); $this->testingdetail_model = new Testingdetail_Model(); $this->testing_category_model = new Testingcategory_Model(); $this->promotion_model = new Promotion_Model(); $this->courses_model = new Courses_Model(); $this->study_model = new Study_Model(); $this->lesson_model = new Lesson_Model(); $this->lesson_annotation_model = new Lesson_annotation_Model(); $this->member_certificate_model = new Member_certificate_Model(); $this->certificate_model = new Certificate_Model(); $this->data_template_model = new Data_template_Model(); if ($this->sess_cus == "") { url::redirect(url::base()); die; } }
public function __construct() { parent::__construct(); $this->template = new View('templates/' . $this->site['config']['TEMPLATE'] . '/client/user'); $this->_get_session_template(); $this->Data_template_Model = new Data_template_Model(); }
public function __construct() { parent::__construct(); $this->auth = Auth::instance(); $this->template->app_name = Kohana::config('bc.bc'); $this->template->page_title = __('Login'); }
public function __construct() { parent::__construct(); // This must be included $this->search = array('keyword' => ''); $this->_get_submit(); }
public function __construct() { parent::__construct(); if ($this->is_ajax_request() == TRUE) { $this->template = new View('layout/default_json'); } }
public function __construct() { parent::__construct(); // Inicio de Session $this->session = Session::instance(); // Si la variable cat no está definida, definirla if (!isset($_SESSION['cat'])) { $_SESSION['cat'] = 0; } if (!isset($_SESSION['localidad'])) { $_SESSION['localidad'] = 0; } $this->template->links = array('Acerca de IMGListados' => 'about', 'Datos' => 'datos', 'Rubros' => 'rubros', 'Exportar Listados' => 'listados'); $this->template->footer = 'Copyright ' . $this->thiYear($this->y) . ' - ' . html::anchor('http://www.imgdigital.com.ar', 'IMG Digital', array('target' => '_blank')) . '- ' . html::anchor('http://www.imgdigital.com.ar/imglistados', 'IMGListados', array('target' => '_blank')); $this->template->login = new View('login'); // Da acceso a todos los controladores la base de datos $this->db = Database::instance(); //Listado de Categorías $this->categorias = ORM::factory('categoria')->select_list(); //$this->template->cats = $this->categorias; //Listado de Localidades $this->localidades = ORM::factory('localidad')->select_list(); //$this->template->localidades = $this->localidades; //$this->profiler = new Profiler; }
public function __construct() { parent::__construct(); $this->template = new View('templates/' . $this->site['config']['TEMPLATE'] . '/client/index'); $this->_get_session_template(); $this->login_model = new Login_Model(); }
public function __construct() { parent::__construct(); $this->template = new View('templates/' . $this->site['config']['TEMPLATE'] . '/client/index'); // Init session $this->_get_session(); }
public function __construct() { parent::__construct(); //$this->session = Session::instance(); //$this->auth = new Auth; // Check to see if the request is a HXR call if (request::is_ajax()) { // Send the 403 header header('HTTP/1.1 403 Forbidden'); //$t = new View('blank'); return; } /* if (Kohana::config_load('cw', true)) $this->cfg = Kohana::config('cw'); */ /* if (IN_PRODUCTION === FALSE) { $this->profiler = new Profiler; }*/ $t =& $this->template; $t->header = new View('components/header'); $t->footer = new View('components/footer'); //$this->db = Database::instance(); }
public function __construct() { parent::__construct(); $this->template->title = 'Kohana Forum'; # configure filters. $url_array = $this->uri->segment_array(); $this->action = empty($url_array['2']) ? 'category' : $url_array['2']; $this->filter = isset($url_array['3']) ? $url_array['3'] : ''; $this->filter2 = isset($url_array['4']) ? $url_array['4'] : ''; # configure sorters. $this->sort = isset($_GET['sort']) ? $_GET['sort'] : 'newest'; $this->sort_by = (empty($_GET['sort']) or 'votes' == $_GET['sort']) ? 'vote_count' : 'created'; $this->order = (empty($_GET['sort']) or 'oldest' != $_GET['sort']) ? 'desc' : 'asc'; /* * Notes: * We make everything run through _index or _ajax * because it's easier to delegate modular functionality * based on whether a request is ajax or not. * mapping publically (i.e. site.com/controller/method) * would mean we'd have to have ajax/non-ajax logic within each method * which i think is harder to maintain and read. */ # handle ajax requests of course =0 if (request::is_ajax()) { die($this->_ajax()); } # handle non-ajax. die($this->_index()); }
function __construct() { parent::__construct(); // Load site wide dependencies $this->database = new Database(); $this->profiler = new Profiler(); }
public function __construct() { parent::__construct(); // Set Table Prefix $this->table_prefix = Kohana::config('database.default.table_prefix'); // Load Header & Footer $this->template->header = new View('keitai/header'); $this->template->footer = new View('keitai/footer'); $this->template->header->site_name = Kohana::config('settings.site_name'); $this->template->header->site_tagline = Kohana::config('settings.site_tagline'); plugin::add_javascript('keitai/views/js/jquery'); plugin::add_javascript('keitai/views/js/jquery.treeview'); plugin::add_javascript('keitai/views/js/expand'); plugin::add_stylesheet('keitai/views/css/styles'); plugin::add_stylesheet('keitai/views/css/jquery.treeview'); $this->template->header->show_map = FALSE; $this->template->header->js = ""; $this->template->header->breadcrumbs = ""; // Google Analytics $google_analytics = Kohana::config('settings.google_analytics'); $this->template->footer->google_analytics = $this->_google_analytics($google_analytics); $this->template->header->latlong = (isset($_GET['latlong'])) ? $_GET['latlong'] : ""; $this->template->footer->latlong = (isset($_GET['latlong'])) ? $_GET['latlong'] : ""; }
public function __construct() { parent::__construct(); // Set Table Prefix $this->table_prefix = Kohana::config('database.default.table_prefix'); set_time_limit(60); }
public function __construct() { socialFeed::get_favicon_from('http://www.delicious.com/sydlawrence'); $this->session = Session::instance(); $this->db = new Database(); parent::__construct(); $_POST = $this->input->xss_clean($_POST); if ($this->input->post('attempt_login')) { $return = login::attempt_login(); if (isset($return->id) && $return->id > 0) { $this->user = $return; } else { $this->__set_options(array('error' => $return)); } if (isset($_GET['redirect'])) { url::redirect(urldecode($_GET['redirect'])); } } $this->user = login::check_login(); if ($this->input->get('logout')) { Auth::instance()->logout(TRUE); url::redirect(); } $this->page = Page_Model::get_by_url(); $this->feed = Feed_Model::get_by_url(); $this->feedpost = Feedpost_Model::get_by_url(); $this->__setup(); $this->header = new View('includes/header'); $this->footer = new View('includes/footer'); $this->__binds(); }
public function __construct() { $this->testingdetail_model = new Testingdetail_Model(); $this->questionnaires_model = new Questionnaires_Model(); $this->answer_model = new Answer_Model(); parent::__construct(); }
public function __construct() { parent::__construct(); $this->data = new Data_Model(); $this->config = new Config_Model(); $this->rrdtool = new Rrdtool_Model(); $this->config->read_config(); Kohana::config_set('locale.language', $this->config->conf['lang']); Kohana::config_set('core.site_domain', $this->config->conf['base_url']); // Check for mod_rewrite $this->check_mod_rewrite(); $this->start = $this->input->get('start', FALSE); $this->end = $this->input->get('end', FALSE); $this->theme = $this->input->get('theme', FALSE); $this->view = ""; $this->controller = Router::$controller; if (isset($_GET['view']) && $_GET['view'] != "") { $this->view = pnp::clean($_GET['view']); } $this->data->getTimeRange($this->start, $this->end, $this->view); if (Router::$controller != "image" && Router::$controller != "image_special") { $this->session = Session::instance(); if ($this->theme) { $this->session->set('theme', $this->theme); } # New session if ($this->session->get("theme", "new") == "new") { $this->theme = $this->config->conf['ui-theme']; $this->session->set("theme", $this->theme); } else { $this->theme = $this->session->get('theme'); } if ($this->start && $this->end) { if ($this->session->get('timerange-reset', 0) == 0) { $this->session->set("start", $this->start); $this->session->set("end", $this->end); } else { $this->session->set('timerange-reset', 0); } } if ($this->start && !$this->end) { if ($this->session->get('timerange-reset', 0) == 0) { $this->session->set("start", $this->start); $this->session->set("end", ""); } else { $this->session->set('timerange-reset', 0); } } if ($this->end && !$this->start) { if ($this->session->get('timerange-reset', 0) == 0) { $this->session->set("end", $this->end); $this->session->set("start", ""); } else { $this->session->set('timerange-reset', 0); } } } $this->template = $this->add_view('template'); }
public function __construct() { parent::__construct(); // Load cache $this->cache = new Cache(); // Load session $this->session = new Session(); // Load language views if (isset($_GET['lang'])) { $this->view_lang .= "-" . substr($_GET['lang'], 0, 2); } // Load Header & Footer $this->template->header = new View($this->view_lang . '/header'); $this->template->footer = new View($this->view_lang . '/footer'); // Retrieve Default Settings $site_name = Kohana::config('settings.site_name'); // Prevent Site Name From Breaking up if its too long // by reducing the size of the font if (strlen($site_name) > 20) { $site_name_style = " style=\"font-size:21px;\""; } else { $site_name_style = ""; } $this->template->header->site_name = $site_name; $this->template->header->site_name_style = $site_name_style; $this->template->header->site_tagline = Kohana::config('settings.site_tagline'); $this->template->header->api_url = Kohana::config('settings.api_url'); // Display News Feed? $this->template->header->allow_feed = Kohana::config('settings.allow_feed'); // Javascript Header $this->template->header->map_enabled = FALSE; $this->template->header->validator_enabled = FALSE; $this->template->header->datepicker_enabled = FALSE; $this->template->header->photoslider_enabled = FALSE; $this->template->header->videoslider_enabled = FALSE; $this->template->header->main_page = FALSE; $this->template->header->js = ''; $this->template->header->this_page = ""; // Google Analytics $google_analytics = Kohana::config('settings.google_analytics'); $this->template->footer->google_analytics = $this->_google_analytics($google_analytics); // Create Language Session if (isset($_GET['lang']) && !empty($_GET['lang'])) { $_SESSION['lang'] = $_GET['lang']; } if (isset($_SESSION['lang']) && !empty($_SESSION['lang'])) { Kohana::config_set('locale.language', $_SESSION['lang']); } $this->template->header->site_language = Kohana::config('locale.language'); //Set up tracking gif if ($_SERVER['SERVER_NAME'] != 'localhost' && $_SERVER['SERVER_NAME'] != '127.0.0.1') { $track_url = $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF']; } else { $track_url = 'null'; } $this->template->footer->tracker_url = 'http://tracker.ushahidi.com/track.php?url=' . urlencode($track_url) . '&lang=' . $this->template->header->site_language . ''; // Load profiler // $profiler = new Profiler; }
public function __construct() { parent::__construct(); // Set Table Prefix $this->table_prefix = Kohana::config('database.default.table_prefix'); // Cacheable JSON Controller $this->is_cachable = TRUE; }
public function __construct() { parent::__construct(); if ($this->is_ajax_request()) { $this->template = new View('layout/default_json'); } role::check('order_edit'); }
public function __construct() { parent::__construct(); $this->data_template_model = new Data_template_Model(); //$this->search = array('display' => '','keyword' => '','page' => 0,'cur_page' => '','option' => ''); $this->search = array('keyword' => '', 'page' => 0, 'cur_page' => '', 'type' => '', 'sort' => '', 'per_page' => '20', 'option' => '', 'display' => ''); $this->_get_session_msg(); }
/** * 构造方法 */ public function __construct() { parent::__construct(); $this->class_name = strtolower(substr(__CLASS__, 0, strpos(__CLASS__, '_'))); if ($this->is_ajax_request()) { $this->template = new View('layout/default_json'); } }