From 93ce8ffd0f2a1d6e68b4d7e2876149a77f6aaece Mon Sep 17 00:00:00 2001
From: Benjamin Sonntag
Date: Mon, 23 May 2016 16:37:32 +0200
Subject: [PATCH] htmlentities in sql_getparams + check if db not found
---
bureau/admin/sql_getparam.php | 12 ++++++++----
bureau/class/m_mysql.php | 13 ++++++++++---
2 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/bureau/admin/sql_getparam.php b/bureau/admin/sql_getparam.php
index 4da70015..7d9fda0b 100644
--- a/bureau/admin/sql_getparam.php
+++ b/bureau/admin/sql_getparam.php
@@ -38,7 +38,10 @@ if (!$r=$mysql->get_dblist()) {
$error=$err->errstr();
}
-
+$r=$mysql->get_defaultsparam($dbname);
+if (!$r) {
+ $error=$err->errstr();
+}
?>
@@ -47,8 +50,9 @@ if (!$r=$mysql->get_dblist()) {
$error
";
- }
-$r=$mysql->get_defaultsparam($dbname);
+ include_once("foot.php");
+ exit();
+ }
?>
:
@@ -61,7 +65,7 @@ $r=$mysql->get_defaultsparam($dbname);
|
-
|
+
|
dbus->query("Select * from mysql.db where Db= ? and User!= ? ;", array($dbn, $cuid."_myadm"));
if (!$db->num_rows()) {
- return $r;
+ $err->raise("mysql",_("Database not found"));
+ return false;
}
while ($db->next_record()) {
$variable = $db->Record;
@@ -652,12 +653,18 @@ class m_mysql {
}
}
} //endwhile
+ if (!count($r)) {
+ $err->raise("mysql",_("Database not found"));
+ return false;
+ }
if (!$db->query("SELECT name,password from dbusers where name= ? ;", array($dbu))) {
- return $r;
+ $err->raise("mysql",_("Database not found"));
+ return false;
}
if (!$db->num_rows()) {
- return $r;
+ $err->raise("mysql",_("Database not found"));
+ return false;
}
$db->next_record();
$r['user'] = $db->f('name');