root
2015-11-19 aa365c418c88ad97ed0e9f0ffa4405fcda717715
fixed sql-syntax
2 files modified
34 ■■■■ changed files
interface/lib/classes/plugin_backuplist.inc.php 21 ●●●●● patch | view | raw | blame | history
interface/lib/classes/plugin_backuplist_mail.inc.php 13 ●●●● patch | view | raw | blame | history
interface/lib/classes/plugin_backuplist.inc.php
@@ -85,8 +85,8 @@
                $server_id = $this->form->dataRecord['server_id'];
                $backup = $app->db->queryOneRecord("SELECT * FROM web_backup WHERE backup_id = ?", $backup_id);
                if($backup['server_id'] > 0) $server_id = $backup['server_id'];
                $sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_restore' AND action_param = '$backup_id'";
                $tmp = $app->db->queryOneRecord($sql);
                $sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_restore' AND action_param = ?";
                $tmp = $app->db->queryOneRecord($sql, $backup_id);
                if($tmp['number'] == 0) {
                    $message .= $wb['restore_info_txt'];
                    $sql =  "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " .
@@ -98,22 +98,15 @@
            }
            if($_GET['backup_action'] == 'delete' && $backup_id > 0) {
                $server_id = $this->form->dataRecord['server_id'];
                $backup = $app->db->queryOneRecord("SELECT * FROM web_backup WHERE backup_id = ".$backup_id);
                $backup = $app->db->queryOneRecord("SELECT * FROM web_backup WHERE backup_id = ?", $backup_id);
                if($backup['server_id'] > 0) $server_id = $backup['server_id'];
                $sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_delete' AND action_param = '$backup_id'";
                $tmp = $app->db->queryOneRecord($sql);
                $sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_delete' AND action_param = ?";
                $tmp = $app->db->queryOneRecord($sql, $backup_id);
                if($tmp['number'] == 0) {
                    $message .= $wb['delete_info_txt'];
                    $sql =  "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " .
                        "VALUES (".
                        (int)$server_id . ", " .
                        time() . ", " .
                        "'backup_delete', " .
                        "'".$backup_id."', " .
                        "'pending', " .
                        "''" .
                        ")";
                    $app->db->query($sql);
                        "VALUES (?, UNIX_TIMESTAMP(), 'backup_delete', ?, 'pending', '')";
                    $app->db->query($sql, $server_id, $backup_id);
                } else {
                    $error .= $wb['delete_pending_txt'];
                }
interface/lib/classes/plugin_backuplist_mail.inc.php
@@ -62,7 +62,7 @@
                if($tmp['number'] == 0) {
                    $message .= $wb['restore_info_txt'];
                    $sql =     "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " .
                    "VALUES (?, ? 'backup_restore_mail', ?, 'pending','')";
                    "VALUES (?, ?, 'backup_restore_mail', ?, 'pending','')";
                    $app->db->query($sql, $this->form->dataRecord['server_id'], time(), $backup_id);
                } else {
                    $error .= $wb['restore_pending_txt'];
@@ -75,15 +75,8 @@
                if($tmp['number'] == 0) {
                    $message .= $wb['delete_info_txt'];
                    $sql =     "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " .
                    "VALUES (".
                        (int)$this->form->dataRecord['server_id'] . ", " .
                        time() . ", " .
                        "'backup_delete_mail', " .
                        "'".$backup_id."', " .
                        "'pending', " .
                        "''" .
                    ")";
                    $app->db->query($sql);
                    "VALUES (?, ?, 'backup_delete_mail, ?, 'pending', '')";
                    $app->db->query($sql, $this->form->dataRecord['server_id'], time(), $backup_id);
                } else {
                    $error .= $wb['delete_pending_txt'];
                }