function __construct(){
		
		if(!array_key_exists('username',$_POST)){
			die('The browser failed to send the right data. You may have a bad internet connection.');
		}
		if(session_check($_POST['username'])){
			$this->_filename = basename($_FILES['Filedata']['name']);
			if(!preg_match('/^[[:alnum:]]+_*\.*-*[[:alnum:]_\.-]*$/', $this->_filename)){
				die('You passed a file with an illegal filename. Try using only acii characters.');
			}
			$this->getExtension();
			$this->getPath();
			if(file_exists($this->_path.DS.$this->_filename)){
				if(move_uploaded_file($_FILES['Filedata']['tmp_name'], ROOT.DS.$this->_path.DS.$this->_filename.'.temp')){
					$path = str_replace(DS,'.',$this->_path);
					die('REPLACE/'.$path.'/'.$this->_filename);
				}
				else{
					die('The file '.$this->_filename.' already exists on the server. The server was unable to temporarily save the file to see if you wanted to replace the file. It is possible that you uploaded a file bigger than is allowed.');
				}
				
			}
			$this->copyFile();
		}
		else{
			die('Your session has expired. Please <a href="'.ADMIN_URL.'/logout" target="_self">login</a> again in order to upload your file.');
		}
	}
	function __construct() {
		if(session_check()) {
			if(array_key_exists('post',$_POST) && array_key_exists('title',$_POST) && array_key_exists('slug',$_POST) && array_key_exists('description',$_POST) && array_key_exists('template',$_POST) && array_key_exists('category',$_POST) && array_key_exists('author',$_POST) && array_key_exists('commentbool',$_POST) && array_key_exists('pingbacks',$_POST) && array_key_exists('publish',$_POST) && array_key_exists('pingbool',$_POST) && array_key_exists('cachepub',$_POST) && array_key_exists('postdate', $_POST) && array_key_exists('comments_date',$_POST)) {
				$this->_unlink = false;
				$this->_post = $_POST['post'];
				$this->_title = $_POST['title'];
				$this->_slug = $_POST['slug'] === '' ? '_index_' : $_POST['slug'] ;
				$this->_description = $_POST['description'];
				$this->_template = $_POST['template'];
				$this->_category = $_POST['category'];
				$this->_author = $_POST['author'];
				$this->_commentbool = $_POST['commentbool'] === 'true' ? true : false;
				$this->_pingbacks = $_POST['pingbacks'];
				$this->_publish = $_POST['publish'] === 'true' ? true : false;
				$this->_pingbool = $_POST['pingbool'] === 'true' ? true : false;
				$this->_rewrite = array_key_exists('rewrite',$_POST) ? true : false;
				$this->_cachepub = $_POST['cachepub'] === 'true' ? true : false;
				$pdate = explode('/',$_POST['postdate']);
				reset($pdate);
				$this->_postdate = mktime(intval($pdate[3]),intval($pdate[4]),0,intval($pdate[0]),intval($pdate[1]),intval($pdate[2]));
				$cdate = explode('/',$_POST['comments_date']);
				reset($cdate);
				$this->_commentsdate = mktime(intval($cdate[3]),intval($cdate[4]),0,intval($cdate[0]),intval($cdate[1]),intval($cdate[2]));
				$this->initialize();
			}
			else {
				die('The program failed to accurately POST data to the server. Error#0001');
			}
		}
		else {
			die('Your session has expired. Please <a href="'.ADMIN_URL.'/logout" target="_self">login</a> again in order to submit your post.');
		}
	}
	function __construct() {
		if(session_check()) {
			$this->_loc = str_replace('/',DS,$_POST['media']);
			$this->delete();
		}
		else{
			die('Your session has expired, please log back in.');
		}
	}
	function __construct() {
		if(session_check()) {
			if(array_key_exists('uri',$_POST)){
				$this->_uri = $_POST['uri'] !== '_index_' ? str_replace('_','/',$_POST['uri']) : '_index_';
				$this->_loc = $_POST['uri'] !== '_index_' ? str_replace('_',DS,$_POST['uri']) : '_index_';
				$this->unpublish();
			}
		}
	}
	function __construct($arr){
		if(session_check()){
			require(ROOT.DS.MAIN.DS.'library'.DS.'cron_jobs.php');
			array_push($cronJobs,$arr);
			$this->write($cronJobs);
		}
		else{
			die('Your session has expired, please log back in.');
		}
	}
	function __construct(){
		if(session_check()) {
			if(array_key_exists('action',$_POST) && array_key_exists('id',$_POST)){
				$this->_action = $_POST['action'];
				$this->_id = $_POST['id'];
				$this->actionParse();
			}
		}
		else{
			die('Your session has expired. Please <a href="'.ADMIN_URL.'/logout" target="_self">login</a> again in order to submit your post.');
		}
	}
	function __construct($post, $filter = 'ALL', $sort = 'none', $DESC = true){
		if(session_check()) {
			$this->_sort = $sort;
			$this->_DESC = $DESC;
			loadIntClass('sql_query');
			$sql = new Sql_query('comments');
			$this->_comments =  $sql->getComments($post,$filter);
		}
		else{
			die('Your session has expired. Please <a href="'.ADMIN_URL.'/logout" target="_self">login</a> again in order to submit your post.');	
		}
	}
	function __construct(){
		if(session_check()){	
			if(array_key_exists('author',$_POST)){
				$this->_author = $_POST["author"];
			}
			else{
				die('There was an error on the client. Your browser didn\'t send the appropriate information. Try refreshing the page.');
			}
		}
		else{
			die('Your session has expired. Please login again in order to add an author.');
		}
	}
	function __construct(){
		if(session_check()){	
			if(array_key_exists('category',$_POST)){
				$this->_category = $_POST["category"];
			}
			else{
				die('There was an error on the client. Your browser didn\'t send the appropriate information. Try refreshing the page.');
			}
		}
		else{
			die('Your session has expired. Please <a href="'.ADMIN_URL.'/logout" target="_self">login</a> again in order to add your category.');
		}
	}
