Example #1
0
 /**
  * Starts the session.
  *
  * @return bool success
  */
 public function start()
 {
     $default = ini_get('max_execution_time');
     set_time_limit($this->acquiretimeout);
     $result = parent::start();
     set_time_limit($default);
     return $result;
 }
Example #2
0
 /**
  * Terminate give session unconditionally.
  * @param string $sid
  */
 public static function kill_session($sid)
 {
     global $DB;
     self::load_handler();
     if ($sid === session_id()) {
         self::write_close();
     }
     self::$handler->kill_session($sid);
     $DB->delete_records('sessions', array('sid' => $sid));
 }
Example #3
0
<?php

/* Load the engine's code */
$__loader = array('log', 'classloader', 'version', 'game', 'tick', 'config', 'db_connection', 'db_accessor', 'db', 'library', 'actions', 'data_tree', 'input', 'ajax', 'handler', 'engine', 'resource', 'tracking', 'session', 'account', 'prefs', 'output');
require_once "../scripts/loader.inc";
/* Identify game version, requested page and engine type, then read request
 * data */
list($sitePath, $page, $eType) = input::identify();
$input = input::read();
/* Load page handler */
handler::load();
/* Load the engine */
engine::load();
/* Connect to the DB */
dbConnect();
/* Set up tracking cookie */
tracking::init();
/* Handle requests */
handleInput();
<?php

