SF.net SVN: postfixadmin:[618] trunk/common.php
Brought to you by:
christian_boltz,
gingerdog
From: <Gin...@us...> - 2009-04-08 20:23:19
|
Revision: 618 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=618&view=rev Author: GingerDog Date: 2009-04-08 20:17:24 +0000 (Wed, 08 Apr 2009) Log Message: ----------- common.php: remove requirement to delete setup.php; require $CONF["setup_password"] is changed etc Modified Paths: -------------- trunk/common.php Modified: trunk/common.php =================================================================== --- trunk/common.php 2009-04-08 20:16:35 UTC (rev 617) +++ trunk/common.php 2009-04-08 20:17:24 UTC (rev 618) @@ -22,20 +22,6 @@ } define('POSTFIXADMIN', 1); # checked in included files -function incorrect_setup() { - global $incpath; - # we ask the user to delete setup.php, which makes a blind redirect a bad idea - if(!is_file("$incpath/setup.php")) { - die ("config.inc.php does not exist or is not configured correctly. Please re-install setup.php and create/fix your config."); - } else { - # common.php is indirectly included in setup.php (via upgrade.php) - avoid endless redirect loop - if (!preg_match('/setup\.php$/', $_SERVER['SCRIPT_NAME'])) { - header("Location: setup.php"); - exit(0); - } - } -} - $incpath = dirname(__FILE__); (ini_get('magic_quotes_gpc') ? ini_set('magic_quotes_runtime', '0') : '1'); (ini_get('magic_quotes_gpc') ? ini_set('magic_quotes_sybase', '0') : '1'); @@ -46,15 +32,23 @@ require_once("$incpath/variables.inc.php"); if(!is_file("$incpath/config.inc.php")) { - // incorrectly setup... - incorrect_setup(); + die("config.inc.php is missing!"); } require_once("$incpath/config.inc.php"); + if(isset($CONF['configured'])) { if($CONF['configured'] == FALSE) { - incorrect_setup(); + die("Please edit config.inc.php - change \$CONF['configured'] to true after setting your database settings"); } + if(!isset($CONF['setup_password'])) { + die("You must have a \$CONF['setup_password'] defined - this allows authenticated access to setup.php"); + } + if($CONF['setup_password'] == 'changeme') { + die("You must specify a password in config.inc.php (\$CONF['setup_password']) in order to access setup.php"); + } } + + require_once("$incpath/languages/language.php"); require_once("$incpath/functions.inc.php"); require_once("$incpath/languages/" . check_language () . ".lang"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |