Beispiel #1
0
<?php

require_once 'common.php';
create_session();
$_SESSION['annmethod'] = '';
if (isset($_FILES['userfile']) && is_uploaded_file($_FILES['userfile']['tmp_name'])) {
    $_SESSION['plfile'] = sanitise_input_file(file_get_contents($_FILES['userfile']['tmp_name']));
    $_SESSION['stock'] = false;
    $_SESSION['filename'] = $_FILES['userfile']['name'];
    $_SESSION['stage'] = 2;
    redirect(isset($_POST['noedit']) ? 'upload.php' : 'open.php');
}
if (isset($_POST['stock'])) {
    $stock = "true";
    $stock_file = stock_file($_POST['filename'], '.pl');
    if ($stock_file == false) {
        die('bad stock file');
    }
    $_SESSION['plfile'] = file_get_contents($stock_file);
    $_SESSION['filename'] = $_POST['filename'];
    $_SESSION['stock'] = true;
    $_SESSION['stage'] = 2;
    redirect(isset($_POST['noedit']) ? 'upload.php' : 'open.php');
}
html_start('WebLogen - Open File', '', '', 1, '');
tooltip_js();
$default_tooltip_size = '300px';
// warn safari 2.0 users that things don't work
// look at following page for build numbers
// http://developer.apple.com/internet/safari/uamatrix.html
$agent = $_SERVER['HTTP_USER_AGENT'];
Beispiel #2
0
<?php

require_once 'common.php';
create_session();
if (isset($_POST['usertyped'])) {
    $_SESSION['plfile'] = sanitise_input_file($_POST['usertyped']);
    $filename = $_POST['filename'];
    // if the filename contains slashes get the part after the slashes
    $p = strrpos($filename, '/');
    if (is_int($p)) {
        $filename = substr($filename, $p);
    }
    $_SESSION['filename'] = $filename ? $filename : 'user.pl';
    $_SESSION['annerror'] = '';
    $_SESSION['logging'] = '';
    $_SESSION['editerror'] = '';
    $_SESSION['annfile'] = '';
    $_SESSION['filter'] = '';
    $_SESSION['filter_prop'] = '';
    $_SESSION['annmethod'] = '';
    $_SESSION['norm'] = '';
    $_SESSION['watch'] = '';
    $_SESSION['goal'] = '';
    $_SESSION['stock'] = $_POST['stockfile'];
    $_SESSION['stock_annfile'] = false;
    $_SESSION['stage'] = 2;
    if ($_SESSION['stock'] == "true") {
        $_SESSION['annmethod'] = 'stock';
    }
    if (isset($_POST['save'])) {
        redirect('get_pl.php');