upload/*
+inc/settings.php
Installation
------------
-upload syp to your webserver
-edit inc/settings.php
-open http://yoururl.com/wizard.php with your web browser
-follow instructions
+
+* manual configuration
+
+- edit inc/settings.php.in and copy it to inc/settings.php
+- upload syp to your webserver
+- open http://yoururl.com/install.php with your web browser to finalize
+ installation (database tables creation).
+
+* automatic configuration
+- upload syp to your webserver
+- open http://yoururl.com/install.php with your web browser and follow
+ instructions.
+
+For automatic configuration to work, inc/ directory needs to be writeable. Use
+chmod to set the appropriate directory permissions. If in doubt, chmod to 0777.
+Alternatively, you can use manual method.
+
+Some advanced configuration options are not available with automatic method. If
+you need to set those options, use manual configuration.
Upgrade
------------
/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
license. */
-require_once ("./inc/settings.php");
-require_once ("./inc/db/mysql.php");
-require_once ("./inc/utils.php");
-
function exit_document ($body) {
exit ("<html><head></head><body>$body</body></html>");
}
server_error ();
}
+if (!@include_once ("./inc/settings.php")) {
+ server_error ();
+}
+require_once ("./inc/db/mysql.php");
+require_once ("./inc/utils.php");
+
try {
$connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
} catch (Exception $e) {
cp -RLp inc/ $DESTDIR/
# other php files
-cp -p admin.*php index.*php upgrade.*php wizard.*php news.php api.php items.php logout.php $DESTDIR/
+cp -p admin.*php index.*php upgrade.*php install.*php news.php api.php items.php logout.php $DESTDIR/
# media
cp -RLp media/ $DESTDIR/
"You need at least PHP version 5"
=> "",
+ "Cannot save config file. You need either to set inc/ writable, or use manual method. See README.txt for more informations."
+ => "",
+
+ "SYP configuration"
+ => "",
+
+ "address of the database server (example: localhost, db.myhost.com or 192.168.0.15)."
+ => "",
+
+ "database server hostname:"
+ => "",
+
+ "The name of the database that SYP will be installed into. The database must exist."
+ => "",
+
+ "database name:"
+ => "",
+
+ "The username with which you connect to the database."
+ => "",
+
+ "database user:"
+ => "",
+
+ "The password with which you connect to the database."
+ => "",
+
+ "database password:"
+ => "",
+
+ "You can specify a table prefix. This way you can run multiple SYP installations in the same database, each with its own prefix."
+ => "",
+
+ "tables prefix:"
+ => "",
+
+ "The title you want to give to your SYP site."
+ => "",
+
+ "site title:"
+ => "",
+
+ "Start install"
+ => "",
+
"not supported"
=> "",
"Unknown error when connecting to database."
=> "",
+ "Could not read <code>inc/settings.php.in</code>"
+ => "",
+
+ "Config file created"
+ => "",
+
+ "Config file exists"
+ => "",
+
"Unknown error when checking user table."
=> "",
=> "",
"SYP is not correctly installed. Please follow README.txt instructions\n" .
- " and go to <a href=\"wizard.en.php\">wizard</a>."
+ " and go to <a href=\"install.en.php\">wizard</a>."
=> "",
"add a place"
"Vous devez utiliser une version de PHP au moins égale à la version 5"
,
+ "Cannot save config file. You need either to set inc/ writable, or use manual method. See README.txt for more informations."
+ =>
+ "Impossible d'enregistrer le fichier de configuration. Vous devez rendre le répertoire inc/ accessible en écriture ou utiliser la méthode manuelle. Consultez README.txt pour plus d'informations."
+ ,
+
+ "SYP configuration"
+ =>
+ "Configuration de SYP"
+ ,
+
+ "address of the database server (example: localhost, db.myhost.com or 192.168.0.15)."
+ =>
+ "addresse du serveur de base de données (exemple: localhost, db.myhost.com ou 192.168.0.15)"
+ ,
+
+ "database server hostname:"
+ =>
+ "addresse du serveur de base de données :"
+ ,
+
+ "The name of the database that SYP will be installed into. The database must exist."
+ =>
+ "Le nom de la base de données dans laquelle SYP va être installé. La base doit exister."
+ ,
+
+ "database name:"
+ =>
+ "nom de la base de données :"
+ ,
+
+ "The username with which you connect to the database."
+ =>
+ "Le nom d'utilisateur avec lequel vous vous connectez à la base."
+ ,
+
+ "database user:"
+ =>
+ "nom d'utilisateur de la base :"
+ ,
+
+ "The password with which you connect to the database."
+ =>
+ "Le mot de passe avec lequel vous vous connectez à la base."
+ ,
+
+ "database password:"
+ =>
+ "mot de passe de la base :"
+ ,
+
+ "You can specify a table prefix. This way you can run multiple SYP installations in the same database, each with its own prefix."
+ =>
+ "Vous pouvez définir un préfixe de table. Vous pourrez ainsi avoir plusieurs installations de SYP sur la même base, chacune avec son propre préfixe."
+ ,
+
+ "tables prefix:"
+ =>
+ "préfixe de tables: "
+ ,
+
+ "The title you want to give to your SYP site."
+ =>
+ "Le titre que vous voulez donner à votre site SYP."
+ ,
+
+ "site title:"
+ =>
+ "titre du site "
+ ,
+
+ "Start install"
+ =>
+ "Commencer l'installation"
+ ,
+
"not supported"
=>
"support non détecté"
"Erreur inconnue lors de la connexion à la base."
,
+ "Could not read <code>inc/settings.php.in</code>"
+ =>
+ "Impossible de lire <code>inc/settings.php.in</code>"
+ ,
+
+ "Config file created"
+ =>
+ "Fichier de configuration créé"
+ ,
+
+ "Config file exists"
+ =>
+ "Le fichier de configuration existe"
+ ,
+
"Unknown error when checking user table."
=>
"Erreur inconnue lors de la vérification de la table utilisateur."
,
"SYP is not correctly installed. Please follow README.txt instructions\n" .
- " and go to <a href=\"wizard.en.php\">wizard</a>."
+ " and go to <a href=\"install.en.php\">wizard</a>."
=>
"SYP n'est pas correctement installé. Veuillez\n" .
" suivre les instructions du fichier README.txt et vous rendre\n" .
- " sur la page du <a href=\"wizard.fr.php\">wizard</a>."
+ " sur la page du <a href=\"install.fr.php\">wizard</a>."
,
"add a place"
,
)
-?>
\ No newline at end of file
+?>
$ROOTDIR = "../../";
// scripts in rootdir we need to link to
-$SCRIPTS = array ("admin", "index", "upgrade", "wizard");
+$SCRIPTS = array ("admin", "index", "upgrade", "install");
function usage() {
global $argv;
--- /dev/null
+<?php
+/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
+ license. */
+
+function safe_create_dir ($dirname) {
+ if (is_dir ($dirname)) {
+ return;
+ }
+ if (file_exists ($dirname)) {
+ par_error_and_leave ($dirname . ": " . trans ('exist but is not a directory'));
+ }
+ if (!mkdir ($dirname)) {
+ par_error_and_leave ($dirname . ": " . trans ('could not create directory'));
+ } else {
+ par_success ($dirname . ": " . trans ('directory created'));
+ }
+}
+
+function safe_create_writable_dir ($dirname) {
+ safe_create_dir ($dirname);
+ if (!is_writeable ($dirname) || !is_executable ($dirname)) {
+ par_error_and_leave ($dirname . ": " . trans ('could not write in directory'));
+ }
+}
+
+function leave () {
+ exit ("\n</body></html>");
+}
+function par_success ($message) {
+ printf ("<p class=\"success center\">%s</p>", $message);
+}
+function par_error ($message) {
+ printf ("<p class=\"error center\">%s</p>", $message);
+}
+function par_warn ($message) {
+ printf ("<p class=\"warn center\">%s</p>", $message);
+}
+function par_error_and_leave ($message) {
+ printf ("<p class=\"error center\">%s</p>", $message);
+ leave ();
+}
+?>
/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
license. */
-require_once ("./inc/settings.php");
+$error = false;
+
+if (!@include_once ("./inc/settings.php")) {
+ $error = true;
+}
require_once ("./inc/db/mysql.php");
require_once ("./inc/utils.php");
-$error = false;
try {
$connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
$usrtblexists = $connection->users_table_exists ();
</head>
<body>
<p class="error center"><?php ptrans('SYP is not correctly installed. Please follow README.txt instructions
- and go to <a href="wizard.en.php">wizard</a>.')?></p>
+ and go to <a href="install.en.php">wizard</a>.')?></p>
</body>
</html>
<?php
/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
license. */
-require_once ("./inc/settings.php");
+@include_once ("./inc/settings.php");
require_once ("./inc/db/mysql.php");
try {
<html lang="<?php echo $lang?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
- <title><?php echo defined ("SITETITLE") ? SITETITLE : "SYP"?></title>
+ <title><?php echo defined ("SITETITLE") ? htmlspecialchars (SITETITLE) : "SYP"?></title>
<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="news.php">
<link rel="stylesheet" href="./openlayers/theme/default/style.css" type="text/css">
<link rel="stylesheet" href="./media/syp.css" type="text/css">
--- /dev/null
+<?php
+/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
+ license. */
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="<?php echo $lang?>">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
+ <link rel="stylesheet" href="./media/install.css" type="text/css" />
+ <title><?php ptrans ('SYP wizard')?></title>
+ <script type="text/javascript">
+ function init () {
+ if (document.getElementById('db_host')) {
+ document.getElementById('db_host').focus();
+ document.getElementById('db_host').select();
+ } else if (document.getElementById('admin_pass')) {
+ document.getElementById('admin_pass').focus();
+ document.getElementById('admin_pass').select();
+ }
+ }
+ </script>
+</head>
+<body onload="init()">
+
+<?php
+
+ define ("CONFIG_FILE", "./inc/settings.php");
+
+ require_once ("./inc/install_utils.php");
+
+ if (version_compare (PHP_VERSION, '5.0.0', '<')) {
+ par_error_and_leave (trans ("You need at least PHP version 5"));
+ }
+
+ function error_unwritable_config () {
+ par_error_and_leave (trans ("Cannot save config file. You need either to set inc/ writable, or use manual method. See README.txt for more informations."));
+ }
+
+ function create_install_form () {
+ if (isset ($_POST ["db_form_submit"])) {
+ $host = $_POST ["db_host"];
+ $name = $_POST ["db_name"];
+ $user = $_POST ["db_user"];
+ $prefix = $_POST ["db_prefix"];
+ $title = $_POST ["site_title"];
+ } else {
+ $host = "localhost";
+ $user = "syp";
+ $name = "syp";
+ $prefix = "syp_";
+ $title = "SYP";
+ }
+
+ print '<form method="post" action="' . $_SERVER ["REQUEST_URI"] . '"><fieldset>' . "\n";
+ print '<legend>' . trans ("SYP configuration") . '</legend>' . "\n";
+
+ print '<div><label for="db_host" title="' .
+ trans ("address of the database server (example: localhost, db.myhost.com or 192.168.0.15).") .
+ '">' . trans ("database server hostname:") . '</label>' . "\n" .
+ '<input id="db_host" name="db_host" value="' . $host . '"></div>' . "\n";
+
+ print '<div><label for="db_name" title="' .
+ trans ("The name of the database that SYP will be installed into. The database must exist.") .
+ '">' . trans ("database name:") . '</label>' . "\n" .
+ '<input id="db_name" name="db_name" value="' . $name . '"></div>' . "\n";
+
+ print '<div><label for="db_user" title="' .
+ trans ("The username with which you connect to the database.") .
+ '">' . trans ("database user:") . '</label>' . "\n" .
+ '<input id="db_user" name="db_user" value="' . $user . '"></div>' . "\n";
+
+ print '<div><label for="db_pass" title="' .
+ trans ("The password with which you connect to the database.") .
+ '">' . trans ("database password:") . '</label>' . "\n" .
+ '<input id="db_pass" name="db_pass" type="password"></div>' . "\n";
+
+ print '<div><label for="db_prefix" title="' .
+ trans ("You can specify a table prefix. This way you can run multiple SYP installations in the same database, each with its own prefix.") .
+ '">' . trans ("tables prefix:") . '</label>' . "\n" .
+ '<input id="db_prefix" name="db_prefix" value="' . $prefix . '">' . "\n";
+
+ print '<div><label for="site_title" title="' .
+ trans ("The title you want to give to your SYP site.") .
+ '">' . trans ("site title:") . '</label>' . "\n" .
+ '<input id="site_title" name="site_title" value="' . $title . '">' . "\n";
+
+ print '<div><input id="db_form_submit" name="db_form_submit" type="submit" value="' . trans ("Start install") . '"></div>';
+ print '</fieldset></form>';
+ }
+
+ if (file_exists (CONFIG_FILE)) {
+ require_once (CONFIG_FILE);
+ } else if (isset ($_POST["db_form_submit"])) { // user has submitted form
+
+ function _unquote($gpc_str) {
+ if (!isset ($gpc_str)) {
+ return $gpc_str;
+ }
+ if (get_magic_quotes_gpc ()) {
+ return stripslashes ($gpc_str);
+ } else {
+ return $gpc_str;
+ }
+ }
+
+ define (DBHOST, _unquote ($_POST ["db_host"]));
+ define (DBNAME, _unquote ($_POST ["db_name"]));
+ define (DBUSER, _unquote ($_POST ["db_user"]));
+ define (DBPWD, _unquote ($_POST ["db_pass"]));
+ define (DBPREFIX, _unquote ($_POST ["db_prefix"]));
+ define (SITETITLE, _unquote ($_POST ["site_title"]));
+
+ // default values
+ define (UPLOADDIR, "upload");
+ define (THUMBSDIR, "upload/_thumbs");
+ } else {
+ if (!is_writable (dirname (CONFIG_FILE))) {
+ error_unwritable_config ();
+ }
+
+ create_install_form ();
+ leave ();
+ }
+
+ require_once ("./inc/db/mysql.php");
+ require_once ("./inc/utils.php");
+
+ try {
+ $connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
+ } catch (Exception $e) {
+ switch ($e->getMessage ()) {
+ case anydbConnection::err_driver_unavailable:
+ par_error ($connection->getdbname() . ': ' . trans ('not supported'));
+ break;
+ case anydbConnection::err_connection:
+ par_error (trans ('Could not connect to database.'));
+ break;
+ case anydbConnection::err_unknown_database:
+ par_error (trans ('Database does not exist.'));
+ break;
+ default:
+ par_error (trans ('Unknown error when connecting to database.'));
+ break;
+ }
+
+ if (isset ($_POST ["db_form_submit"])) {
+ // user had submited database informations. They seem to be wrong.
+ // Ask again.
+ create_install_form ();
+ }
+ leave ();
+ }
+
+ // we can connect to table. If config file does not exist, try to create it now.
+ if (!file_exists (CONFIG_FILE)) {
+ $handle = fopen ("./inc/settings.php.in", "r");
+ $lines = array();
+ if ($handle) {
+ while (!feof ($handle)) {
+ $line = fgets ($handle, 4096);
+ foreach (array ("DBHOST", "DBNAME", "DBUSER", "DBPWD", "DBPREFIX", "SITETITLE") as $value) {
+ $pattern = "(define\s+\(\s*\"$value\"\s*,\s*\")[^\"]*(\"\s*\)\s*;)";
+ if (preg_match( "/$pattern/", $line, $match )) {
+ $line = $match[1] . addslashes (constant ($value)) . $match[2];
+ break;
+ }
+ }
+ array_push ($lines, $line);
+ }
+ fclose ($handle);
+ } else {
+ par_error_and_leave (trans ('Could not read <code>inc/settings.php.in</code>'));
+ }
+
+ $handle = fopen(CONFIG_FILE, 'w');
+ if (!$handle) {
+ error_unwritable_config ();
+ }
+ fwrite ($handle, join($lines));
+ par_success (trans ('Config file created'));
+ } else {
+ par_success (trans ('Config file exists'));
+ }
+
+ try {
+ $users_table_exists = $connection->users_table_exists ();
+ } catch(Exception $e) {
+ par_error_and_leave (trans ('Unknown error when checking user table.'));
+ }
+
+ if ($users_table_exists) {
+ par_success (trans ('Found user table.'));
+ } else {
+ if (isset($_POST ["admin_pass"])) {
+ try {
+ $connection->create_users_table (true);
+ } catch (Exception $e) {
+ par_error_and_leave (trans ('Error when creating user table.'));
+ }
+ par_success (trans ('User table created.'));
+ try {
+ $connection->setpwd ("admin", $_POST ["admin_pass"]);
+ } catch (Exception $e) {
+ par_error_and_leave (trans ('Error when initializing password.'));
+ }
+ par_success (trans ('Admin password initialized.'));
+
+ } else {
+ print ('<form class="center" method="post" action="">
+ <label for="admin_pass">' . trans ("choose admin password") . '</label>
+ <input id="admin_pass" name="admin_pass" type="password">
+ <input type="submit">
+ </form>');
+ leave ();
+ }
+ }
+
+ try {
+ $items_table_exists = $connection->items_table_exists ();
+ } catch (Exception $e) {
+ par_error_and_leave (trans ('Unknown error when checking data table.'));
+ }
+ if ($items_table_exists) {
+ par_success (trans ('Found data table.'));
+ } else {
+ try {
+ $connection->create_items_table (true);
+ } catch (Exception $e) {
+ par_error_and_leave (trans ('Error when creating data table.'));
+ }
+ par_success (trans ('Data table created.'));
+ }
+
+ safe_create_writable_dir (UPLOADDIR);
+ safe_create_writable_dir (getthumbsdir ());
+
+ if (!function_exists ("gd_info")) {
+ par_warn (trans ('It looks like GD extension is not installed.'));
+ }
+
+ par_success (trans ('SYP is installed. You can now go to <a href="admin.en.php">admin area</a>'));
+?>
+
+</body>
+</html>
<?php
/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
license. */
+ if (!@include_once ("./inc/settings.php")) {
+ header ('Location: install.php');
+ }
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
return true;
}
- require_once ("./inc/settings.php");
require_once ("./inc/db/mysql.php");
+ require_once ("./inc/install_utils.php");
require_once ("./inc/utils.php");
$error = false;
}
if ($error) {
die(sprintf('<p class="error center">%s</p>', trans('SYP is not correctly installed. Please follow README.txt instructions
- and go to <a href="wizard.en.php">wizard</a>.')));
+ and go to <a href="install.en.php">wizard</a>.')));
}
safe_create_writable_dir (getthumbsdir ());
if (create_all_thumbs ($connection)) {
par_success (trans('Thumbnails successfully created.'));
} else {
- par_error (trans('Error when creating thumbnails.'));
+ par_error_and_leave (trans('Error when creating thumbnails.'));
}
par_success (trans ('SYP upgrade went smoothly. You can now go to <a href="admin.en.php">admin area</a>'));
+++ /dev/null
-<?php
-/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
- license. */
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="<?php echo $lang?>">
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
- <link rel="stylesheet" href="./media/common.css" type="text/css" />
- <title><?php ptrans ('SYP wizard')?></title>
- <script type="text/javascript">
- function init () {
- if (document.getElementById('password')) {
- document.getElementById('password').focus();
- document.getElementById('password').select();
- }
- }
- </script>
-</head>
-<body onload="init()">
-
-<?php
-
- if (version_compare (PHP_VERSION, '5.0.0', '<')) {
- par_error (trans ("You need at least PHP version 5"));
- }
-
- require_once ("./inc/settings.php");
- require_once ("./inc/db/mysql.php");
- require_once ("./inc/utils.php");
-
- try {
- $connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
- } catch (Exception $e) {
- switch ($e->getMessage ()) {
- case anydbConnection::err_driver_unavailable:
- par_error ($connection->getdbname() . ': ' . trans ('not supported'));
- case anydbConnection::err_connection:
- par_error (trans ('Could not connect to database.'));
- case anydbConnection::err_unknown_database:
- par_error (trans ('Database does not exist.'));
- default:
- par_error (trans ('Unknown error when connecting to database.'));
- }
- }
- try {
- $users_table_exists = $connection->users_table_exists ();
- } catch(Exception $e) {
- par_error (trans ('Unknown error when checking user table.'));
- }
-
- if ($users_table_exists) {
- par_success (trans ('Found user table.'));
- } else {
- if (isset($_POST ["password"])) {
- try {
- $connection->create_users_table (true);
- } catch (Exception $e) {
- par_error (trans ('Error when creating user table.'));
- }
- par_success (trans ('User table created.'));
- try {
- $connection->setpwd ("admin", $_POST ["password"]);
- } catch (Exception $e) {
- par_error (trans ('Error when initializing password.'));
- }
- par_success (trans ('Admin password initialized.'));
-
- } else {
- print ('<form class="center" method="post" action="">
- <label for="password">' . trans ("choose admin password") . '</label>
- <input id="password" name="password" type="password">
- <input type="submit">
- </form>');
- leave ();
- }
-
- }
-
- try {
- $items_table_exists = $connection->items_table_exists ();
- } catch (Exception $e) {
- par_error (trans ('Unknown error when checking data table.'));
- }
- if ($items_table_exists) {
- par_success (trans ('Found data table.'));
- } else {
- try {
- $connection->create_items_table (true);
- } catch (Exception $e) {
- par_error (trans ('Error when creating data table.'));
- }
- par_success (trans ('Data table created.'));
- }
-
- safe_create_writable_dir (UPLOADDIR);
- safe_create_writable_dir (getthumbsdir ());
-
- if (!function_exists ("gd_info")) {
- par_warn (trans ('It looks like GD extension is not installed.'));
- }
-
- par_success (trans ('SYP is installed. You can now go to <a href="admin.en.php">admin area</a>'));
-?>
-
-</body>
-</html>
/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
license. */
-require_once ("inc/settings.php");
+// using include because that file may be sourced even if config file has not
+// been created.
+@include_once ("inc/settings.php");
function getthumbsdir () {
if (THUMBSDIR) {
return true;
}
-
-function safe_create_dir ($dirname) {
- if (is_dir ($dirname)) {
- return;
- }
- if (file_exists ($dirname)) {
- par_error ($dirname . ": " . trans ('exist but is not a directory'));
- }
- if (!mkdir ($dirname)) {
- par_error ($dirname . ": " . trans ('could not create directory'));
- } else {
- par_success ($dirname . ": " . trans ('directory created'));
- }
-}
-
-function safe_create_writable_dir ($dirname) {
- safe_create_dir ($dirname);
- if (!is_writeable ($dirname) || !is_executable ($dirname)) {
- par_error ($dirname . ": " . trans ('could not write in directory'));
- }
-}
-
-function leave () {
- exit ("\n</body></html>");
-}
-function par_success ($message) {
- printf ("<p class=\"success center\">%s</p>", $message);
-}
-function par_error ($message) {
- printf ("<p class=\"error center\">%s</p>", $message);
- leave ();
-}
-function par_warn ($message) {
- printf ("<p class=\"warn center\">%s</p>", $message);
-}
?>
--- /dev/null
+install.php
\ No newline at end of file
--- /dev/null
+install.php
\ No newline at end of file
license. */
require ('inc/langutils.php');
- require ('inc/templates_wizard.php');
+ require ('inc/templates_install.php');
?>
/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
license. */
-require_once ("./inc/settings.php");
-require_once ("./inc/utils.php");
-require_once ("./inc/db/mysql.php");
-
function headers_callback ($output) {
$etag = md5 ($output);
if ((isset ($_SERVER ["HTTP_IF_NONE_MATCH"])) &&
';
if (SITETITLE) {
- printf (' <name>%s</name>', SITETITLE);
+ printf (' <name>%s</name>', htmlspecialchars (SITETITLE));
}
foreach ($features as $feature) {
$id = $feature->id;
</kml>';
}
+if (!@include_once ("./inc/settings.php")) {
+ exit ("server error");
+}
+require_once ("./inc/utils.php");
+require_once ("./inc/db/mysql.php");
+
try {
$connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
$features = $connection->listfeatures ($_GET ['from_user']);
/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
license. */
-require_once ("./inc/settings.php");
+if (!@include_once ("./inc/settings.php")) {
+ header ('Location: index.php');
+}
setcookie (sprintf ("%sauth", DBPREFIX), "", time () - 3600, "" , "",false, true);
setcookie (sprintf ("%suser", DBPREFIX), "", time () - 3600, "" , "",false, true);
header ('Location: index.php');
-
?>
--- /dev/null
+/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
+ license. */
+
+@import url(common.css);
+
+label {
+ display: inline-block;
+ min-width: 25em;
+}
+#db_form_submit {
+ margin-left: 20em;
+ margin-top: 0.5em;
+}
/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
license. */
-require_once ("./inc/settings.php");
-require_once ("./inc/db/mysql.php");
-require_once ("./inc/utils.php");
-
function headers_callback ($output) {
$etag = md5 ($output);
if ((isset ($_SERVER ["HTTP_IF_NONE_MATCH"])) &&
}
if (SITETITLE) {
- printf (" <title>%s</title>\n", SITETITLE);
+ printf (" <title>%s</title>\n", htmlspecialchars (SITETITLE));
}
if (WEBMASTERMAIL) {
printf ("</feed>");
}
+if (!@include_once ("./inc/settings.php")) {
+ exit ("server error");
+}
+require_once ("./inc/db/mysql.php");
+require_once ("./inc/utils.php");
+
try {
$connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
$features = $connection->mostrecentfeatures (10);
+++ /dev/null
-wizard.php
\ No newline at end of file
+++ /dev/null
-wizard.php
\ No newline at end of file