public function __construct() { parent::__construct(); check_session(); // jika session habis, redirect ke logout $this->load->model("Myaccount_Model"); }
public function __construct() { parent::__construct(); check_session(); // jika session habis, redirect ke logout $this->load->model(array("Dashboard_Model", "Order_Model", "Orderspace_Model", "Receive_Model")); $this->_accessPaket = get_access("PAKET"); $this->_accessSpace = get_access("SPACE"); }
public function __construct() { parent::__construct(); check_session(); // jika session habis, redirect ke logout $this->load->model(array("Approve_Manager_Model", "Transaction_Model")); $this->_access = get_access("APPROVE_MANAGER"); auth($this->_access); // autentikasi menu apakah bisa diakses atau tidak }
public function __construct() { parent::__construct(); check_session(); // jika session habis, redirect ke logout $this->load->model(array("Order_Model", "Report_Model")); $this->_access = get_access("REPORT_UNAPPROVE"); auth($this->_access); // autentikasi menu apakah bisa diakses atau tidak }
public function __construct() { parent::__construct(); check_session(); // jika session habis, redirect ke logout $this->load->model(array("Brandcomm_Model", "Transaction_Model")); $this->_access = get_access("BRANDCOMM"); auth($this->_access); // autentikasi menu apakah bisa diakses atau tidak }
public function __construct() { parent::__construct(); check_session(); // jika session habis, redirect ke logout $this->load->model(array("Backdatereceive_Model", "Order_Model", "Transaction_Model")); $this->_access = get_access("BACKDATE_RECEIVE"); auth($this->_access); // autentikasi menu apakah bisa diakses atau tidak }
public function __construct() { parent::__construct(); check_session(); // jika session habis, redirect ke logout $this->load->model(array("Orderspace_Model", "Expiredspace_Model", "Order_Model", "Transaction_Model")); $this->_access = get_access("SPACE"); auth($this->_access); // autentikasi menu apakah bisa diakses atau tidak }
public function __construct() { parent::__construct(); check_session(); // jika session habis, redirect ke logout $this->load->model("Cpm_Model"); $this->_access = get_access("CPM"); auth($this->_access); // autentikasi menu apakah bisa diakses atau tidak }
public function __construct() { parent::__construct(); check_session(); // jika session habis, redirect ke logout $this->load->model(array("PO_Model", "Transaction_Model")); $this->load->helper(array('form', 'url')); $this->_access = get_access("PO"); auth($this->_access); // autentikasi menu apakah bisa diakses atau tidak }
public function update_batch() { check_session(); $post = $this->input->post(NULL, TRUE); $Id = $post['id']; $where = array('drug_batch_id' => $Id); unset($post['id']); $basicModel = load_basic_model('drug_batch'); $result = $basicModel->update($post, $where); if (count($result) > 0) { $this->session->set_flashdata('success', 'Operation successfully completed.'); } redirect(base_url('batch')); }
function is_session_set($broj) { if ($broj === 1) { $put = '../'; } else { if ($broj === 2) { $put = '../../'; } else { if ($broj === 3) { $put = '../../../'; } else { $put = ''; } } } if (isset($_SESSION['id'], $_SESSION['browser'])) { check_session($put); } else { header('Location: ' . $put); die; } }
require_once $syslog_mod_path . "/class/syslogDB.class.php"; require_once $syslog_mod_path . "/class/syslogXML.class.php"; # Get language $locale = $oreon->user->get_lang(); putenv("LANG={$locale}"); setlocale(LC_ALL, $locale); bindtextdomain("messages", $syslog_mod_path . "locale/"); bind_textdomain_codeset("messages", "UTF-8"); textdomain("messages"); /* * Get ACL */ $pearDB = new CentreonDB(); $pearDBndo = new CentreonDB("ndo"); $sid = session_id($_GET["sid"]); $contact_id = check_session($sid, $pearDB); $is_admin = isUserAdmin($sid); $access = new CentreonACL($contact_id, $is_admin); $aclHostString = $access->getHostsString("ID", $pearDBndo); /* * Get selected option in lists */ if (isset($_GET['collector_id']) && $_GET['collector_id'] != "") { $collector_id = $_GET['collector_id']; } else { $collector_id = ""; } if (isset($_GET['Ffacility']) && $_GET['Ffacility'] != "" && $_GET['Ffacility'] != "undefined") { $Ffacility_selected = $_GET['Ffacility']; } else { $Ffacility_selected = "";
<?php $in_id = $_GET['id']; include 'admin/config.php'; include 'admin/sessions/config.php'; $active = check_session(); if ($connect->connect_errno) { header('Location: docs.html#setup-problems'); exit; } $content_query = <<<SQL SELECT * FROM `content` SQL; $post_query = <<<SQL SELECT * FROM `posts` WHERE `id` = {$in_id} SQL; //error checking if (!($content_result = $connect->query($content_query))) { die('There was an error fetching content: ' . $connect->error . '. Oops'); } if (!($post_result = $connect->query($post_query))) { die('There was an error fetching posts: ' . $connect->error . '. Oops'); } ?> <!DOCTYPE html> <html> <head>
<?php require_once '../config.inc'; require_once 'functions.php'; check_session(0); require_once "{$path_prefix}/api/Theme/Template.php"; require_once "{$path_prefix}/api/Content/Content.php"; require_once "{$path_prefix}/api/User/User.php"; require_once "{$path_prefix}/api/ContentCollection/ContentCollection.php"; require_once '../api/Category/Category.php'; require_once '../api/MessageBoard/MessageBoard.php'; require_once '../ext/Group/Group.php'; require_once 'uihelper.php'; require_once './includes/application_top.php'; require_once './includes/functions/html_generate.php'; $parent_id = (int) $_GET['cid']; if (empty($parent_id)) { $redirect_msg = "Required parameters missing in URL."; $back_to_page = $base_url . '/forums.php'; header("Location: {$base_url}/generic_error.php?msg={$redirect_msg}&back_to_page={$back_to_page}"); exit; } if ($parent_id) { $group_id = ''; $parent_cat_obj = new Category(); $arr_obj_categories = Category::build_children_list($parent_id); $parent_cat_obj = new Category(); $parent_cat_obj->set_category_id($parent_id); try { $parent_cat_obj->load(); $parent_cat_name = stripslashes($parent_cat_obj->name);
$path_extra = dirname(dirname(dirname(__FILE__))); $path = ini_get('include_path'); $path = $path_extra . PATH_SEPARATOR . $path; ini_set('include_path', $path); require_once "Auth/OpenID.php"; /** * Data. */ $store_types = array("Filesystem" => "Auth_OpenID_FileStore", "MySQL" => "Auth_OpenID_MySQLStore", "PostgreSQL" => "Auth_OpenID_PostgreSQLStore", "SQLite" => "Auth_OpenID_SQLiteStore"); /** * Main. */ $messages = array(); session_start(); init_session(); if (!check_session() || isset($_GET['add_openid'])) { render_form(); } else { print generate_config(isset($_GET['download'])); } /** * Functions. */ function check_url($url) { return Auth_OpenID::normalizeUrl($url) !== null; } function build_url() { $port = $_SERVER['SERVER_PORT'] == 80 ? null : $_SERVER['SERVER_PORT']; $parts = explode("/", $_SERVER['SERVER_PROTOCOL']);
$lifeTime = 3600; setcookie(session_name(), session_id(), time() + $lifeTime, "/"); if (!isset($_SESSION['flag'])) { $_SESSION['flag'] = 0; $_SESSION['user'] = ""; } function check_session() { if (isset($_SESSION['flag']) && $_SESSION['flag'] == 1 && isset($_SESSION['user']) && $_SESSION['user'] != "") { return true; } else { return false; } } include "config/config.ini.php"; $smarty->assign("username", $_SESSION['user']); $smarty->assign("flag", $_SESSION['flag']); //自动导入class /* function __autoload($className) { require "kc_classes_php/".$className.'.class.php'; } */ if (!isset($_GET['p']) || !check_session()) { $p = "login"; $page = "control/login.php"; } else { $p = $_GET['p']; $page = "control/" . $p . ".php"; } include $page;
function __construct() { parent::__construct(); $this->load->model('model_barang'); check_session(); }
<?php include "../../lib/start.php"; check_session(POPUP_WINDOW); check_permission(ADM_PERM); $titolo = utf8_encode($_POST['titolo']); $testo = utf8_encode(nl2br($_POST['testo'])); switch ($_POST['action']) { case 1: // inserimento $statement = "INSERT INTO news (data, abstract, testo, utente) VALUES (NOW(), '{$titolo}', '{$testo}', " . $_SESSION['__user__']->getUID() . ")"; $msg = "News inserita correttamente"; break; case 2: // cancellazione $statement = "DELETE FROM news WHERE id_news = " . $_REQUEST['_i']; $msg = "Cancellazione eseguita correttamente"; break; case 3: // modifica $statement = "UPDATE news set data = NOW(), abstract = '{$titolo}', testo = '{$testo}' WHERE id_news = " . $_REQUEST['_i']; $msg = "News aggiornata correttamente"; break; } header("Content-type: text/plain"); try { $recordset = $db->executeUpdate($statement); } catch (MySQLException $ex) { print "ko|" . $ex->getMessage() . "|" . $ex->getQuery(); exit; }
function do_migration_checks() { $errors = 0; $check = check_php_version("../../info/"); $errors += $check['errors']; echo $check['msg']; $check = check_php_settings(); $errors += $check['errors']; echo $check['msg']; $check = check_db_loaded_extension('mysql'); $errors += $check['errors']; echo $check['msg']; $check = check_session(); $errors += $check['errors']; echo $check['msg']; $dirs_to_check = array('../../../gui/templates_c', '../../../logs'); $check = check_with_feedback($dirs_to_check); echo $check['msg']; $errors += $check['errors']; return $errors; }
die("want_side changed"); break; case "ping": ping(); die("pinged"); break; case "disconnect": delete_session($_SESSION["name"]); die("disconnected"); break; case "new_session": $_SESSION["name"] = $req_mess["name"]; $_SESSION["id"] = rand(100000, 999999); $_SESSION["enemy_connected"] = false; $_SESSION["turn"] = false; switch (check_session($_SESSION["name"])) { case "no_session": register_session($req_mess["name"]); fill_users_file($_SESSION["id"], false, $req_mess["want_side"]); die("session created"); break; case "good_session": fill_users_file($_SESSION["id"], false, $req_mess["want_side"]); die("entered to session"); break; case "too_many_users": die("too_many_users"); break; default: die("switch default"); }
function __construct() { parent::__construct(); $this->load->model('model_operator'); check_session(); }
<?php include "../../lib/start.php"; check_session(AJAX_CALL); check_permission(ADM_PERM); header("Content-type: text/plain"); $nome = trim($_POST['nome_flusso']); $num_step = $_POST['num_step']; $codice_step = $_POST['codice_step']; $gruppi = 0; foreach ($_POST['gruppi'] as $a) { $gruppi += $a; } switch ($_POST['action']) { case 1: // inserimento $statement = "INSERT INTO w_workflow (richiesta, num_step, codice_step, gruppi) VALUES ('" . $nome . "', {$num_step}, '{$codice_step}', {$gruppi})"; $msg = "La richiesta è stata registrata correttamente"; break; case 2: // cancellazione $statement = "DELETE FROM w_workflow WHERE id_workflow = " . $_POST['_i']; //print $statement; $msg = "La richiesta è stata cancellata correttamente"; break; case 3: // modifica $statement = "UPDATE w_workflow SET richiesta = '{$nome}', num_step = {$num_step}, codice_step = '{$codice_step}', gruppi = {$gruppi} WHERE id_workflow = " . $_POST['_i']; //print $statement; $msg = "Lo step è stato aggiornato correttamente"; break;
session_start(); if ($op == "logout") { header("Location: op_logout.php"); } if (!check_session()) { // Login if ($op != "register") { require_once "login.php"; } if ($op == "register") { include_once "components/login/register.php"; } } else { require_once "header.php"; require_once "components/menu/menu.php"; if (check_session()) { KeepAliveSession(); } $op = addslashes($_GET['op']); if ($op == "" || $op == "dashboard") { include_once "components/content/dashboard.php"; } if ($op == "list-datasets") { include_once "components/list-items/list-datasets.php"; } if ($op == "edit-dataset") { include_once "components/forms/edit-dataset.php"; } if ($op == "list-dataFormat") { include_once "components/list-items/list-dataFormat.php"; }
* Description: This file gets called from links module. It renders html * for the links(inner html) * The lastest version of PeopleAggregator can be obtained from: * http://peopleaggregator.org * For questions, help, comments, discussion, etc. please visit * http://wiki.peopleaggregator.org/index.php * TODO: Need to call here link module to generate inner html */ require_once dirname(__FILE__) . "/../config.inc"; $login_required = TRUE; // global var $path_prefix has been removed - please, use PA::$path static variable require_once 'web/includes/functions/functions.php'; require_once 'web/includes/uihelper.php'; require_once "api/Links/Links.php"; include_once "api/Validation/Validation.php"; check_session(1); $message = array(); if (!empty($_POST)) { filter_all_post($_POST); } /** * Deleting link(s) from a particular category. */ if (!empty($_POST) && $_POST['form_action'] == 'remove_links') { $Links = new Links(); $Links->link_id = explode(",", $_POST['link_id']); $Links->user_id = $_SESSION['user']['id']; try { $Links->delete_link(); $links_count = count($Links->link_id); $msg = $links_count > 1 ? $links_count . ' links have been' : '1 link has been';
function valid_admin() { global $U; if (isset($_REQUEST['session'])) { check_session(); } elseif (isset($_REQUEST['nick']) && isset($_REQUEST['pass'])) { create_session(true); } if (isset($U['status'])) { if ($U['status'] >= 7) { return true; } send_access_denied(); } return false; }
if (headers_sent()) { require_once AT_INCLUDE_PATH . 'classes/ErrorHandler/ErrorHandler.class.php'; $err = new ErrorHandler(); trigger_error('VITAL#<br /><code><strong>Headers already sent. ' . 'Cannot initialise session.</strong></code><br /><hr /><br />', E_USER_ERROR); exit; } $isHttps = !isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on" ? false : true; ob_start(); session_set_cookie_params(0, $_config["session_path"], "", $isHttps); session_start(); // Regenerate session id at every page refresh to prevent CSRF $valid_session = true; if (count($_SESSION) == 0) { regenerate_session(); } else { $valid_session = check_session(); } $str = ob_get_contents(); ob_end_clean(); unregister_GLOBALS(); // Re-direct to login page at a potential session hijack if (!$valid_session) { $_SESSION = array(); header('Location: ' . AT_BASE_HREF . 'login.php'); exit; } if ($str) { require_once AT_INCLUDE_PATH . 'classes/ErrorHandler/ErrorHandler.class.php'; $err = new ErrorHandler(); trigger_error('VITAL#<br /><code><strong>Error initializing session. ' . 'Please varify that session.save_path is correctly set in your php.ini file ' . 'and the directory exists.</strong></code><br /><hr /><br />', E_USER_ERROR); exit;
<?php /* KVM-VDI Tadas Ustinavičius tadas at ring.lt 2015-12-10 Vilnius, Lithuania. */ include 'functions/config.php'; require_once 'functions/functions.php'; if (!check_session()) { header("Location: {$serviceurl}/?error=1"); exit; } $vm = addslashes($_GET['vm']); $hypervisor = addslashes($_GET['hypervisor']); $action = addslashes($_GET['action']); if (empty($vm) || empty($hypervisor)) { exit; } $h_reply = get_SQL_line("SELECT * FROM hypervisors WHERE id='{$hypervisor}'"); ssh_connect($h_reply[2] . ":" . $h_reply[3]); if ($action == "mass_on" || $action == "mass_off" || $action == "mass_destroy") { $child_vms = get_SQL_array("SELECT name FROM vms WHERE source_volume='{$vm}'"); $x = 0; while ($child_vms[$x]['name']) { if ($action == "mass_on") { ssh_command("sudo virsh start " . $child_vms[$x]['name'], true); } if ($action == "mass_off") {
function index() { // $this->load->view('view_dashboard'); check_session(); $this->template->load('template', 'view_dashboard'); }
<?php include "../../../lib/start.php"; check_session(); check_permission(DOC_PERM); //$sel_alunni = "SELECT alunni.*, indirizzo, telefono1, telefono2, telefono3, email, messenger, blog FROM alunni LEFT JOIN indirizzi_alunni ON alunni.id_alunno = indirizzi_alunni.id_alunno LEFT JOIN profili_alunni ON indirizzi_alunni.id_alunno = profili_alunni.id_alunno WHERE id_classe = ".$_SESSION['__classe__']->get_ID()." ORDER BY cognome, nome"; $sel_alunni = "SELECT alunni.* FROM alunni WHERE id_classe = " . $_SESSION['__classe__']->get_ID() . " ORDER BY cognome, nome"; $res_alunni = $db->execute($sel_alunni); include "elenco_alunni.html.php";
<?php require_once 'settings.php'; $link = mysql_connect($db_server, $db_username, $db_password); if (!mysql_select_db($db_database)) { die(mysql_error()); } require_once 'session.inc.php'; $session_id = check_session(-1); $query = sprintf('UPDATE session SET is_verified=1 WHERE session_id=%d', $session_id); $result = mysql_query($query); if (!$result) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $query; die($message); } require 'checked_in.php';