diff --git a/setup/inc/functions.inc.php b/setup/inc/functions.inc.php index fe5d52d87e..0b93b4df09 100644 --- a/setup/inc/functions.inc.php +++ b/setup/inc/functions.inc.php @@ -126,7 +126,7 @@ } function show_steps($stage, $note = False) { - global $phpgw_info, $PHP_SELF; + global $phpgw_info, $phpgw_domain, $SetupDomain, $PHP_SELF; /* The stages are as follows: Stage 1.1 = header does not exists yet @@ -160,7 +160,28 @@ }elseif ($stage == 2.2) { echo 'O
Your database exist but your pre-beta tables need upgrading.
'; }elseif ($stage == 2.3) { - echo 'O
Your database exist, would you like to create your tables now?
'; +/* commented out because I cannot accuratly figure out if the DB exists */ +// echo 'O
Your database exist, would you like to create your tables now?
'; + echo 'OMake sure that your database is created and the account permissions are set.
'; + if ($phpgw_domain[$SetupDomain]["db_type"] == "mysql"){ + echo " +
Instructions for creating the database in MySQL:
+ Login to mysql -
+ [user@server user]# mysql -u root -p
+ Create the empty database and grant user permissions -
+ mysql> create database phpgroupware;
+ mysql> grant all on phpgroupware.* to phpgroupware@localhost identified by 'password';
+ "; + }elseif ($phpgw_domain[$SetupDomain]["db_type"] == "pgsql"){ + echo " +
Instructions for creating the database in PostgreSQL:
+ Start the postmaster
+ [user@server user]# postmaster -i -D /home/[username]/[dataDir]
+ Create the empty database -
+ [user@server user]# createdb phpgroupware
+ "; + } + echo '
Once the database is setup correctly
'; }elseif ($stage == 2.4) { echo 'O
Your database exist but your tables need upgrading.
'; }elseif ($stage == 2.5) { diff --git a/setup/index.php b/setup/index.php index c821f13f0b..a9ef13c0db 100644 --- a/setup/index.php +++ b/setup/index.php @@ -59,16 +59,17 @@ } }else{ /* no tables, so checking if we can create them */ + + /* I cannot get either to work properly $db->free(); $isdb = $db->connect("kljkjh", "localhost", "phpgroupware", "phpgr0upwar3"); - echo "isdb: ".$isdb."
\n"; - - + */ + $db->free(); $db_rights = $db->query("CREATE TABLE phpgw_testrights ( testfield varchar(5) NOT NULL )"); -echo "db_rights: ".$db_rights."
\n"; if (isset($db_rights)){ + //if (isset($isdb)){ $stage = 2.3; $header_msg = "Stage 2 (Create tables)"; }else{ diff --git a/setup/tables.php b/setup/tables.php index 495ca12258..dfbad78ebf 100644 --- a/setup/tables.php +++ b/setup/tables.php @@ -16,11 +16,17 @@ // page explaining what to do from there (ie, create there own account) $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "home", "noapi" => True); + include("./inc/functions.inc.php"); include("../header.inc.php"); - include("../version.inc.php"); // To set the current core version // Authorize the user to use setup app and load the database - include("./inc/setup_auth.inc.php"); + if (!auth()){ + Header("Location: index.php"); + exit; + } + +echo "keep going"; +exit; // Does not return unless user is authorized // $db->Halt_On_Error = "report";