[fix] fixing db issue when creating a DB + post/request for SQLRESTORE
This commit is contained in:
parent
9aa3f43160
commit
3ffa78aa5f
|
@ -31,7 +31,7 @@ require_once("../class/config.php");
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
||||||
$fields = array (
|
$fields = array (
|
||||||
"id" => array ("post", "string", ""),
|
"id" => array ("request", "string", ""),
|
||||||
"filename" => array ("post", "string", ""),
|
"filename" => array ("post", "string", ""),
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
|
@ -319,7 +319,7 @@ class m_mysql {
|
||||||
$db->query("DELETE FROM db WHERE uid= ? AND db= ? ;", array($cuid, $dbname));
|
$db->query("DELETE FROM db WHERE uid= ? AND db= ? ;", array($cuid, $dbname));
|
||||||
$this->dbus->query("DROP DATABASE $dbname;");
|
$this->dbus->query("DROP DATABASE $dbname;");
|
||||||
|
|
||||||
$db_esc = str_replace('_', '\_', $dbname);
|
$db_esc = str_replace('_', '\_', $dbname);
|
||||||
$this->dbus->query("DELETE FROM mysql.db WHERE Db= ? ;", array($db_esc));
|
$this->dbus->query("DELETE FROM mysql.db WHERE Db= ? ;", array($db_esc));
|
||||||
|
|
||||||
#We test if the user created with the database is associated with more than 1 database.
|
#We test if the user created with the database is associated with more than 1 database.
|
||||||
|
@ -469,7 +469,7 @@ class m_mysql {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$grant = "grant " . $rights . " on " . $base . "." . $table . " to " . $db->quote($user) . "@" . $db->quote($this->dbus->Client);
|
$grant = "grant " . $rights . " on `" . $base . "`." . $table . " to " . $db->quote($user) . "@" . $db->quote($this->dbus->Client);
|
||||||
|
|
||||||
if ($pass) {
|
if ($pass) {
|
||||||
$grant .= " identified by " . $db->quote($pass) . ";";
|
$grant .= " identified by " . $db->quote($pass) . ";";
|
||||||
|
@ -585,7 +585,7 @@ class m_mysql {
|
||||||
|
|
||||||
$dbu = $dbn;
|
$dbu = $dbn;
|
||||||
$r = array();
|
$r = array();
|
||||||
$dbn = str_replace('_', '\_', $dbn);
|
$dbn = str_replace('_', '\_', $dbn);
|
||||||
$this->dbus->query("Select * from mysql.db where Db= ? and User!= ? ;", array($dbn, $cuid."_myadm"));
|
$this->dbus->query("Select * from mysql.db where Db= ? and User!= ? ;", array($dbn, $cuid."_myadm"));
|
||||||
|
|
||||||
if (!$this->dbus->num_rows()) {
|
if (!$this->dbus->num_rows()) {
|
||||||
|
|
Loading…
Reference in New Issue