Ejemplo n.º 1
0
    if ($UploadResult) {
        $error = $UploadResult;
    } else {
        $success = "Uploading Succeedeed!";
    }
}
// when user submit an excel file: validate then call sumit_File function(located on top)
if (isset($_POST['fileSubmit'])) {
    if (!isset($_POST['user_id']) || $_POST['user_id'] == "") {
        $error = "Please Enter Vender ID.";
    } else {
        if (substr($_POST['user_id'], 0, 3) != 'AP-' && $_POST['user_id'] != 'admin') {
            $error = "The Seller ID is not correct. Seller ID shold be 'admin' or start with 'AP-'.";
        } else {
            $user_id = $_POST['user_id'];
            $result = submit_file($_FILES[new_file], $user_id, $owner);
            if ($result["status"]) {
                $error = $result["error"];
            } else {
                $success = $result["success"];
            }
            if (isset($result["warning"])) {
                $warning = $result["warning"];
            }
        }
    }
}
if (isset($_POST['user_id']) && $_POST['user_id'] != "") {
    $user_id = $_POST['user_id'];
}
?>
Ejemplo n.º 2
0
if (COM_isAnonUser()) {
    $submitter = 2;
    // yes, the Admin account
} else {
    $submitter = $_USER['uid'];
}
// extract version from file name
$g = basename($filename);
$p = explode('.', $g);
if (count($p) == 5) {
    array_pop($p);
    // drop .gz
    array_pop($p);
    // drop .tar
    $g = implode('.', $p);
    $p = explode('-', $g);
    if (count($p) == 2) {
        $version = $p[1];
    }
}
if (!isset($version)) {
    COM_displayMessageAndAbort(30, '', 403, 'Forbidden');
}
$title = 'Geeklog ' . $version;
$desc = "Geeklog {$version}\n(description goes here)\nmd5 checksum: {$md5}";
$url = 'http://www.geeklog.net/';
if (!submit_file($submitter, $filename, $title, $desc, $version, $url, 8)) {
    COM_displayMessageAndAbort(30, '', 403, 'Forbidden');
}
$display .= 'Done.';
COM_output($display);