Esempio n. 1
0
function backup_console()
{
    //(421)
    $base = 'msql/users/';
    $nod = $_SESSION['modsnod'];
    $f = $base . $nod . '_sav.php';
    $goto = '/?admin=console';
    if ($d = $_GET["newfrom_mods"]) {
        newmodfrom($d);
        select_mods($d);
    }
    if ($_GET["adopt_mods"]) {
        foreach ($_SESSION['prmb'] as $k => $v) {
            $vaue .= $v . '#';
        }
        update("qdu", "config", $vaue, "name", ses('qb'));
    }
    if ($_GET["backup_mods"]) {
        copy($base . $nod . '.php', $f);
    }
    if ($_GET["mk_default"]) {
        msq_copy('users', $nod, 'system', 'default_mods');
        msq_copy('users', $nod, 'users', 'public_mods_1');
        alert('system/default_mods;public_mods_1');
    }
    if ($_GET["restore_mods"]) {
        copy($f, $base . $nod . '.php');
        define_mods('');
        define_condition();
    }
    if ($_GET["refresh_mods"]) {
        define_mods('');
        define_condition();
    }
    if ($_GET["make_copy"]) {
        msq_copy('users', ses('qb') . '_mods_' . ses('prmb1'), 'users', $nod);
        define_mods('');
        define_condition();
    }
    if ($_GET["default_mods"]) {
        msq_copy('system', 'default_mods', 'users', $nod);
        define_mods('');
        define_condition();
    }
    $rt = array('backup' => 'save', 'restore' => 'left', 'refresh' => 'reload', 'copy' => 'copy', 'default' => 'file', 'mkdef' => 'export');
    foreach ($rt as $k => $v) {
        $rt[$k] = picto($v);
    }
    $ret = lkc('txtx" title="' . nms(94), $goto . '&backup_mods==', $rt['backup']);
    if (is_file($f)) {
        $ret .= lkc('txtx" title="' . nms(95), $goto . '&restore_mods==', $rt['restore']);
    }
    $ret .= lkc('txtx" title="' . nms(97), $goto . '&refresh_mods==', $rt['refresh']);
    if ($p1 = ses('prmb1')) {
        $ret .= lkc('txtx" title="' . nms(132) . ':' . $p1, $goto . '&make_copy==', $rt['copy']);
    }
    $ret .= lkc('txtx" title="' . nms(96), $goto . '&default_mods==', $rt['default']);
    if (auth(6)) {
        $ret .= lkc('txtx" title="' . nms(113), $goto . '&mk_default==', $rt['mkdef']) . ' ';
    }
    $ret .= hlpbt('console') . ' ';
    $ret .= msqlink('', ses('qb') . '_mods_' . prmb(1));
    $ret .= msqlink('system', 'admin_modules');
    return $ret . br();
}
Esempio n. 2
0
File: admin.php Progetto: philum/cms
function adm_params($curauth, $rep)
{
    $auth = ses('auth');
    $goto = '/?admin=params';
    $qb = ses('qb');
    req('boot,adminx');
    connect();
    //$db
    if ($auth > 6 && $_GET['m_cnfg'] == '=') {
        $mcfg = '&m_cnfg==';
        $f = 'params/_' . $db . '_config.txt';
        if (is_file($f)) {
            $prms = explode('#', read_file($f));
        }
        $arr = msql_read_prep('system', 'admin_config');
        $hl = 'lang_admin*config_';
    } else {
        $prms = $_SESSION['prmb'];
        $prmb = sql('config', 'qdu', 'v', 'name="' . ses('qb') . '"');
        $prms = explode('#', $prmb);
        $prms = prmb_defaults($prms);
        $arr = msql_read_prep('system', 'admin_params');
        $hl = 'lang_admin*params_';
    }
    if ($_GET['params'] == 'save' && $auth >= $curauth) {
        for ($i = 0; $i <= $_POST['valmax']; $i++) {
            $prms[$i] = $_POST['pms' . $i];
            $vaue .= $prms[$i] . '#';
        }
        if ($prms[1] != prmb(1) && !$_GET['m_cnfg']) {
            newmodfrom($prms[1]);
        }
        if ($_GET['m_cnfg'] == '=') {
            write_file($f, $vaue);
            update('qdu', 'struct', $vaue, 'name', $qb);
            master_params('params/_' . $db, $qd, $aqb, $subd);
            alert(lkt('txtyl', $f, $db . '_config'));
        } else {
            $_SESSION['prmb'] = $prms;
            update('qdu', 'config', $vaue, 'name', $qb);
        }
    }
    $sty = '" style="width:200px;';
    //read
    foreach ($arr as $t => $ak) {
        foreach ($ak as $i => $v) {
            if ($i != 22) {
                if ($valmax < $i) {
                    $valmax = $i;
                }
                $attr = array('name' => 'pms' . $i, 'style' => 'width:200px;');
                if ($i == 11 && !$_GET['m_cnfg']) {
                    //$r[$t].=menuder_form_kv(affect_auth($auth),'pms'.$i.$sty,$prms[$i],'kv');
                    $r[$t] .= select($attr, affect_auth($auth), 'kv', $prms[$i]);
                } elseif ($i == 25) {
                    $lc = 'msql/lang/';
                    $dirs = explore($lc, 'dirs', 1);
                    $dirs = str_replace($lc, '', $dirs);
                    //$r[$t].=menuder_form_kv($dirs,'pms'.$i.$sty,$prms[$i],'vv').' ';
                    $r[$t] .= select($attr, $dirs, 'vv', $prms[$i]);
                } elseif ($i == 21) {
                    $r[$t] .= txarea('pms' . $i, $prms[$i], 31, 5) . ' ';
                } else {
                    $r[$t] .= input2('text" size="34', 'pms' . $i, $prms[$i], '') . ' ';
                }
                $r[$t] .= btn('txtblc', $v) . ' ' . btn('txtsmall2', bubble('grey', 'popmsqt', $hl . $i, $i)) . br();
            }
        }
    }
    $r[$t] .= hidden('valmax', '', $valmax) . br();
    $ret = form($goto . $mcfg . '&params=save', make_tabs($r, 'prm') . input2('submit', 'Submit', nms(27), '')) . br();
    if ($auth > 6 && !$mcfg) {
        $ret .= lkc('txtbox', $goto . '&m_cnfg==', 'server') . ' ' . backup_config();
    }
    return $ret;
}