Example #1
0
    if (!zp_loggedin(ADMIN_RIGHTS)) {
        // If they are not logged in, display the login form and exit
        ?>
			<body style="background-image: none">
				<?php 
        $_zp_authority->printLoginForm();
        ?>
			</body>
			<?php 
        echo "\n</html>";
        exitZP();
    }
    ?>
		<body>
			<?php 
    printLogoAndLinks();
    ?>
			<div id="main">
				<div id="content">
					<h1><?php 
    echo gettext('Setup request');
    ?>
</h1>
					<div class="tabbox">
						<p>
							<?php 
    if (zpFunctions::hasPrimaryScripts()) {
        if ($found) {
            echo '<a href="' . WEBPATH . '/' . ZENFOLDER . '/setup.php?xsrfToken=' . getXSRFToken('setup') . '">' . gettext('Click to restore the setup scripts and run setup.') . '</a>';
        } else {
            printf(gettext('You must restore the setup files from the %1$s release.'), ZENPHOTO_VERSION);
Example #2
0
/**
 *
 * Executes the configuration change code
 */
function reconfigureAction($mandatory)
{
    list($diff, $needs) = checkSignature($mandatory);
    $diffkeys = array_keys($diff);
    if ($mandatory) {
        if (isset($_GET['rss']) || isset($_GET['external'])) {
            if (isset($_GET['rss']) && file_exists(SERVERPATH . '/' . DATA_FOLDER . '/rss-closed.xml')) {
                $xml = file_get_contents(SERVERPATH . '/' . DATA_FOLDER . '/rss-closed.xml');
                $xml = preg_replace('~<pubDate>(.*)</pubDate>~', '<pubDate>' . date("r", time()) . '</pubDate>', $xml);
                echo $xml;
            }
            exit;
            //	can't really run setup from an RSS feed.
        }
        if (empty($needs)) {
            $dir = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
            $p = strpos($dir, ZENFOLDER);
            if ($p !== false) {
                $dir = substr($dir, 0, $p);
            }
            if (OFFSET_PATH) {
                $where = 'admin';
            } else {
                $where = 'gallery';
            }
            $dir = rtrim($dir, '/');
            $location = "http://" . $_SERVER['HTTP_HOST'] . $dir . "/" . ZENFOLDER . "/setup/index.php?autorun={$where}";
            header("Location: {$location}");
            exitZP();
        } else {
            global $subtabs, $zenphoto_tabs, $main_tab_space, $_zp_admin_tab, $_zp_invisible_execute, $_zp_gallery;
            $_zp_invisible_execute = 1;
            require_once SERVERPATH . '/' . ZENFOLDER . '/admin-globals.php';
            header('Last-Modified: ' . ZP_LAST_MODIFIED);
            header('Content-Type: text/html; charset=UTF-8');
            ?>
			<!DOCTYPE html>
			<html xmlns="http://www.w3.org/1999/xhtml">
				<head>
					<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
					<link rel="stylesheet" href="<?php 
            echo WEBPATH . '/' . ZENFOLDER;
            ?>
/admin.css" type="text/css" />
					<?php 
            reconfigureCS();
            ?>
				</head>
				<body>
					<?php 
            if ($_zp_gallery) {
                printLogoAndLinks();
            }
            ?>
					<div id="main">
						<?php 
            if ($_zp_gallery) {
                printTabs();
            }
            ?>
						<div id="content">
							<h1><?php 
            echo gettext('Setup request');
            ?>
</h1>
							<div class="tabbox">
								<?php 
            reconfigurePage($diff, $needs, $mandatory);
            ?>
							</div>
						</div>
					</div>
				</body>
			</html>
			<?php 
            exitZP();
        }
    } else {
        if (!empty($diff)) {
            if (function_exists('zp_register_filter') && zp_loggedin(ADMIN_RIGHTS)) {
                //	no point in telling someone who can't do anything about it
                zp_register_filter('admin_note', 'signatureChange');
                zp_register_filter('admin_head', 'reconfigureCS');
                zp_register_filter('theme_head', 'reconfigureCS');
                zp_register_filter('theme_body_open', 'signatureChange');
            }
        }
    }
}