Example #10
0
 function user_admin_check()
 {
     $a = session_check(false);
     if ($a && isAdminSite()) {
         $acp = $_SESSION['SESS_ACCESS_SITES'];
         if (in_array(SITENAME, $acp)) {
             return true;
         }
         return false;
     } else {
         return false;
     }
 }
	function __construct() {
		if(session_check()) {
			if(array_key_exists('uri',$_POST) && array_key_exists('template',$_POST)){
				$this->_uri = $_POST['uri'] !== '_index_' ? str_replace('_','/',$_POST['uri']): $_POST['uri'];
				$this->_template = $_POST['template'];
				$this->template();
			}
			else{
				die('Your browser did not send the right information. If you are working on an older browser please switch to a modern browser.');
			}
		}
		else{
			die('Your session has expired, please log back in.');
		}
	}
	function __construct(){
		if(session_check()){
			if(array_key_exists('action',$_POST)){
        			$this->_dir = ROOT.DS.MAIN.DS.'config'.DS;
					$this->_string = '<?php';
					$this->$_POST['action']();
			}
			else{
				die('The browser failed to send the right information. It is possible that you have a bad internet connection.');	
			}
		}
		else{
			die('Your session has expired.');	
		}
	}
	function __construct(){
		if(session_check()){
			if(array_key_exists('replace',$_POST) && array_key_exists('template', $_POST)){
				$this->_template = $_POST['template'];
				$this->_replace = $_POST['replace'] === 'true' ? true : false;
				$this->_path = ROOT.DS.MAIN.DS.'reflex'.DS.'templates'.DS;
				$this->db_check();
			}
			else{
				die('The browser failed to appropriately communicated with the server. Try reloading the page');
			}
		}
		else{
			die('Your session has expired. Please <a href="'.ADMIN_URL.'/logout" target="_self">login</a> again in order to replace your template.');
		}
	}
	function __construct(){
		if(array_key_exists('post',$_POST) && session_check()) {
			$this->_post = $_POST['post'] === 'AP' ? 'ALL' : $_POST['post'];
			if($this->_post !== '_index_'){
				str_replace('_','/',$this->_post);
			}
			$filter = $_POST['post'] === 'AP' ? array('pending','spam') : 'ALL';
			loadIntClass('get_comments');
			$comm = new Get_comments($this->_post, $filter);
			$this->_comments = $comm->commentsArr();
			echo $this->write();
			exit;
		}
		else{
			die('Your session has expired. Please <a href="'.ADMIN_URL.'/logout" target="_self">login</a> again in order to add your category.');
		}
	}
