_hash[$key] = $value; } function getConfig($key) { if (isset($this->_hash[$key])) { return $this->_hash[$key]; } return null; } function setDebug() { } function setDebugLogFile() { } function setProfile() { } } $gallery = new GalleryStub(); /* Load config.php */ if (!defined('GALLERY_CONFIG_DIR')) { define('GALLERY_CONFIG_DIR', dirname(dirname(dirname(__FILE__)))); } if (file_exists(GALLERY_CONFIG_DIR . '/config.php')) { include(GALLERY_CONFIG_DIR . '/config.php'); } else { $baseUrl = ''; render('missingConfig'); exit; } if ($baseUrl = $gallery->getConfig('galleryBaseUrl')) { $baseUrl .= 'lib/support/'; } $setupPassword = $gallery->getConfig('setup.password'); if (empty($setupPassword)) { render('missingPassword'); exit; } if (passwordProvided()) { if (passwordIsCorrect()) { savePasswordCookie(); redirectBackToSelf(); exit; } else { askForPassword(); exit; } } else if (!isset($_COOKIE['g2Setup'])) { askForPassword(); exit; } else if ($_COOKIE['g2Setup'] == md5($setupPassword)) { return; } else { askForPassword(); exit; } function passwordProvided() { return isset($_POST['g2_password']); } function passwordIsCorrect() { global $gallery; return $_POST['g2_password'] == $gallery->getConfig('setup.password'); } function savePasswordCookie() { global $gallery; header(sprintf('Set-Cookie: g2Setup=%s', md5($gallery->getConfig('setup.password')))); } function askForPassword() { global $message, $gallery; $message = array(); if (!empty($_POST['g2_password'])) { $message['password'] = $_POST['g2_password']; } render('passwordForm'); } function redirectBackToSelf() { require_once(dirname(__FILE__) . '/../../modules/core/classes/GalleryUrlGenerator.class'); $urlGenerator = new GalleryUrlGenerator(); header('Location: ' . $urlGenerator->getCurrentUrl()); } function render($renderType) { global $baseUrl; ?> Security Check

Security Check

You are attempting to access a secure section of this Gallery installation. You can't proceed until you pass the security check.

You must create a config.php file in the Gallery directory before you can continue configuring the application. Use the installer to create one.
You must enter a setup password in your gallery/config.php file in order to be able to set up Gallery. If your config.php is empty, you should run the installer to install your Gallery.
In order to verify you, we require you to enter your Gallery setup password. This is the password you entered when you installed Gallery. It can be found in your gallery/config.php file like this:
	   $gallery->setConfig('setup.password', 'your password here');
	 
Password: