$password = passwordgenerate(20);
             }
             if ($row2['action'] == 'dl') {
                 $command = $gsprache->del . ' MySQLDBID: ' . $row2['affectedID'] . ' DBName: ' . $row4['dbname'];
                 $remotesql->DelDB($dbname);
                 $query5->execute(array($row2['affectedID']));
                 customColumns('M', $row2['affectedID'], 'del');
             } else {
                 if ($row2['action'] == 'ad') {
                     $command = $gsprache->add . ' MySQLDBID: ' . $row2['affectedID'] . ' DBName: ' . $row4['dbname'];
                     $mailData['userId'] = $row4['uid'];
                     $mailData['name'] = strlen($row4['description']) > 0 ? $row4['description'] : $row4['dbname'];
                     $remotesql->AddDB($mailData, $dbname, $password, $ips, $max_queries_per_hour, $max_connections_per_hour, $max_updates_per_hour, $max_userconnections_per_hour);
                 } else {
                     $command = $gsprache->mod . ' MySQLDBID: ' . $row2['affectedID'] . ' DBName: ' . $row4['dbname'];
                     $remotesql->ModDB($dbname, $password, $ips, $max_queries_per_hour, $max_connections_per_hour, $max_updates_per_hour, $max_userconnections_per_hour);
                 }
             }
             $theOutput->printGraph($command);
         }
         $query6->execute(array($row2['jobID']));
     }
 } else {
     if (isset($remotesql)) {
         $query7->execute(array($row['hostID']));
     } else {
         $query8->execute(array($row['hostID']));
         $query3->execute(array($row['hostID']));
         while ($row3 = $query3->fetch(PDO::FETCH_ASSOC)) {
             if ($row2['action'] == 'dl') {
                 $query5->execute(array($row2['affectedID']));
     }
 } else {
     if ($ui->smallletters('action', 2, 'post') == 'md' and $ui->st('d', 'get') != 'ri') {
         if ($ui->password('password', 255, 'post')) {
             $query = $sql->prepare("SELECT e.`dbname`,e.`manage_host_table`,e.`ips`,e.`max_queries_per_hour`,e.`max_connections_per_hour`,e.`max_updates_per_hour`,e.`max_userconnections_per_hour`,s.`ip`,AES_DECRYPT(s.`password`,?) AS `decryptedpassword2`,s.`port`,s.`user`,CASE WHEN s.`connect_ip_only`='Y' THEN s.`external_address` ELSE s.`ip` END AS `address` FROM `mysql_external_dbs` e INNER JOIN `mysql_external_servers` s ON e.`sid`=s.`id` WHERE e.`id`=? AND e.`active`='Y' AND s.`active`='Y' AND e.`uid`=? AND e.`resellerid`=? LIMIT 1");
             $query->execute(array($aeskey, $id, $user_id, $reseller_id));
             while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
                 $ips = $row['manage_host_table'] == 'Y' ? $ui->ips('ips', 'post') : $row['ips'];
                 $remotesql = new ExternalSQL($row['ip'], $row['port'], $row['user'], $row['decryptedpassword2']);
                 if ($remotesql->error == 'ok') {
                     #https://github.com/easy-wi/developer/issues/42 column description added
                     $query2 = $sql->prepare("UPDATE `mysql_external_dbs` SET `description`=?,`password`=AES_ENCRYPT(?,?),`ips`=? WHERE `id`=? AND `uid`=? AND `resellerid`=? LIMIT 1");
                     $query2->execute(array(trim($ui->startparameter('description', 'post')), $ui->password('password', 255, 'post'), $aeskey, $ips, $id, $user_id, $reseller_id));
                     if ($query2->rowCount() > 0) {
                         $template_file = $spracheResponse->table_add;
                         $dbReturn = $remotesql->ModDB($row['dbname'], $ui->password('password', 255, 'post'), $ips, $row['max_queries_per_hour'], $row['max_connections_per_hour'], $row['max_updates_per_hour'], $row['max_userconnections_per_hour']);
                         if (isset($dbConnect['debug']) and $dbConnect['debug'] == 1) {
                             $template_file .= '<br>' . $dbReturn;
                         }
                         $loguseraction = '%mod% MYSQL DB ' . $row['dbname'] . ' (' . $row['address'] . ')';
                         $insertlog->execute();
                     } else {
                         $template_file = $spracheResponse->error_table;
                     }
                 } else {
                     $template_file = $remotesql->error;
                 }
             }
             if (!isset($remotesql)) {
                 $template_file = 'userpanel_404.tpl';
             }