Beispiel #1
0
 /**
  * Closes storefront
  */
 protected function closeStore()
 {
     fn_set_store_mode('closed');
     if (fn_allowed_for('ULTIMATE')) {
         $company_ids = fn_get_all_companies_ids();
         foreach ($company_ids as $company_id) {
             fn_set_store_mode('closed', $company_id);
         }
     }
 }
        unset($_SESSION['uc_package']);
        $suffix = '.manage';
    }
    return array(CONTROLLER_STATUS_OK, "upgrade_center" . $suffix);
} elseif ($mode == 'check') {
    if (empty($_SESSION['uc_package']) && empty($_SESSION['uc_base_package'])) {
        fn_set_notification('E', __('error'), __('text_uc_upgrade_not_selected'));
        return array(CONTROLLER_STATUS_REDIRECT, "upgrade_center.manage");
    }
    $package_path = Registry::get('config.dir.upgrade') . $_SESSION['uc_package'] . '/package';
    fn_set_store_mode('closed');
    // close the store
    if (fn_allowed_for('ULTIMATE')) {
        $company_ids = fn_get_all_companies_ids();
        foreach ($company_ids as $company_id) {
            fn_set_store_mode('closed', $company_id);
        }
    }
    if (!empty($_SESSION['uc_base_package']) && is_file(Registry::get('config.dir.upgrade') . $_SESSION['uc_base_package'] . '/packages_info.xml') || !empty($_SESSION['uc_package']) && is_file(Registry::get('config.dir.upgrade') . $_SESSION['uc_package'] . '/packages_info.xml')) {
        if (empty($_SESSION['uc_base_package'])) {
            $_SESSION['uc_base_package'] = $_SESSION['uc_package'];
        }
        $packages_info = simplexml_load_file(Registry::get('config.dir.upgrade') . $_SESSION['uc_base_package'] . '/packages_info.xml', NULL, LIBXML_NOERROR);
        if (is_file(Registry::get('config.dir.upgrade') . $_SESSION['uc_base_package'] . '/stages.php')) {
            include Registry::get('config.dir.upgrade') . $_SESSION['uc_base_package'] . '/stages.php';
        } else {
            $stages = array();
        }
        $i = 0;
        foreach ($packages_info->item as $item) {
            $i++;
Beispiel #3
0
    if (empty($permission)) {
        fn_set_notification('W', fn_get_lang_var('warning'), fn_get_lang_var('access_denied'));
        $ajax->assign('return_status', $old_status);
        exit;
    }
    $result = db_query("UPDATE ?:{$table_name} SET status = ?s WHERE ?w", $_REQUEST['status'], array($_REQUEST['id_name'] => $_REQUEST['id']));
    if ($result) {
        fn_set_notification('N', fn_get_lang_var('notice'), fn_get_lang_var('status_changed'));
    } else {
        fn_set_notification('E', fn_get_lang_var('error'), fn_get_lang_var('error_status_not_changed'));
        $ajax->assign('return_status', $old_status);
    }
    exit;
    // Open/close the store
} elseif ($mode == 'store_mode') {
    fn_set_store_mode($_REQUEST['state']);
    $view->assign('settings', Registry::get('settings'));
    $view->display('bottom.tpl');
    exit;
} elseif ($mode == 'update_position') {
    if (preg_match("/^[a-z_]+\$/", $_REQUEST['table'])) {
        $table_name = $_REQUEST['table'];
    } else {
        die;
    }
    $id_name = $_REQUEST['id_name'];
    $ids = explode(',', $_REQUEST['ids']);
    $positions = explode(',', $_REQUEST['positions']);
    foreach ($ids as $k => $id) {
        db_query("UPDATE ?:{$table_name} SET position = ?i WHERE ?w", $positions[$k], array($id_name => $id));
    }
} elseif ($mode == 'get_upgrade') {
    $package = fn_uc_get_package_details($_REQUEST['package_id']);
    if (fn_uc_get_package($_REQUEST['package_id'], $_REQUEST['md5'], $package, $uc_settings) == true) {
        $_SESSION['uc_package'] = $package['file'];
        $suffix = '.check';
    } else {
        unset($_SESSION['uc_package']);
        $suffix = '.manage';
    }
    return array(CONTROLLER_STATUS_OK, "upgrade_center" . $suffix);
} elseif ($mode == 'check') {
    if (empty($_SESSION['uc_package'])) {
        return array(CONTROLLER_STATUS_REDIRECT, "upgrade_center.manage");
    }
    fn_add_breadcrumb(fn_get_lang_var('upgrade_center'), "upgrade_center.manage");
    fn_set_store_mode('closed');
    // close the store
    $xml = simplexml_load_file(DIR_UPGRADE . $_SESSION['uc_package'] . '/uc.xml', NULL, LIBXML_NOERROR);
    if (!empty($xml)) {
        $hash_table = $result = array();
        // Get array with original files hashes
        if (isset($xml->original_files)) {
            foreach ($xml->original_files->item as $item) {
                $hash_table[(string) $item['file']] = (string) $item;
            }
        }
        fn_uc_ftp_connect($uc_settings);
        fn_uc_create_skins(DIR_UPGRADE . $_SESSION['uc_package'] . '/package', $_SESSION['uc_package'], $skip_files, $custom_skin_files);
        fn_uc_check_files(DIR_UPGRADE . $_SESSION['uc_package'] . '/package', $hash_table, $result, $_SESSION['uc_package'], $custom_skin_files);
        $udata = $data = array();
        if (file_exists(DIR_UPGRADE . 'installed_upgrades.php')) {