From dbfe053e667002b6baf36901425967c2096089ef Mon Sep 17 00:00:00 2001 From: seek3r Date: Fri, 1 Jun 2001 09:06:49 +0000 Subject: [PATCH] added the final steps needed for creating the database for the user --- phpgwapi/inc/class.db_mysql.inc.php | 8 ++++---- phpgwapi/inc/class.db_pgsql.inc.php | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/phpgwapi/inc/class.db_mysql.inc.php b/phpgwapi/inc/class.db_mysql.inc.php index 84b1af72f5..6e9f39fab7 100644 --- a/phpgwapi/inc/class.db_mysql.inc.php +++ b/phpgwapi/inc/class.db_mysql.inc.php @@ -72,7 +72,7 @@ class db { $User = $this->User; if ("" == $Password) $Password = $this->Password; - + /* establish connection, select database */ if ( 0 == $this->Link_ID ) { $this->Link_ID=mysql_pconnect($Host, $User, $Password); @@ -443,7 +443,7 @@ class db { return $return; } - function create_database($dbname, $adminname = "", $adminpasswd = "") { + function create_database($adminname = "", $adminpasswd = "") { $currentUser = $this->User; $currentPassword = $this->Password; $currentDatabase = $this->Database; @@ -455,8 +455,8 @@ class db { $this->Database = "mysql"; } $this->disconnect(); - $this->query("CREATE DATABASE $dbname"); - $this->query("grant all on $dbname.* to $currentUser@localhost identified by '$currentPassword'"); + $this->query("CREATE DATABASE $currentDatabase"); + $this->query("grant all on $currentDatabase.* to $currentUser@localhost identified by '$currentPassword'"); $this->disconnect(); $this->User = $currentUser; diff --git a/phpgwapi/inc/class.db_pgsql.inc.php b/phpgwapi/inc/class.db_pgsql.inc.php index 379ce699f6..4ab2936f9c 100644 --- a/phpgwapi/inc/class.db_pgsql.inc.php +++ b/phpgwapi/inc/class.db_pgsql.inc.php @@ -322,7 +322,7 @@ class db { return $return; } - function create_database($dbname, $adminname = "", $adminpasswd = "") { + function create_database($adminname = "", $adminpasswd = "") { $currentUser = $this->User; $currentPassword = $this->Password; $currentDatabase = $this->Database; @@ -334,8 +334,8 @@ class db { $this->Database = "mysql"; } $this->disconnect(); - $this->query("CREATE DATABASE $dbname"); - $this->query("grant all on $dbname.* to $currentUser@localhost identified by '$currentPassword'"); + $this->query("CREATE DATABASE $currentDatabase"); + $this->query("grant all on $currentDatabase.* to $currentUser@localhost identified by '$currentPassword'"); $this->disconnect(); $this->User = $currentUser;