include "../php/handler.php";
include "../php/scheduler.php";
include "../php/result.php";
$bts_scheduler = new scheduler();
$bts_handler = new handler();
$bts_handler->connect();
$bts_handler->delete_old();
$fehlerDummy = '';
$fehlerRandom = '';
$fehlerRR = '';
$fehlerScheduler = '';
$fehler = false;
if (isset($_POST['senden'])) {
    if ($_POST['senden'] == 'Speichern') {
        if (isset($_POST['name']) && !is_array($_POST['name']) && $_POST['name'] == '') {
            $fehlerDummy .= '<a>Bitte geben Sie einen Namen ein.</a><br />';
            $fehler = true;
        }
        if (!(isset($_POST['cpulaufzeit']) && !is_array($_POST['cpulaufzeit']) && $_POST['cpulaufzeit'] != '' && $_POST['cpulaufzeit'] + 0 > 0 && $_POST['cpulaufzeit'] + 0 < 501)) {
            $fehlerDummy .= '<a>Bitte geben Sie eine CPU Laufzeit von 0 bis max.500 ein. </a><br />';
            $fehler = true;
        }
        if (!(isset($_POST['ankunftszeit']) && !is_array($_POST['ankunftszeit']) && $_POST['ankunftszeit'] != '' && $_POST['ankunftszeit'] + 0 > 0 && $_POST['ankunftszeit'] + 0 < 101)) {
            $fehlerDummy .= '<a>Bitte geben Sie eine Ankunfzeit von 1 bis max.100 ein. </a><br />';
            $fehler = true;
        }
        if (!(isset($_POST['prioritaet']) && !is_array($_POST['prioritaet']) && $_POST['prioritaet'] != '' && $_POST['prioritaet'] + 0 > 0 && $_POST['prioritaet'] + 0 < 101)) {
            $fehlerDummy .= '<a>Bitte geben Sie eine Priorität von 0 bis max.100 ein. </a><br />';
            $fehler = true;
Example #5
0
<?php
	session_start();
	$userid = isset($_SESSION['userid'])?$_SESSION['userid']:0;
	header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
	header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
	header('Cache-Control: no-cache, must-revalidate');
	header('Pragma: no-cache');
	header('Content-Type: text/javascript');
	if ($userid){
		include_once("config_sistem.php");
		include_once("class/mssql.inc.php"); 
		include_once("class/class.handler.php"); 
		$handler = new handler(true); 
		$page = isset($_POST['page'])?$_POST['page']:0; 	
		if ($page){
			
			$id = explode(".",$page); 
			$js = $handler->gethandler($id[1]); 
			if ($js)
				if (file_exists("app/view_js/$js")){
					$role = $handler->getEvent($id[1]); 
					if ($role)
						echo "ROLE = Ext.decode('".$role."');\n"; 
					$result = file_get_contents("app/view_js/$js");
					echo stripslashes(trim($result)); 
				}
		}
	}
 ?>
 /**
  * Start the session.
  * @return bool success
  */
 public function start()
 {
     // NOTE: memcached <= 2.1.0 expires session locks automatically after max_execution_time,
     //       this leads to major difference compared to other session drivers that timeout
     //       and stop the second request execution instead.
     $default = ini_get('max_execution_time');
     set_time_limit($this->acquiretimeout);
     $result = parent::start();
     set_time_limit($default);
     return $result;
 }
Example #7
0
 /** Class Constructor
  * 
  * @param handler $db
  * @param int $id
  * @param int $store_dbid
  */
 function __construct($db)
 {
     $this->db = $db;
     $this->input = $db->input_factory();
     //$this->set_Inactive();
 }
Example #8
0
<?php
	session_start();
	$userid = isset($_SESSION['userid'])?$_SESSION['userid']:0;
	if ($userid){
		include_once("config_sistem.php");
		include_once("class/mssql.inc.php"); 
		include_once("class/class.grid.php");
		include_once("class/class.handler.php"); 
		$handler = new handler(true); 
		$id = isset($_GET['id'])?$_GET['id']:0;
		if ($id){
			$id = explode(".",$id);
			$ajax = $handler->getAjax($id[1]); 
			if ($ajax)
				if (file_exists("app/controller/$ajax")){
                                        include_once 'app/config/config.db.php';
					include_once("app/controller/$ajax");
				}
		}
	}
?> 
 /**
  * Write to log
  *
  * @param   mixed $object
  * @param   int   $level
  * @return  void
  */
 public function write($object, $level = \Slim\Log::DEBUG)
 {
     $this->handler->debug($object, $this->get_log_level($level));
 }
Example #10
0
        $temp = explode('-', $val);
        return $temp[0];
    }
    function addNull($val){
        $tmp = $val;
        if (is_numeric($val)){
            $num = $val + 0;
            if ($num <10)
                $tmp = "0". $num;
        }
        return $tmp;
    }

        if ($userid){
		include_once("config_sistem.php");
		include_once("class/mssql.inc.php"); 
		include_once("class/class.grid.php");
		include_once("class/class.handler.php");
		$handler = new handler(true); 
		$id = isset($_GET['id'])?$_GET['id']:0;
		if ($id){
			$id = explode(".",$id);
			$report = $handler->getReport($id[1]); 
			if ($report)
				if (file_exists("app/report/$report")){
                    include_once 'app/config/config.db.php';
					include_once("app/report/$report");
				}
		}
	}
?>
Example #11
0
 public function fileConvertAndUpdate()
 {
     $dir = "../files/";
     $num = 0;
     $documents_group = scandir($dir);
     foreach ($documents_group as $key => $value) {
         if ($value != "." && $value != "..") {
             $handler = new handler($dir, $value);
             if ($handler->getFileType() != NULL) {
                 try {
                     $document = Document::create(array('path' => $handler->getPath(), 'fileName' => $handler->getFileName(), 'fileType' => $handler->getFileType(), 'systemName' => $handler->getSystemName(), 'airlineName' => $handler->getAirlineName(), 'ticketNumber' => $handler->getTicketNumber(), 'dateString' => $handler->getDateString(), 'orderOfDay' => $handler->getOrderOfDay(), 'fileContent' => $handler->getFileContent(), 'dateOfFile' => $handler->getDateOfFile(), 'paxName' => $handler->getPaxName(), 'rloc' => $handler->getRloc(), 'ticketsType' => $handler->getTicketsType()));
                     $document->save();
                     $num++;
                     rename($dir . $value, "../done/" . $value);
                 } catch (Exception $e) {
                     $response['info'] = "fail";
                     $boolean = false;
                     echo $e;
                 }
             }
         }
     }
     //echo $num." files have been converted."; die;
     return $num;
 }
Example #12
0
<?php

include 'init.php';
ini_set("display_errors", true);
error_reporting(E_ALL);
$_POST = json_decode(file_get_contents('php://input'), true);
//simple ajax handler
$method = $_POST["method"];
$data = $_POST["data"];
$handler = new handler();
$handler->exec($method, $data);
class handler
{
    public function exec($method, $data)
    {
        $result = self::$method($data);
        self::sendResponse($result);
    }
    public function sendResponse($response)
    {
        $res = array();
        $res["result"] = $response;
        echo json_encode($res);
        exit;
    }
    private function getJobStatus($jobHash)
    {
        return self::getRow("job", "hash", $jobHash);
    }
    private function hasOngoingBackups($data)
    {
Example #13
0
<?
	include("../../php/handler.php");
	$bts_handler = new handler();
	$bts_handler->connect();
	
	function get_process_with_highest_priority($processes) {		
		$currentMax = 0;
		foreach ($processes as $value) {
			if($value->priority > $currentMax) {
				$result = $value;
				$currentMax = $value->priority;
			}
		}
		return $result;
	}
		
	$processes = $bts_handler->get_processes();
	$executionText = "";
	//Erste CPU-Runde
	$tick = 0;
	while(true) {
		//Prozesse suchen, die momentan schon da sind
		$currentProcesses = $processes->get_processes_with_remaining_runtime();
		//wenn keine Prozesse mehr vorhanden -> ABBRUCH		
		if(count($currentProcesses) === 0) {
			break;
		}
		//Prozess suchen, der höchste Priorität hat
		$currentProcess = get_process_with_highest_priority($currentProcesses);		
		//Prozess ausführen
		$currentProcess->remaining_runtime = $currentProcess->remaining_runtime - 1;
Example #14
0
 /**
  * Start the session.
  * @return bool success
  */
 public function start()
 {
     // NOTE: memcached before 2.2.0 expires session locks automatically after max_execution_time,
     //       this leads to major difference compared to other session drivers that timeout
     //       and stop the second request execution instead.
     $default = ini_get('max_execution_time');
     set_time_limit($this->acquiretimeout);
     $isnewsession = empty($_COOKIE[session_name()]);
     $starttimer = microtime(true);
     $result = parent::start();
     // If session_start returned TRUE, but it took as long
     // as the timeout value, and the $_SESSION returned is
     // empty when should not have been (isnewsession false)
     // then assume it did timeout and is invalid.
     // Add 1 second to elapsed time to account for inexact
     // timings in php_memcached_session.c.
     // @TODO Remove this check when php-memcached is fixed
     // to return false after key lock acquisition timeout.
     if (!$isnewsession && $result && count($_SESSION) == 0 && microtime(true) - $starttimer + 1 >= floatval($this->acquiretimeout)) {
         $result = false;
     }
     set_time_limit($default);
     return $result;
 }
Example #15
0
<?php

function au($class)
{
    eval('class handler {
                  function handle($e) {
                      echo $e->getMessage()."\\n";
                  }
              }');
}
function __autoload($class)
{
    au($class);
}
//spl_autoload_register('au');
set_exception_handler(function ($exception) {
    $h = new handler();
    $h->handle($exception);
});
throw new Exception('exception');
Example #16
0
 /** Class constructor
  * 
  * @param handler $db
  * @param number $store_dbid
  * @param number $franchiser_id
  */
 function __construct($db)
 {
     $this->db = $db;
     $this->input = $db->input_factory();
 }
<?
	include("../php/handler.php");
	$bts_handler = new handler();
	$bts_handler->connect();
	$bts_handler->delete_old();
	
	if(isset($_POST['method'])){
		if($_POST['method'] == "save_process"){
			$bts_handler->create_process($_POST['name'], $_POST['cpulaufzeit'], $_POST['ankunftszeit'], $_POST['prioritaet']);
		}
		else if($_POST['method'] == "delete_list"){
			$bts_handler->reset_processlist();
		}
		else if($_POST['method'] == "random"){
			if($_POST['anzahl'] <= 1000){
				$bts_handler->random_processes($_POST['anzahl']);
			}
		}
	}
	
?>
<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>BTS Creative Labs</title>
        <link href="../css/main.css" rel="stylesheet" type="text/css">
    </head>
    <body>
        <div id="wapper">
            <div id="head">