Beispiel #1
0
function makenew($qb, $restore = '')
{
    $qdu = ses('qdu');
    require 'styl.php';
    if (!auth(4)) {
        $_SESSION['auth'] = 4;
    }
    msq_copy("system", "default_css_1", 'design', $qb . '_design_1');
    msq_copy("system", "default_clr_1", 'design', $qb . '_clrset_1');
    msq_copy("system", "default_css_2", 'design', $qb . '_design_2');
    msq_copy("system", "default_clr_2", 'design', $qb . '_clrset_2');
    msq_copy("system", "default_mods", 'users', $qb . '_mods_1');
    msq_copy("system", "default_rstr", 'users', $qb . '_rstr');
    msq_copy("system", "default_apps", 'users', $qb . '_apps');
    if ($restore) {
        list($rstr, $config) = ndprms_defaults();
        update('qdu', 'rstr', $rstr, 'name', ses('qb'));
        update('qdu', 'config', $config, 'name', ses('qb'));
    }
    $clr = msql_read('system', 'default_clr_1', '');
    $css = 'css/' . $qb . '_design_1.css';
    build_css($css, css_default(1), $clr);
    $clr = msql_read('system', 'default_clr_2', '');
    $css = 'css/' . $qb . '_design_2.css';
    build_css($css, css_default(), $clr);
    update('qdu', 'menus', ses('dayx'), 'name', $qb);
    if (!is_dir('users/' . $qb)) {
        mkdir_r('users/' . $qb);
    }
    return $qb;
}
Beispiel #2
0
function backup_config()
{
    $f = 'params/' . ses('qb') . '_saveconfig.txt';
    $goto = '/?admin=' . $_GET["admin"];
    $ret .= lkc("popbt", $goto . '&backup_config==', "backup_config") . ' ';
    if (is_file($f)) {
        $ret .= lkc("popbt", $goto . '&restore_config==', "restore_config") . ' ';
    }
    $ret .= lkt("popbt", $f, "config") . ' ';
    if ($_SESSION["auth"] >= 5) {
        if ($_GET["backup_config"]) {
            $ret .= lkc("txtred", $goto . '&reset_config==', "!! default_config") . ' ';
            $tosave = implode("#", $_SESSION['prmb']);
            write_file($f, $tosave);
        }
        if ($_GET["restore_config"]) {
            $config = read_file($f);
            $_SESSION['prmb'] = explode('#', $config);
            update("qdu", "config", $config, "name", ses('qb'));
            $ret .= lkc("popdel", $goto, "old_config_restored");
            relod($goto);
        }
        if ($_GET["reset_config"]) {
            $prmdef = ndprms_defaults();
            $config = ses('qb') . $prmdef[1];
            $_SESSION['prmb'] = explode('#', $config);
            update("qdu", "config", $config, "name", ses('qb'));
            relod($goto);
        }
    }
    return $ret;
}