Commit 989b39b6 authored by mcramer's avatar mcramer
Browse files

Bugfix: Database Update through remoting api

parent 664f54f6
......@@ -75,7 +75,7 @@ class sites_database_plugin {
public function processDatabaseUpdate($form_page) {
global $app;
$old_record = $app->tform->getDataRecord($form_page->id);
$old_record = $app->db->queryOneRecord('SELECT * FROM `web_database` WHERE `database_id` = ' . intval($form_page->id));
if($form_page->dataRecord["parent_domain_id"] > 0) {
$web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".intval($form_page->dataRecord["parent_domain_id"]));
......@@ -146,7 +146,7 @@ class sites_database_plugin {
public function processDatabaseDelete($primary_id) {
global $app;
$old_record = $app->tform->getDataRecord($primary_id);
$old_record = $app->db->queryOneRecord('SELECT * FROM `web_database` WHERE `database_id` = ' . intval($primary_id));
if($old_record['database_user_id']) {
// check if any database on the server still uses this one
$check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . intval($old_record['server_id']) . "' AND (`database_user_id` = '" . intval($old_record['database_user_id']) . "' OR `database_ro_user_id` = '" . intval($old_record['database_user_id']) . "') AND `sys_groupid` = '" . intval($old_record['sys_groupid']) . "' AND `database_id` != '" . intval($primary_id) . "'");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment