示例#1
0
        $config = $_POST['sc'];
        foreach ($config as $key => $value) {
            expSettings::change($key, addslashes($value));
        }
    } else {
        // Initialize /conf/config
        $config = $_POST['sc'];
        $values = array('c' => $config, 'opts' => array(), 'configname' => 'Default', 'activate' => 1);
        expSettings::saveConfiguration($values);
    }
}
if (isset($_POST['install_sample'])) {
    $eql = BASE . $_POST['install_sample'] . ".eql";
    if (file_exists($eql)) {
        $errors = array();
        expFile::restoreDatabase($db, $eql, $errors, 0);
        $files = BASE . $_POST['install_sample'] . ".tar.gz";
        // only install if there was an eql file
        if (file_exists($files)) {
            include_once BASE . 'external/Tar.php';
            $tar = new Archive_Tar($files);
            // $dest_dir = BASE.'files/';
            // @mkdir($dest_dir);
            // if (file_exists($dest_dir)) {
            $return = $tar->extract(BASE);
            // }
        }
    }
    //		if (count($errors)) {
    //			echo gt('Errors were encountered populating the site database.').'<br /><br />';
    //			foreach ($errors as $e) echo $e . '<br />';
示例#2
0
# Copyright (c) 2004-2011 OIC Group, Inc.
# Written and Designed by James Hunt
#
# This file is part of Exponent
#
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
/** @define "BASE" "../../../../.." */
if (!defined('EXPONENT')) {
    exit('');
}
$errors = null;
$continue = URL_FULL . 'index.php?section=' . SITE_DEFAULT_SECTION;
expSession::clearAllUsersSessionCache();
$template = new template('importer', '_eql_results', $loc);
//GREP:UPLOADCHECK
if (!expFile::restoreDatabase($db, $_FILES['file']['tmp_name'], $errors)) {
    $template->assign('success', 0);
    $template->assign('errors', $errors);
} else {
    $template->assign('success', 1);
    $template->assign('continue', $continue);
}
$template->output();