Exemple #1
0
function UninstallationAborted()
{
    global $TMP_FOLDER;
    print TOOLS_MODULES_ERR_UNINSTALL . ".<br>\n";
    DeleteFilesInDirectory($TMP_FOLDER);
    EndHtml();
    exit;
}
Exemple #2
0
function InstallationAborted($msg = '', $action = '')
{
    global $TMP_FOLDER;
    switch ($action) {
        case 'patch':
            nc_print_status(($msg ? $msg . "<br>" : "") . TOOLS_PATCH_ERR_CANTINSTALL, "error");
            PatchForm();
            PatchList();
            break;
        case 'module':
            nc_print_status(($msg ? $msg . "<br>" : "") . TOOLS_MODULES_ERR_INSTALL, "error");
            break;
        case 'activation':
            nc_print_status($msg ? $msg : TOOLS_PATCH_ERROR, "error");
            nc_activation_show_form();
            break;
        default:
            nc_print_status($msg ? $msg : TOOLS_PATCH_ERROR, "error");
            break;
    }
    DeleteFilesInDirectory($TMP_FOLDER);
    EndHtml();
    exit;
}
Exemple #3
0
function ReadBackUP($backupfile, $images, $netcat_files, $sqldump, $modules, $dump, $netcat_template)
{
    global $HTTP_TEMPLATE_PATH, $DOCUMENT_ROOT, $SUB_FOLDER, $HTTP_FILES_PATH, $HTTP_ROOT_PATH, $HTTP_IMAGES_PATH, $TMP_FOLDER;
    if (!checkPermissions($HTTP_ROOT_PATH . "tmp/", $DOCUMENT_ROOT)) {
        return $err = ".";
    }
    $err = 0;
    if (!$dump) {
        if ($err = decompressDumpTGZ1($backupfile)) {
            return $err;
        }
    } else {
        if ($err = decompressDumpTGZ2($backupfile)) {
            return $err;
        }
    }
    //Unpack images
    if ($images) {
        if (!checkPermissions($HTTP_IMAGES_PATH, $DOCUMENT_ROOT)) {
            return $err = ".";
        }
        if (!nc_tgz_extract($TMP_FOLDER . "images.tgz", $DOCUMENT_ROOT . $SUB_FOLDER)) {
            $err = "Error while images extracting";
        }
    }
    //Unpack netcat_files
    if ($netcat_files) {
        if (!checkPermissions($HTTP_FILES_PATH, $DOCUMENT_ROOT)) {
            return $err = ".";
        }
        if (!nc_tgz_extract($TMP_FOLDER . "netcat_files.tgz", $DOCUMENT_ROOT . $SUB_FOLDER)) {
            $err = "Error while netcat_files extracting";
        }
    }
    if ($netcat_template) {
        if (!checkPermissions($HTTP_TEMPLATE_PATH, $DOCUMENT_ROOT)) {
            return $err = ".";
        }
        if (!nc_tgz_extract($TMP_FOLDER . "netcat_template.tgz", $DOCUMENT_ROOT . $SUB_FOLDER)) {
            $err = "Error while netcat_template extracting";
        }
    }
    //Restore MySQL dump
    if ($sqldump) {
        if (!SQLFromFile($TMP_FOLDER . "netcat.sql")) {
            $err = "Error while MySQL dump extracting";
        }
    }
    //Unpack modules
    if ($modules) {
        if (!checkPermissions($HTTP_ROOT_PATH . "modules/", $DOCUMENT_ROOT)) {
            return $err = ".";
        }
        if (!nc_tgz_extract($TMP_FOLDER . "modules.tgz", $DOCUMENT_ROOT . $SUB_FOLDER)) {
            $err = "Error while modules extracting";
        }
    }
    DeleteFilesInDirectory($TMP_FOLDER);
    return $err;
}
Exemple #4
0
     if ($ExecSQLResult['sqls']) {
         $PatchResult['sqls'] = str_replace("%COUNT", $ExecSQLResult['sqls'], TOOLS_PATCH_INFO_QUERIES_EXEC);
     }
     if ($CreatLinksResult['links']) {
         $PatchResult['links'] = str_replace("%COUNT", $CreatLinksResult['links'], TOOLS_PATCH_INFO_SYMLINKS_EXEC);
     }
     // result text
     if (!empty($PatchResult)) {
         $PatchResultText = join("\r\n", $PatchResult) . "\r\n";
     }
     // after action in install.inc.php
     if (function_exists("InstallPatchAfterAction")) {
         InstallPatchAfterAction();
     }
     // clear tmp folder
     DeleteFilesInDirectory($TMP_FOLDER);
     //удаление лишних полей
     $db->query("DELETE FROM `Settings` WHERE `Key`='InstallationID' OR `Key`='InstallationDateOut'");
     // информация о лицензии
     $db->query("UPDATE `Settings` SET `Value`='" . intval($license) . "' WHERE `Key`='ProductNumber'");
     $db->query("UPDATE `Settings` SET `Value`='" . $db->escape($activation_code) . "' WHERE `Key`='Code'");
     // patch installed OK
     nc_print_status(TOOLS_ACTIVATION_OK . ".", 'ok');
     break;
 case 5:
     BeginHtml($Title5, $Title5, "http://" . $DOC_DOMAIN . "/settings/patch/");
     $perm->ExitIfNotAccess(NC_PERM_PATCH, 0, 0, 0, 1);
     $UI_CONFIG->activeTab = 'path-info';
     $UI_CONFIG->headerText = TOOLS_ACTIVATION_INSTRUCTION;
     $UI_CONFIG->locationHash = '#tools.activation(5)';
     $for_activation = true;