mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
Only create database when checked.
This commit is contained in:
@@ -274,6 +274,9 @@ class system_tools
|
|||||||
{
|
{
|
||||||
$mes->addSuccess("Connecting to server");
|
$mes->addSuccess("Connecting to server");
|
||||||
|
|
||||||
|
if(vartrue($_POST['createdb']))
|
||||||
|
{
|
||||||
|
|
||||||
if($sql->gen("CREATE DATABASE ".$database." CHARACTER SET `utf8`"))
|
if($sql->gen("CREATE DATABASE ".$database." CHARACTER SET `utf8`"))
|
||||||
{
|
{
|
||||||
$mes->addSuccess("Creating Database");
|
$mes->addSuccess("Creating Database");
|
||||||
@@ -281,6 +284,13 @@ class system_tools
|
|||||||
// $sql->gen("CREATE USER ".$user."@'".$server."' IDENTIFIED BY '".$pass."';");
|
// $sql->gen("CREATE USER ".$user."@'".$server."' IDENTIFIED BY '".$pass."';");
|
||||||
$sql->gen("GRANT ALL ON `".$database."`.* TO ".$user."@'".$server."';");
|
$sql->gen("GRANT ALL ON `".$database."`.* TO ".$user."@'".$server."';");
|
||||||
$sql->gen("FLUSH PRIVILEGES;");
|
$sql->gen("FLUSH PRIVILEGES;");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$mes->addError("Creating Database");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!$sql->database($database))
|
if(!$sql->database($database))
|
||||||
{
|
{
|
||||||
@@ -295,11 +305,6 @@ class system_tools
|
|||||||
$ret = e107::getXml()->e107Import($coreConfig, 'add', true, false, $sql); // Add core pref values
|
$ret = e107::getXml()->e107Import($coreConfig, 'add', true, false, $sql); // Add core pref values
|
||||||
$mes->addInfo(print_a($ret,true));
|
$mes->addInfo(print_a($ret,true));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$mes->addError("Creating Database");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user