if (isset($_POST['savegalleryoptions'])) {
     if (isset($_POST['allowed_tags_reset'])) {
         setOption('allowed_tags', getOption('allowed_tags_default'));
     } else {
         $tags = $_POST['allowed_tags'];
         $test = "(" . $tags . ")";
         $a = parseAllowedTags($test);
         if ($a !== false) {
             setOption('allowed_tags', $tags);
             $notify = '';
         } else {
             $notify = '?tag_parse_error';
         }
     }
     setOption('gallery_title', process_language_string_save('gallery_title', 2));
     setoption('Gallery_description', process_language_string_save('Gallery_description', 1));
     setOption('website_title', process_language_string_save('website_title', 2));
     $web = sanitize($_POST['website_url'], 3);
     setOption('website_url', $web);
     setOption('time_offset', sanitize($_POST['time_offset'], 3));
     setBoolOption('mod_rewrite', isset($_POST['mod_rewrite']));
     setOption('mod_rewrite_image_suffix', sanitize($_POST['mod_rewrite_image_suffix'], 3));
     setOption('server_protocol', sanitize($_POST['server_protocol'], 3));
     setOption('charset', sanitize($_POST['charset']), 3);
     setBoolOption('album_use_new_image_date', isset($_POST['album_use_new_image_date']));
     $st = strtolower(sanitize($_POST['gallery_sorttype'], 3));
     if ($st == 'custom') {
         $st = strtolower(sanitize($_POST['customalbumsort'], 3));
     }
     setOption('gallery_sorttype', $st);
     if ($st == 'manual') {
Example #2
0
function dashboard_script()
{
    list($snippet, $text) = GET('snippet, text');
    if ($snippet == '') {
        $snippet = 'sandbox';
    }
    // Prevent subfoldering
    $snippet = preg_replace('/[^a-z0-9\\-\\.]/i', '_', $snippet);
    if (request_type('POST')) {
        cn_dsi_check();
        // Click select only
        if (!REQ('select', 'POST')) {
            if (REQ('delete', 'POST')) {
                $_t = getoption('#snippets');
                unset($_t[$snippet]);
                setoption('#snippets', $_t);
                $snippet = 'sandbox';
            } else {
                // Create new snippet
                if (REQ('create', 'POST')) {
                    $snippet = REQ('create');
                }
                setoption('#snippets/' . $snippet, $text);
                cn_throw_message('Changes saved');
            }
        } else {
            cn_throw_message('Select snippet [' . cn_htmlspecialchars($snippet) . ']');
        }
    }
    $list = getoption('#snippets');
    if (empty($list)) {
        $list['sandbox'] = '';
    }
    $opt_txt = getoption('#snippets/' . $snippet);
    $params = array('list' => $list, 'text' => !empty($opt_txt) ? $opt_txt : '', 'can_delete' => $snippet !== 'sandbox' ? TRUE : FALSE, 'snippet' => $snippet, 'snippets' => getoption('#snippets'));
    echoheader('-@dashboard/style.css', 'HTML Scripts');
    echo exec_tpl('dashboard/script', $params);
    echofooter();
}