mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 15:18:58 +01:00
added the final steps needed for creating the database for the user
This commit is contained in:
parent
0c41c058d1
commit
dbfe053e66
@ -443,7 +443,7 @@ class db {
|
|||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function create_database($dbname, $adminname = "", $adminpasswd = "") {
|
function create_database($adminname = "", $adminpasswd = "") {
|
||||||
$currentUser = $this->User;
|
$currentUser = $this->User;
|
||||||
$currentPassword = $this->Password;
|
$currentPassword = $this->Password;
|
||||||
$currentDatabase = $this->Database;
|
$currentDatabase = $this->Database;
|
||||||
@ -455,8 +455,8 @@ class db {
|
|||||||
$this->Database = "mysql";
|
$this->Database = "mysql";
|
||||||
}
|
}
|
||||||
$this->disconnect();
|
$this->disconnect();
|
||||||
$this->query("CREATE DATABASE $dbname");
|
$this->query("CREATE DATABASE $currentDatabase");
|
||||||
$this->query("grant all on $dbname.* to $currentUser@localhost identified by '$currentPassword'");
|
$this->query("grant all on $currentDatabase.* to $currentUser@localhost identified by '$currentPassword'");
|
||||||
$this->disconnect();
|
$this->disconnect();
|
||||||
|
|
||||||
$this->User = $currentUser;
|
$this->User = $currentUser;
|
||||||
|
@ -322,7 +322,7 @@ class db {
|
|||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function create_database($dbname, $adminname = "", $adminpasswd = "") {
|
function create_database($adminname = "", $adminpasswd = "") {
|
||||||
$currentUser = $this->User;
|
$currentUser = $this->User;
|
||||||
$currentPassword = $this->Password;
|
$currentPassword = $this->Password;
|
||||||
$currentDatabase = $this->Database;
|
$currentDatabase = $this->Database;
|
||||||
@ -334,8 +334,8 @@ class db {
|
|||||||
$this->Database = "mysql";
|
$this->Database = "mysql";
|
||||||
}
|
}
|
||||||
$this->disconnect();
|
$this->disconnect();
|
||||||
$this->query("CREATE DATABASE $dbname");
|
$this->query("CREATE DATABASE $currentDatabase");
|
||||||
$this->query("grant all on $dbname.* to $currentUser@localhost identified by '$currentPassword'");
|
$this->query("grant all on $currentDatabase.* to $currentUser@localhost identified by '$currentPassword'");
|
||||||
$this->disconnect();
|
$this->disconnect();
|
||||||
|
|
||||||
$this->User = $currentUser;
|
$this->User = $currentUser;
|
||||||
|
Loading…
Reference in New Issue
Block a user