From e701d6e756af43e4a5cad25796ca5ebeaecdee7c Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sat, 7 Nov 2009 19:21:57 +0000 Subject: [PATCH] - improved error message of setup.php - Use $incpath in setup.php to make sure nobody is doing evil things git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@763 a1433add-5e2c-0410-b055-b7f2511e0802 --- setup.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/setup.php b/setup.php index 5983eb7f..bc61573f 100644 --- a/setup.php +++ b/setup.php @@ -25,12 +25,12 @@ define('POSTFIXADMIN', 1); # by defining it here, common.php will not start a session. -require_once('common.php'); +require_once(dirname(__FILE__).'/common.php'); # make sure correct common.php is used. $CONF['show_header_text'] = 'NO'; $CONF['theme_logo'] = 'images/logo-default.png'; $CONF['theme_css'] = 'css/default.css'; -require('templates/header.php'); +require($incpath.'/templates/header.php'); ?>
@@ -120,10 +120,10 @@ $config_loaded = 0; if ($file_config == 1) { print "
  • Depends on: presence config.inc.php - OK
  • \n"; - require_once('config.inc.php'); + require_once($incpath.'/config.inc.php'); $config_loaded = 1; - require('config.inc.php'); + require($incpath.'/config.inc.php'); if(isset($CONF['configured'])) { if($CONF['configured'] == TRUE) { print "
  • Checking \$CONF['configured'] - OK\n"; @@ -148,9 +148,11 @@ else if (!is_writeable($incpath.'/templates_c')) { - print "
  • Error: The subdirectory templates_c is not writable.
    \n"; - print "Please make it writable.
    \n"; + print "
  • Error: Smarty template compile directory templates_c is not writable.
    \n"; + print "Please make it writable.
    \n"; $error =+ 1; +} else { + print "
  • Smarty template compile directory is writable - OK
    \n"; } // @@ -309,7 +311,7 @@ if ($error != 0) else { print "

    Everything seems fine... attempting to create/update database structure

    \n"; - require_once('upgrade.php'); + require_once($incpath.'/upgrade.php'); $pAdminCreate_admin_username_text = $PALANG['pAdminCreate_admin_username_text']; $pAdminCreate_admin_password_text = "";