Example #15
0
 function getAPIListWhere($srcType, $authorCol = "creator,author")
 {
     $whr = "";
     if (session_check(false)) {
         if (checkUserRoles($srcType, "Allow Moderation Of All " . toTitle($srcType)) || $_SESSION['SESS_PRIVILEGE_ID'] <= 3) {
         } else {
             $authorCol = explode(",", $authorCol);
             foreach ($authorCol as $a => $b) {
                 $authorCol[$a] = "{$b} LIKE '%[{$_SESSION['SESS_USER_ID']}]'";
             }
             $whr .= " AND (" . implode(" OR ", $authorCol) . " OR approved='true')";
         }
     } else {
         $whr .= " AND approved='true'";
     }
     return $whr;
 }
function connect_to_db()
{
    session_check();
    $host_seg = "host=" . $_SESSION['userhost'] . " ";
    $port_seg = "port=" . $_SESSION['userport'] . " ";
    $dbname_seg = "dbname=" . $_SESSION['userpgname'] . " ";
    $username_seg = "user="******" ";
    $password_seg = "password="******"exception_error_handler");
    try {
        $db = pg_connect($host_seg . $port_seg . $dbname_seg . $username_seg . $password_seg);
    } catch (Exception $e) {
        echo "<pre>" . $e->getMessage() . "</pre>";
    }
    if (!$db) {
        echo "Unknown database connection error.";
    }
}
	function __construct($post = 'none') {
		if(session_check() || CRON_JOB) {
			if(array_key_exists('uri',$_POST) && $post === 'none'){
				$this->_uri = $_POST['uri'] !== '_index_' ? str_replace('_','/',$_POST['uri']) : '_index_';
				$this->_loc = $_POST['uri'] !== '_index_' ? str_replace('_',DS,$_POST['uri']) : '_index_';
				$this->republish();
			}
			else if($post !== 'none'){
				$this->_uri = $post;
				$this->_loc = str_replace('/',DS,$post);
			}
			else{
				die('Your browser did not send the right information. If you are working on an older browser please switch to a modern browser.');
			}
		}
		else{
			die('Your session has expired, please log back in.');
		}
	}
	function __construct(){
		if(!array_key_exists('username',$_POST)){
			die('You browser failed to send the right information to the server. This could be due to a bad internet connection.');
		}
		if(session_check($_POST['username'])){
			$this->_filename = basename($_FILES['Filedata']['name']);
			$this->_path = ROOT.DS.MAIN.DS.'reflex'.DS.'templates'.DS;
			if(substr_count($this->_filename, '.') === 1){
				$this->checkString();
			}
			else{
				$string = substr_count($this->_filename, '.') > 0 ? 'Please upload a file with only one extension.' : 'Your file must have at least one extension.';
				die($string);
			}
		}
		else{
			die('Your session has expired. Please <a href="'.ADMIN_URL.'/logout" target="_self">login</a> again in order to upload your template.');
		}
	}
	function __construct($uri){
		if(session_check()) {
			$this->_uri = $uri;
			loadIntClass('sql_query');
			$this->_query = new Sql_query('posts');
			$num =  $this->_query->numRows('slug',$this->_uri);
			if($num !== 0){
				$this->loadUp();
				$this->buffer();
				$this->outPut();
			}
			else{
				die('No such post exists in the database.');	
			}
		}
		else{
			die('Your session has expired. Please <a href="'.ADMIN_URL.'/logout" target="_self">login</a> again in order to submit your post.');	
		}
	}
	function __construct(){
		if(session_check()){
			if(array_key_exists('parent',$_POST) && array_key_exists('child',$_POST) && array_key_exists('replace',$_POST)){		$this->_path = str_replace('.',DS,$_POST['parent']);
				$this->_filename = $_POST['child'];
				if($_POST['replace'] === 'true'){
					$this->replace();
				}
				else{
					if(unlink(ROOT.DS.$this->_path.DS.$this->_filename.'.temp')){
						die('KILLED');
					}
				}
			}
			else{
				die('The browser didn\'t send the right information. It is possible that you have a choppy internet connection.');
			}
		}
		else{
			die('Your session has expired. Please <a href="'.ADMIN_URL.'/logout" target="_self">login</a> again in order to replace your file.');
		}
	}
