You may contact the author/development team at:

    Chaos Networks
    c/o Werner Ammon
    Lerchenstr. 11c

    86343 Königsbrunn

    URL: http://www.chaos.de
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if ($environment[parameter][1] == "check") {
    $valid = array("jpg", "png", "pdf");
    foreach ($_FILES as $key => $value) {
        $file = file_verarbeitung($cfg["file"]["new"], $key, 2000000, $valid, $cfg["file"]["maindir"]);
        if ($file["returncode"] == 0) {
            rename($cfg["file"]["maindir"] . $cfg["file"]["new"] . $file["name"], $cfg["file"]["maindir"] . $cfg["file"]["new"] . $HTTP_SESSION_VARS["uid"] . "_" . $file["name"]);
        } else {
            $ausgaben["output"] .= "Ergebnis: " . $file["name"] . " ";
            $ausgaben["output"] .= file_error($file["returncode"]) . "<br>";
        }
    }
    if ($ausgaben["output"] == "") {
        header("Location: " . $cfg["basis"] . "/" . $environment["kategorie"] . ",add.html");
    } else {
        $ausgaben["output"] .= "<br><br><a href=\"" . $cfg["basis"] . "/" . $environment["kategorie"] . ",add.html\">Trotzdem weiter</a>";
        $mapping["main"] = "default1";
    }
} elseif ($environment[parameter][1] == "add") {
    $form_values = $HTTP_POST_VARS;
     $ausgaben["inaccessible"] = "";
 }
 // wohin schicken
 #n/a
 // +++
 // page basics
 if ($environment["parameter"][2] == "verify" && ($HTTP_POST_VARS["send"] != "" || $HTTP_POST_VARS["extension1"] != "" || $HTTP_POST_VARS["extension2"] != "")) {
     // form eigaben pr�fen
     form_errors($form_options, $HTTP_POST_VARS);
     // evtl. zusaetzliche datensatz anlegen
     if ($ausgaben["form_error"] == "") {
         // funktions bereich fuer erweiterungen
         // ***
         ### put your code here ###
         foreach ($_FILES as $key => $value) {
             $file = file_verarbeitung($cfg["file"]["base"]["new"], $key, $cfg["file"]["filesize"], $cfg["file"]["filetyp"], $cfg["file"]["base"]["maindir"]);
             if ($file["returncode"] == 0) {
                 rename($cfg["file"]["base"]["maindir"] . $cfg["file"]["base"]["new"] . $file["name"], $cfg["file"]["base"]["maindir"] . $cfg["file"]["base"]["new"] . $_SESSION["uid"] . "_" . $file["name"]);
             } else {
                 $ausgaben["form_error"] .= "Ergebnis: " . $file["name"] . " ";
                 $ausgaben["form_error"] .= file_error($file["returncode"]) . "<br>";
             }
         }
         if ($ausgaben["form_error"] == "") {
             header("Location: " . $cfg["fileed"]["basis"] . "/add," . $environment["parameter"][1] . ".html");
             exit;
             ### laut guenther wird es gebraucht, warum?
         } else {
             $ausgaben["form_error"] .= "<br><br><a href=\"" . $cfg["fileed"]["basis"] . "/add," . $environment["parameter"][1] . ".html\">Trotzdem weiter</a>";
             #$mapping["main"] = "default1";
         }
    Chaos Networks
    c/o Werner Ammon
    Lerchenstr. 11c

    86343 Königsbrunn

    URL: http://www.chaos.de
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if ($debugging[html_enable]) {
    $debugging[ausgabe] .= "[ ** {$script_name} ** ]" . $debugging[char];
}
$environment[basis] = $pathvars[virtual] . "/upload";
if ($environment[parameter][1] == "check") {
    $valid = array("zip", "pdf", "html");
    $file = file_verarbeitung("/my/upload", "upload1", 2000000, $valid);
    $ausgaben[output] .= "Filename: " . $file[name] . "<br><br>";
    $error = $file[returncode];
    if ($error == 0) {
        $ausgaben[output] .= "There is no error, the file uploaded with success.";
    } elseif ($error == 1) {
        $ausgaben[output] .= "The uploaded file exceeds the upload_max_filesize directive ( " . get_cfg_var(upload_max_filesize) . " ) in php.ini.";
    } elseif ($error == 2) {
        $ausgaben[output] .= "The uploaded file exceeds the MAX_FILE_SIZE ( " . $HTTP_POST_VARS[MAX_FILE_SIZE] . "kb ) directive that was specified in the html form.";
    } elseif ($error == 3) {
        $ausgaben[output] .= "The uploaded file was only partially uploaded.";
    } elseif ($error == 4) {
        $ausgaben[output] .= "No file was uploaded.";
    } elseif ($error == 7) {
        $ausgaben[output] .= "File Size to big.";
    } elseif ($error == 8) {
     $ausgaben["inaccessible"] = "";
 }
 // wohin schicken
 #n/a
 // +++
 // page basics
 if ($environment["parameter"][2] == "verify" && ($HTTP_POST_VARS["send"] != "" || $HTTP_POST_VARS["extension1"] != "" || $HTTP_POST_VARS["extension2"] != "")) {
     // form eingaben prüfen
     form_errors($form_options, $HTTP_POST_VARS);
     // evtl. zusaetzliche datensatz aendern
     if ($ausgaben["form_error"] == "") {
         // funktions bereich fuer erweiterungen
         // ***
         // file ersetzen
         if ($_FILES["upload"]["name"] != "") {
             $file = file_verarbeitung($pathvars["filebase"]["new"], "upload", $cfg["filesize"], array($form_values["ffart"]), $pathvars["filebase"]["maindir"]);
             if ($file["returncode"] == 0) {
                 $file_id = $form_values["fid"];
                 $source = $pathvars["filebase"]["maindir"] . $pathvars["filebase"]["new"] . $file["name"];
                 arrange($file_id, $source, $file["name"]);
             } else {
                 $ausgaben["form_error"] .= "Ergebnis: " . $file["name"] . " " . file_error($file["returncode"]);
             }
         }
         ### put your code here ###
         if ($error) {
             $ausgaben["form_error"] .= $db->error("#(error_result)<br />");
         }
         // +++
         // funktions bereich fuer erweiterungen
     }
 $element = form_elements($data_entries_file, $HTTP_POST_VARS);
 // form elemente erweitern
 if ($HTTP_POST_VARS[frefid] == "") {
     $element[frefid] = str_replace("frefid\" ", "frefid\" value=\"" . $environment[parameter][2] . "\"", $element[frefid]);
 }
 // was anzeigen
 $mapping[main] = crc32($environment[ebene]) . ".file";
 // wohin schicken
 $ausgaben[form_error] = "";
 $ausgaben[form_aktion] = $environment[basis] . "/file,new,verify.html";
 $ausgaben[form_break] = $_SERVER["HTTP_REFERER"];
 if ($environment[parameter][2] == "verify") {
     // datei verwaltung/save begin
     // ***
     $valid = array("zip", "pdf");
     $file = file_verarbeitung($file_path, "ffname", 4000000, $valid);
     $HTTP_POST_VARS[ffname] = $file[name];
     $HTTP_POST_VARS[ftname] = crc32($environment[ebene]) . "." . $environment[name];
     $error = $file[returncode];
     if ($error == 0) {
         #$ausgaben[form_error] .= "There is no error, the file uploaded with success.";
     } elseif ($error == 1) {
         $ausgaben[form_error] .= "The uploaded file exceeds the upload_max_filesize directive ( " . get_cfg_var(upload_max_filesize) . " ) in php.ini.<br>";
     } elseif ($error == 2) {
         $ausgaben[form_error] .= "The uploaded file exceeds the MAX_FILE_SIZE ( " . $HTTP_POST_VARS[MAX_FILE_SIZE] . "kb ) directive that was specified in the html form.<br>";
     } elseif ($error == 3) {
         $ausgaben[form_error] .= "The uploaded file was only partially uploaded.<br>";
     } elseif ($error == 4) {
         $ausgaben[form_error] .= "No file was uploaded.<br>";
     } elseif ($error == 7) {
         $ausgaben[form_error] .= "File Size to big.<br>";
     $ausgaben["inaccessible"] = "";
 }
 // wohin schicken
 #n/a
 // +++
 // page basics
 if ($environment["parameter"][2] == "verify" && ($HTTP_POST_VARS["send"] != "" || $HTTP_POST_VARS["extension1"] != "" || $HTTP_POST_VARS["extension2"] != "")) {
     // form eigaben prüfen
     form_errors($form_options, $HTTP_POST_VARS);
     // evtl. zusaetzliche datensatz anlegen
     if ($ausgaben["form_error"] == "") {
         // funktions bereich fuer erweiterungen
         // ***
         ### put your code here ###
         foreach ($_FILES as $key => $value) {
             $file = file_verarbeitung($pathvars["filebase"]["new"], $key, $cfg["filesize"], $cfg["filetyp"], $pathvars["filebase"]["maindir"]);
             if ($file["returncode"] == 0) {
                 rename($pathvars["filebase"]["maindir"] . $pathvars["filebase"]["new"] . $file["name"], $pathvars["filebase"]["maindir"] . $pathvars["filebase"]["new"] . $_SESSION["uid"] . "_" . $file["name"]);
             } else {
                 $ausgaben["form_error"] .= "Ergebnis: " . $file["name"] . " ";
                 $ausgaben["form_error"] .= file_error($file["returncode"]) . "<br>";
             }
         }
         if ($ausgaben["form_error"] == "") {
             header("Location: " . $cfg["basis"] . "/add," . $environment["parameter"][1] . ".html");
             exit;
             ### laut guenther wird es gebraucht, warum?
         } else {
             $ausgaben["form_error"] .= "<br><br><a href=\"" . $cfg["basis"] . "/add," . $environment["parameter"][1] . ".html\">Trotzdem weiter</a>";
             #$mapping["main"] = "default1";
         }