Пример #1
0
    while ($row = $Sql->fetch_assoc($result)) {
        $activ = retrieve(POST, 'activ' . $row['id'], 0);
        $array_auth_all = Authorizations::auth_array_simple(ACCESS_MODULE, $row['id']);
        $Sql->query_inject("UPDATE " . DB_TABLE_MODULES . " SET activ = '" . $activ . "', auth = '" . addslashes(serialize($array_auth_all)) . "' WHERE id = '" . $row['id'] . "'", __LINE__, __FILE__);
    }
    $Cache->Generate_file('modules');
    $Cache->Load('modules', RELOAD_CACHE);
    import('core/menu_service');
    MenuService::generate_cache();
    redirect(HOST . SCRIPT);
} elseif ($uninstall) {
    if (!empty($_POST['valid_del'])) {
        $idmodule = retrieve(POST, 'idmodule', 0);
        $drop_files = retrieve(POST, 'drop_files', false);
        import('modules/packages_manager');
        switch (PackagesManager::uninstall_module($idmodule, $drop_files)) {
            case NOT_INSTALLED_MODULE:
                redirect(HOST . DIR . '/admin/admin_modules.php?error=incomplete#errorh');
                break;
            case MODULE_FILES_COULD_NOT_BE_DROPPED:
                redirect(HOST . DIR . '/admin/admin_modules.php?error=files_del_failed#errorh');
                break;
            case MODULE_UNINSTALLED:
            default:
                redirect(HOST . SCRIPT . $error);
        }
    } else {
        $idmodule = '';
        foreach ($_POST as $key => $value) {
            if ($value == $LANG['uninstall']) {
                $idmodule = $key;
Пример #2
0
     $CONFIG['search_max_use'] = 100;
     $CONFIG['html_auth'] = array('r2' => 1);
     $CONFIG['forbidden_tags'] = array();
     require_once 'functions.php';
     load_db_connection();
     $Sql->query_inject("UPDATE " . DB_TABLE_CONFIGS . " SET value = '" . addslashes(serialize($CONFIG)) . "' WHERE name = 'config'", __LINE__, __FILE__);
     $Sql->query_inject("INSERT INTO " . DB_TABLE_LANG . " (lang, activ, secure) VALUES ('" . strprotect($CONFIG['lang']) . "', 1, -1)", __LINE__, __FILE__);
     $info_theme = load_ini_file('../templates/' . $CONFIG['theme'] . '/config/', get_ulang());
     $Sql->query_inject("INSERT INTO " . DB_TABLE_THEMES . " (theme, activ, secure, left_column, right_column) VALUES ('" . strprotect($CONFIG['theme']) . "', 1, -1, '" . $info_theme['left_column'] . "', '" . $info_theme['right_column'] . "')", __LINE__, __FILE__);
     include '../kernel/framework/core/cache.class.php';
     include '../lang/' . $lang . '/main.php';
     $Cache = new Cache();
     import('modules/packages_manager');
     foreach ($DISTRIBUTION_MODULES as $module_name) {
         $Cache->load('modules', RELOAD_CACHE);
         PackagesManager::install_module($module_name, true, DO_NOT_GENERATE_CACHE_AFTER_THE_OPERATION);
     }
     $Cache->generate_file('modules');
     $Cache->load('modules', RELOAD_CACHE);
     import('core/menu_service');
     MenuService::enable_all(true);
     $modules_menu = MenuService::website_modules(VERTICAL_MENU);
     MenuService::move($modules_menu, BLOCK_POSITION__LEFT, false);
     MenuService::change_position($modules_menu, -$modules_menu->get_block_position());
     MenuService::save($modules_menu);
     $Cache->generate_all_files();
     $Cache->load('themes', RELOAD_CACHE);
     $Cache->Generate_file('css');
     $Sql->close();
     redirect(HOST . FILE . add_lang('?step=' . (STEP_SITE_CONFIG + 1), true));
 }
Пример #3
0
<?php

require_once '../admin/admin_begin.php';
define('TITLE', $LANG['administration']);
require_once '../admin/admin_header.php';
$install = !empty($_GET['install']) ? true : false;
if ($install) {
    $module_name = '';
    foreach ($_POST as $key => $value) {
        if ($value == $LANG['install']) {
            $module_name = str_replace('module_', '', $key);
        }
    }
    $enable_module = retrieve(POST, $module_name . 'activ', false);
    import('modules/packages_manager');
    switch (PackagesManager::install_module($module_name, $enable_module, GENERATE_CACHE_AFTER_THE_OPERATION)) {
        case CONFIG_CONFLICT:
            redirect(HOST . DIR . '/admin/admin_modules_add.php?error=e_config_conflict#errorh');
            break;
        case UNEXISTING_MODULE:
        case MODULE_ALREADY_INSTALLED:
            redirect(HOST . DIR . '/admin/admin_modules_add.php?error=incomplete#errorh');
            break;
        case PHP_VERSION_CONFLICT:
            redirect(HOST . DIR . '/admin/admin_modules_add.php?error=e_php_version_conflict#errorh');
            break;
        case MODULE_INSTALLED:
        default:
            redirect(HOST . DIR . '/admin/admin_modules.php');
    }
} elseif (!empty($_FILES['upload_module']['name'])) {