setBoolOption('image_sortdirection', isset($_POST['image_sortdirection'])); setBoolOption('auto_rotate', isset($_POST['auto_rotate'])); setOption('IPTC_encoding', $_POST['IPTC_encoding']); foreach ($_zp_exifvars as $key => $item) { setBoolOption($key, array_key_exists($key, $_POST)); } $returntab = "&tab=image"; } /*** Comment options ***/ if (isset($_POST['savecommentoptions'])) { setOption('spam_filter', sanitize($_POST['spam_filter'], 3)); setBoolOption('email_new_comments', isset($_POST['email_new_comments'])); setBoolOption('comment_name_required', isset($_POST['comment_name_required'])); setBoolOption('comment_email_required', isset($_POST['comment_email_required'])); setBoolOption('comment_web_required', isset($_POST['comment_web_required'])); setBoolOption('Use_Captcha', isset($_POST['Use_Captcha'])); $returntab = "&tab=comments"; } /*** Theme options ***/ if (isset($_POST['savethemeoptions'])) { $returntab = "&tab=theme"; // all theme specific options are custom options, handled below if (!empty($_POST['themealbum'])) { $alb = sanitize_path($_POST['themealbum']); $table = new Album(new Gallery(), $alb); $returntab = '&themealbum=' . urlencode($alb) . '&tab=theme'; $themeswitch = $alb != sanitize_path($_POST['old_themealbum']); } else { $table = NULL; $themeswitch = sanitize_path($_POST['old_themealbum']) != ''; }
require_once dirname(__FILE__) . '/template-functions.php'; require_once dirname(__FILE__) . '/admin-functions.php'; if (!($_zp_loggedin & ADMIN_RIGHTS)) { // prevent nefarious access to this page. header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/admin.php?from=' . currentRelativeURL()); exit; } if (getOption('zenphoto_release') != ZENPHOTO_RELEASE) { header("Location: " . FULLWEBPATH . "/" . ZENFOLDER . "/setup.php"); exit; } $gallery = new Gallery(); $_GET['page'] = 'tags'; if (isset($_REQUEST['tagsort'])) { $tagsort = sanitize($_REQUEST['tagsort'], 0); setBoolOption('tagsort', $tagsort); } else { $tagsort = getOption('tagsort'); } printAdminHeader(); echo "\n</head>"; echo "\n<body>"; printLogoAndLinks(); echo "\n" . '<div id="main">'; printTabs('tags'); echo "\n" . '<div id="content">'; if (count($_POST) > 0) { if (isset($_GET['newtags'])) { foreach ($_POST as $value) { if (!empty($value)) { $value = mysql_real_escape_string(sanitize($value, 3));
exit; } $gallery = new Gallery(); $_GET['page'] = 'plugins'; /* handle posts */ $saved = false; if (isset($_GET['action'])) { if ($_GET['action'] == 'saveplugins') { $curdir = getcwd(); chdir(SERVERPATH . "/" . ZENFOLDER . PLUGIN_FOLDER); $filelist = safe_glob('*' . 'php'); chdir($curdir); foreach ($filelist as $extension) { $extension = FilesystemToUTF8($extension); $opt = 'zp_plugin_' . substr($extension, 0, -4); setBoolOption($opt, isset($_POST[$opt])); } $saved = true; } } printAdminHeader(); echo "\n</head>"; echo "\n<body>"; printLogoAndLinks(); echo "\n" . '<div id="main">'; printTabs('plugins'); echo "\n" . '<div id="content">'; /* Page code */ if ($saved) { echo '<div class="messagebox" id="fade-message">'; echo "<h2>" . gettext("Saved") . "</h2>";
/** * Returns the desired tagsort order (0 for alphabetic, 1 for most used) * * @return int */ function getTagOrder() { if (isset($_REQUEST['tagsort'])) { $tagsort = sanitize($_REQUEST['tagsort'], 0); setBoolOption('tagsort', $tagsort); } else { $tagsort = getOption('tagsort'); } return $tagsort; }