Example #21
0
<?php

//主页
include_once '_approot.php';
include_once APPROOT . '/lib/header.php';
session_check(get_current_url());
$base = new PageBase(TEMPLATE, ' 个人记账系统', PageBase::$LAYOUT_COLUMN2_NARROWLEFT);
$base->setPgeSubTitle('日常收支表');
$base->setActiveMenuId('menuStatistic');
$base->addCss(array('/css/bootstrap-datepicker3.min.css'));
$base->addScript(array('/js/pbs/dateQuery.js', '/js/bootstrap-datepicker.min.js', '/js/locales/bootstrap-datepicker.zh-CN.min.js', '/js/pbs/Chart.min.js'));
$navPart = new NavPart();
$base->setNavPart($navPart);
$accountQuickListPart = new AccountQuickListPart();
$base->addPart(PageBase::$BODY_LEF, $accountQuickListPart);
$statisticBillPart = new StatisticBillPart();
$base->addPart(PageBase::$BODY_CENTER, $statisticBillPart);
$base->show();
Example #22
0
 /**
  * Dashboard - List of campaigns, all compaign if admin logged id
  * @param $offset integer, The param for pagination
  */
 public function dashboard($offset = 0)
 {
     session_check();
     $this->load->model('post_model');
     $user_id = $this->session->userdata('admin_login') === TRUE ? 0 : $this->session->userdata('user_id');
     $data['total_posts'] = $this->post_model->get_dashboard_list($user_id, GET_COUNT);
     $data['posts'] = $this->post_model->get_dashboard_list($user_id, GET_RECORDS, $offset);
     $data['pagination'] = create_admin_pagination_links('admin/dashboard', $data['total_posts']);
     $data['page_title'] = 'Dashboard';
     $data['view'] = 'dashboard';
     $this->load->view('template', $data);
 }
					<?php 
if (session_check()) {
    $staff_id = $_SESSION['id'];
    $db = new db();
    if ($db->security_check($staff_id)) {
        include 'code/includes/secure_1.php';
    }
}
?>
<!--End of the Secure Menu Items-->
				</ul>
			</nav>
<!--Login area for West Coast Auto Staff-->		
			<div id="login_panel">
				<?php 
if (session_check()) {
    include 'code/includes/logout_form.php';
} else {
    include 'code/includes/login_form.php';
}
?>
			</div>
		</div>
	</header>
	
<!--Description div will usually be a duplicate of the page title in larg-ish letters-->	
	<div id="description">
		<h1>
			Used Vehicles
		</h1>
	</div>
Example #24
0
<?php

