diff --git a/setup.php b/setup.php index 3e461f45..766d9dfb 100644 --- a/setup.php +++ b/setup.php @@ -59,11 +59,11 @@ if ($f_phpversion == 1) { if (phpversion() < 5) $phpversion = 4; if (phpversion() >= 5) $phpversion = 5; - print "
  • PHP version " . phpversion () . "\n"; + print "
  • PHP version " . phpversion () . "
  • \n"; } else { - print "
  • Unable to check for PHP version. (missing function: phpversion())\n"; + print "
  • Unable to check for PHP version. (missing function: phpversion())
  • \n"; } // @@ -71,11 +71,11 @@ else // if ($f_apache_get_version == 1) { - print "
  • " . apache_get_version() . "\n"; + print "
  • " . apache_get_version() . "
  • \n"; } else { - print "
  • Unable to check for Apache version. (missing function: apache_get_version())\n"; + print "
  • Unable to check for Apache version. (missing function: apache_get_version())
  • \n"; } print ""; @@ -89,16 +89,16 @@ if ($f_get_magic_quotes_gpc == 1) { if (get_magic_quotes_gpc () == 0) { - print "
  • Magic Quotes: Disabled - OK\n"; + print "
  • Magic Quotes: Disabled - OK
  • \n"; } else { - print "
  • Warning: Magic Quotes: ON (internal workaround used)\n"; + print "
  • Warning: Magic Quotes: ON (internal workaround used)
  • \n"; } } else { - print "
  • Unable to check for Magic Quotes. (missing function: get_magic_quotes_gpc())\n"; + print "
  • Unable to check for Magic Quotes. (missing function: get_magic_quotes_gpc())
  • \n"; } // @@ -107,16 +107,16 @@ else $config_loaded = 0; if ($file_config == 1) { - print "
  • Depends on: presence config.inc.php - OK\n"; + print "
  • Depends on: presence config.inc.php - OK
  • \n"; require_once('config.inc.php'); $config_loaded = 1; } else { - print "
  • Error: Depends on: presence config.inc.php - NOT FOUND
    \n"; - print "Create the file.
    "; + print "
  • Error: Depends on: presence config.inc.php - NOT FOUND
  • \n"; + print "Create the file, and edit as appropriate (e.g. select database type etc)
    "; print "For example:
    \n"; - print "
    % cp config.inc.php.sample config.inc.php
    \n"; + print "
    cp config.inc.php.sample config.inc.php
    \n"; $error =+ 1; } @@ -143,7 +143,7 @@ if (($f_mysql_connect == 0) and ($f_mysqli_connect == 0) and ($f_pg_connect == 0 print "
    % cd /usr/ports/databases/php$phpversion-pgsql/\n";
        print "% make clean install\n";
        print " - or with portupgrade -\n";
    -   print "% portinstall php$phpversion-pgsql
    \n"; + print "% portinstall php$phpversion-pgsql\n"; $error =+ 1; } // @@ -151,7 +151,7 @@ if (($f_mysql_connect == 0) and ($f_mysqli_connect == 0) and ($f_pg_connect == 0 // if ($f_mysql_connect == 1) { - print "
  • Depends on: MySQL 3.23, 4.0 - OK\n"; + print "
  • Depends on: MySQL 3.23, 4.0 - OK
  • \n"; } // @@ -165,6 +165,7 @@ if ($phpversion >= 5) if ( !($config_loaded && $CONF['database_type'] == 'mysqli') ) { print "(change the database_type to 'mysqli' in config.inc.php!!)\n"; } + print ""; } } @@ -177,6 +178,7 @@ if ($f_pg_connect == 1) if ( !($config_loaded && $CONF['database_type'] == 'pgsql') ) { print "(change the database_type to 'pgsql' in config.inc.php!!)\n"; } + print ""; } // @@ -185,11 +187,11 @@ if ($f_pg_connect == 1) if ($config_loaded) { list ($link, $error_text) = db_connect(TRUE); if ($error_text == "") { - print "
  • Testing database connection - OK"; + print "
  • Testing database connection - OK - {$CONF['database_type']}://{$CONF['database_user']}:xxxxx@{$CONF['database_host']}/{$CONF['database_name']}
  • "; } else { print "
  • Error: Can't connect to database
    \n"; print "Please edit the \$CONF['database_*'] parameters in config.inc.php.\n"; - print "$error_text\n"; + print "$error_text
  • \n"; $error ++; } } @@ -199,7 +201,7 @@ if ($config_loaded) { // if ($f_session_start == 1) { - print "
  • Depends on: session - OK\n"; + print "
  • Depends on: session - OK
  • \n"; } else { @@ -208,7 +210,7 @@ else print "
    % cd /usr/ports/www/php$phpversion-session/\n";
        print "% make clean install\n";
        print " - or with portupgrade -\n";
    -   print "% portinstall php$phpversion-session
    \n"; + print "% portinstall php$phpversion-session\n"; $error =+ 1; } @@ -217,7 +219,7 @@ else // if ($f_preg_match == 1) { - print "
  • Depends on: pcre - OK\n"; + print "
  • Depends on: pcre - OK
  • \n"; } else { @@ -226,7 +228,7 @@ else print "
    % cd /usr/ports/devel/php$phpversion-pcre/\n";
        print "% make clean install\n";
        print " - or with portupgrade -\n";
    -   print "% portinstall php$phpversion-pcre
    \n"; + print "% portinstall php$phpversion-pcre\n"; $error =+ 1; } @@ -252,6 +254,12 @@ else if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']); if (isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']); + // XXX need to ensure domains table includes an 'ALL' entry. + $r = db_query("SELECT * FROM domain WHERE domain = 'ALL'"); + if($r['rows'] == 0) { + db_insert('domain', array('domain' => 'ALL')); // all other fields should default through the schema. + } + list ($error, $tMessage, $pAdminCreate_admin_username_text, $pAdminCreate_admin_password_text) = create_admin($fUsername, $fPassword, $fPassword2, array('ALL'), TRUE); if ($error != 0) { if (isset ($_POST['fUsername'])) $tUsername = escape_string ($_POST['fUsername']); @@ -301,7 +309,6 @@ else print "Make sure you delete this setup.php file!
    \n"; print "Also check the config.inc.php file for any settings that you might need to change!
    \n"; - print "Click here to go to the admin section (make sure that your .htaccess is setup properly)\n"; } ?>