Esempio n. 1
0
 TRACE_debug("FILE=" . $_FILES["sealpac"]);
 TRACE_debug("FILETYPES=" . $_FILETYPES["sealpac"]);
 $slp = "/var/sealpac/sealpac.slp";
 $slp_tmp = "/var/sealpac/sealpactmp.slp";
 $title = i18n("Update Language Pack");
 if ($_FILES["sealpac"] == "") {
     $title = i18n("Language Pack Upload Fail");
     $message = '"' . I18N("j", "The language pack image is invalid.") . '", ' . "'<a href=\"" . $referer . "\">" . i18n("Click here to return to the previous page.") . "</a>'";
 } else {
     if (fcopy($_FILES["sealpac"], $slp_tmp) != "1") {
         $title = i18n("Language Pack Upload Fail");
         $message = "'INTERNAL ERROR: fcopy() return error!'";
     } else {
         $langcode = sealpac($slp_tmp);
         if ($langcode != "") {
             if (fcopy($slp_tmp, $slp) != "1") {
                 $langcode = sealpac($slp);
                 $title = i18n("Language Pack Upload Fail");
                 $message = "'INTERNAL ERROR: fcopy() return error!'";
             } else {
                 $title = i18n("Update Language Pack");
                 $message = "'" . i18n("You have installed the language pack (\$1) successfully.", $langcode) . "', " . "'<a href=\"" . $referer . "\">" . i18n("Click here to return to the previous page.") . "</a>'";
                 fwrite(w, "/var/sealpac/langcode", $langcode);
                 set("/runtime/device/langcode", $langcode);
                 event("SEALPAC.SAVE");
             }
         } else {
             $langcode = sealpac($slp);
             $title = i18n("Language Pack Upload Fail");
             $message = "'" . I18N("j", "The language pack image is invalid.") . "', " . "'<a href=\"" . $referer . "\">" . i18n("Click here to return to the previous page.") . "</a>'";
         }
Esempio n. 2
0
                }
            }
        }
    }
} else {
    if ($_POST["ACTION"] == "langupdate") {
        TRACE_debug("ACTION=" . $_POST["ACTION"]);
        TRACE_debug("FILE=" . $_FILES["sealpac"]);
        TRACE_debug("FILETYPES=" . $_FILETYPES["sealpac"]);
        $slp = "/var/sealpac/sealpac.slp";
        $title = I18N("j", "Update Language Pack");
        if ($_FILES["sealpac"] == "") {
            $title = I18N("j", "Language Pack Upload Failed");
            $message = "'" . I18N("j", "Invalid language pack image.") . "', " . "'<a href=\"" . $referer . "\">" . I18N("j", "Click here to return to the previous page.") . "</a>'";
        } else {
            if (fcopy($_FILES["sealpac"], $slp) != "1") {
                $title = I18N("j", "Language Pack Upload Failed");
                $message = "'INTERNAL ERROR: fcopy() return error!'";
            } else {
                $langcode = sealpac($slp);
                if ($langcode != "") {
                    $message = "'" . I18N("j", "You have installed the language pack (\$1) successfully.", $langcode) . "', " . "'<a href=\"" . $referer . "\">" . I18N("j", "Click here to return to the previous page.") . "</a>'";
                    fwrite(w, "/var/sealpac/langcode", $langcode);
                    set("/runtime/device/langcode", $langcode);
                    event("SEALPAC.SAVE");
                } else {
                    $title = I18N("j", "Language Pack Upload Failed");
                    $message = "'" . I18N("j", "Invalid language pack image.") . "', " . "'<a href=\"" . $referer . "\">" . I18N("j", "Click here to return to the previous page.") . "</a>'";
                    unlink($slp);
                }
            }