if (!defined('ROOT')) {
    exit('No direct script access allowed');
}
session_check(true);
_css(array("jquery.tagit"));
_js(array("jquery.tagit", "validator", "jquery.form.min"));
loadHelpers('uicomponents');
loadModule("editor");
loadEditor("cleditor");
if (isset($_REQUEST['refid'])) {
    loadModuleLib('api', 'api');
    $apiDetails = getApiDetails($_REQUEST['refid']);
} else {
    $apiDetails['editable'] = true;
}
if ($apiDetails['editable'] == 'true') {
    ?>
<style>
.cleditorMain {
	height: auto !important;
}
</style>
<div class="container-fluid">
	<div class="row">
		<div class="col-lg-12">

			<form  name="apiForm" id="apiForm" class='apiForm' onsubmit="return validateForm('#apiForm');">
				<input type="hidden" name="id" id="id" value="<?php 
    if (isset($apiDetails['id'])) {
Example #25
0
					</h1>
		    </div>
		</div>
		<?php 
        break;
    default:
        if (isset($page[2])) {
            loadModule("guides");
        } elseif (isset($page[1])) {
            $_REQUEST['category'] = $page[1];
            loadModuleLib("guides", "list");
        } else {
            ?>
			<div class="container-fluid">
				<?php 
            if (session_check(false)) {
                ?>
				<div id='toolbar' class="text-right">
					<a href="<?php 
                echo _link("guides/create");
                ?>
">Create</a>
				</div>
				<?php 
            }
            ?>
				<div class="row">
			            <h1 class="title">
							<img class=logoimg src='<?php 
            echo loadMedia("logos/logo-128.png");
            ?>
Example #26
0
<?php
require_once(ROOT.DS.MAIN.DS.'library'.DS.'session_check.php');
require_once(ROOT.DS.MAIN.DS.'library'.DS.'session_create.php');
if($this->_postName !=='login' && (session_check() || session_create())) {
	if($this->_postName === '') {
		header("Cache-Control: no-cache");
		require(ROOT.DS.MAIN.DS.'reflex'.DS.'admin'.DS.'documents'.DS.'index.php');
	}
	else if(file_exists(ROOT.DS.MAIN.DS.'reflex'.DS.'admin'.DS.'documents'.DS.$this->_postName.'.php')) {
		header("Cache-Control: no-cache");
		require(ROOT.DS.MAIN.DS.'reflex'.DS.'admin'.DS.'documents'.DS.$this->_postName.'.php');
	}
	else if(file_exists(strtolower(ROOT.DS.MAIN.DS.'reflex'.DS.'admin'.DS.'documents'.DS.$this->_postName.'.php'))) {
		$pageURL = 'http';
		$pageURL .= '://'.THIS_DOMAIN.'/'.ADMIN_URL.'/'.strtolower($this->_postName);
		header ('HTTP/1.1 301 Moved Permanently');
  		header ('Location: '.$pageURL);
		exit;
	}
	else {
		$pageURL = 'http';
		$pageURL .= '://'.THIS_DOMAIN.'/'.ADMIN_URL;
		header ('HTTP/1.1 301 Moved Permanently');
  		header ('Location: '.$pageURL);
		exit;
	}
}
else {
	if($this->_postName === 'login') {
		header("Cache-Control: no-cache");
		require(ROOT.DS.MAIN.DS.'reflex'.DS.'admin'.DS.'documents'.DS.'login.php');
Example #27
0
<?php

include_once '_approot.php';
include_once APPROOT . '/lib/header.php';
session_check(null);
$method = $_REQUEST['method'];
switch ($method) {
    case 'initBillManageData':
        init_bill_manage_data();
        break;
    case 'getBillList':
        get_bill_list();
        break;
    case 'getBillRelatedList':
        get_bill_related_list();
        break;
    case 'getBill':
        get_bill();
        break;
    case 'updateBill':
        update_bill();
        break;
    case 'deleteBill':
        delete_bill();
        break;
    default:
        break;
}
/**
 * 初始化记账管理基本数据
 */
<?php
session_start();
include "../../inc/config.php";
session_check();
switch ($_GET["act"]) {
	case "in":
  
  
  
	$data = array("ID_PETUGAS"=>$_POST["ID_PETUGAS"],"TGL_MASUK"=>$_POST["TGL_MASUK"],"STATUS"=>$_POST["STATUS"],);
  
  
  
   
		$in = $db->insert("head_bhn_masuk",$data);
    
		if ($in=true) {
			echo "good";
		} else {
			return false;
		}
		break;
	case "delete":
    
    
    
		$db->delete("head_bhn_masuk","ID_BHN_MASUK",$_GET["id"]);
		break;
	case "up":
	 $data = array("ID_PETUGAS"=>$_POST["ID_PETUGAS"],"TGL_MASUK"=>$_POST["TGL_MASUK"],"STATUS"=>$_POST["STATUS"],);
   
Example #29
0
 function checkServiceSession($redirect = false)
 {
     return session_check($redirect);
 }