Beispiel #1
0
function dowork()
{
    global $db;
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    if ($canIhaveAccess == 1) {
        if (is_writable('../settings.php') == 0) {
            die("Error: settings.php is not writeable.");
        }
        $action = isset($_REQUEST['action']) && sanitize($_REQUEST['action'], 3) != '' ? sanitize($_REQUEST['action'], 3) : "view";
        if ($action == "view") {
            $config = new pliggconfig();
            if (isset($_REQUEST['page'])) {
                $config->var_page = sanitize($_REQUEST['page'], 3);
                $config->showpage();
            } else {
                $config->listpages();
            }
        }
        if ($action == "save") {
            $config = new pliggconfig();
            $config->var_id = substr(sanitize($_REQUEST['var_id'], 3), 6, 10);
            $config->var_value = $db->escape($_REQUEST['var_value']);
            $config->store();
        }
    }
}
Beispiel #2
0
function dowork()
{
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    if ($canIhaveAccess == 1) {
        if (is_writable('settings.php') == 0) {
            die("Error: settings.php is not writeable.");
        }
        if (isset($_REQUEST['action'])) {
            $action = $_REQUEST['action'];
        } else {
            $action = "view";
        }
        if ($action == "view") {
            $config = new pliggconfig();
            if (isset($_REQUEST['page'])) {
                $config->var_page = $_REQUEST['page'];
                $config->showpage();
            } else {
                $config->listpages();
            }
        }
        if ($action == "save") {
            $config = new pliggconfig();
            $config->var_id = substr($_REQUEST['var_id'], 6, 10);
            $config->var_value = $_REQUEST['var_value'];
            $config->store();
        }
    }
}
function dowork()
{
    global $db, $main_smarty;
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    if ($canIhaveAccess == 1) {
        if (is_writable('../settings.php') == 0) {
            die("Error: settings.php is not writeable.");
        }
        $action = isset($_REQUEST['action']) && sanitize($_REQUEST['action'], 3) != '' ? sanitize($_REQUEST['action'], 3) : "view";
        if ($action == "view") {
            $config = new pliggconfig();
            $config->listpages();
            if (isset($_REQUEST['page'])) {
                $config->var_page = sanitize($_REQUEST['page'], 3);
                $config->showpage();
                #			}else{
                #				$config->listpages();
            }
        }
        if ($action == "save") {
            $config = new pliggconfig();
            //			$config->var_id = substr(sanitize($_REQUEST['var_id'], 3), 6, 10);
            $config->var_id = sanitize($_REQUEST['var_id'], 3);
            $config->read();
            // Check if template exists
            if ($config->var_name == '$thetemp' && $config->var_value != js_urldecode($_REQUEST['var_value'])) {
                if (!file_exists('../templates/' . js_urldecode($_REQUEST['var_value']))) {
                    print "alert('" . $main_smarty->get_config_vars('PLIGG_Visual_AdminPanel_NoTemplate') . "')";
                    exit;
                } else {
                    if (file_exists('../templates/' . js_urldecode($_REQUEST['var_value']) . '/template_details.php')) {
                        include '../templates/' . js_urldecode($_REQUEST['var_value']) . '/template_details.php';
                    }
                    if ($template_info['designed_for_pligg_version'] < pligg_version() && !$_REQUEST['force']) {
                        if (!$template_info['designed_for_pligg_version']) {
                            $template_info['designed_for_pligg_version'] = 'unknown';
                        }
                        print sprintf("if (confirm('" . $main_smarty->get_config_vars('PLIGG_Visual_AdminPanel_Template_Version') . "')) {XMLHttpRequestObject.open('GET', '?action=save&var_id={$config->var_id}&var_value=" . urlencode($_REQUEST['var_value']) . "&force=1', true); XMLHttpRequestObject.send(null);}", $template_info['designed_for_pligg_version'], pligg_version());
                        exit;
                    }
                }
            }
            $config->var_value = $db->escape(js_urldecode($_REQUEST['var_value']));
            $config->store(false);
        }
    }
}