function updateSession() { global $db, $_SESS; $db->query('UPDATE sessions SET sess_expires = \'' . (time() + SESSION_EXPIRE) . '\', sess_uid = \'' . $_SESS['sess_uid'] . '\' WHERE sess_key = \'' . $_SESS['sess_key'] . '\''); readSession($_SESS['sess_key']); }
} } else { DEFINE("USER", str_replace("\\", "_", $_SERVER['AUTH_USER'])); } DEFINE("IMGPATH", ""); DEFINE("FILEPATH", "comp/" . USER . "/"); DEFINE("COMPILATIONS_PATH", "comp/" . USER . "/"); // DEFINE("ADL_PATH_ABS","/Users/basj/ADL_ou/"); // passthru ('PATH=$PATH:'.ADL_PATH_ABS);// or exit('error:Cannot set PATH directive using exec'); session_start(); require "inc/Session.inc.php"; require "inc/Bestand.inc.php"; require "inc/Actie.inc.php"; require "inc/Operatie.inc.php"; require "inc/connectToDataBase.inc.php"; $ses = readSession($_SESSION["adlsessie"]) or exit('error:Cannot find session, ensure cookies are enabled'); // if($ses->get_ip()!=$_SERVER['REMOTE_ADDR']){ // exit('error:Cannot find a session for your IP, ensure cookies are enabled'); // } $file = readBestand($ses->get_file()) or exit('error:Cannot find the file to compile. Upload a file first'); if (!isset($_REQUEST['op'])) { exit('error:Variable \'op\' not given'); } else { $op = $_REQUEST['op']; } $opr = readOperatie($op) or exit('error:Operation op=\'' . $op . '\' unknown'); $target = escapeshellcmd(COMPILATIONS_PATH . $file->getId() . '_' . $op . '/'); $source = escapeshellcmd(FILEPATH . $file->getId() . '.adl'); $compileurl = '' . sprintf($opr->get_outputURL(), $target, $source, $file->getId(), USER); // function ok($i){ // return '<A HREF="'.COMPILATIONS_PATH.$i.'/"><IMG SRC="'.IMGPATH.'ok.png" /></A>';
} $buttons = ""; if (isset($_REQUEST['new'])) { $new = true; } else { $new = false; } if (isset($_REQUEST['edit']) || $new) { $edit = true; } else { $edit = false; } $del = isset($_REQUEST['del']); if (isset($_REQUEST['Session'])) { if (!$del || !delSession($_REQUEST['Session'])) { $Session = readSession($_REQUEST['Session']); } else { $Session = false; } // delete was a succes! } else { if ($new) { $Session = new Session(); } else { $Session = false; } } if ($Session) { writeHead("<TITLE>Session - VIRO - ADL Prototype</TITLE>" . ($edit ? '<SCRIPT type="text/javascript" src="edit.js"></SCRIPT>' : '<SCRIPT type="text/javascript" src="navigate.js"></SCRIPT>') . "\n"); if ($edit) { echo '<FORM name="editForm" action="' . $_SERVER['PHP_SELF'] . '" method="POST" class="Edit">';
onmouseover="return overlib('<?php echo SESSIELADEN; ?> ',WIDTH, 350,ABOVE);" onmouseout="return nd();"> <?php echo '<IMG SRC="' . IMGPATH . 'info.png" />'; ?> </a> </H3> <p>Scriptversie <select name="sessie"><?php $myscripts = array(); if ($usr = readGebruiker($ses->get_gebruiker())) { //ignore sessions/files which cannot be found foreach ($usr->get_sessies() as $sesid) { if ($sesi = readSession($sesid)) { if ($sesf = readBestand($sesi->get_file())) { $myscripts += array($sesf->getId() => '<option value="' . $sesid . '">' . $sesf->get_path() . ' (' . $sesf->getId() . ')</option>'); } } } if (ksort($myscripts)) { echo print_r(array_reverse($myscripts, true)); } } ?> </select></p><br> <P><input type="submit" name="adlsessie" value="Script laden" /></P> </td> </tr></table> </FORM>