Florian Schaal
2015-01-08 0e72ef1fd668741f348fa71382dca32cd03dd0c3
fixed sql-queries
3 files modified
8 ■■■■ changed files
interface/web/dns/dns_dkim_edit.php 2 ●●● patch | view | raw | blame | history
interface/web/mail/mail_domain_dkim_create.php 4 ●●●● patch | view | raw | blame | history
server/plugins-available/mail_plugin.inc.php 2 ●●● patch | view | raw | blame | history
interface/web/dns/dns_dkim_edit.php
old mode 100644 new mode 100755
@@ -71,7 +71,7 @@
        parent::onShowNew();
        $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND ?'", $_GET['zone'], $app->tform->getAuthSQL('r'));
        $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND ?", $_GET['zone'], $app->tform->getAuthSQL('r'));
        $sql=$app->db->queryOneRecord("SELECT dkim_public, dkim_selector FROM mail_domain WHERE domain = ? AND dkim = 'y' AND ?", substr_replace($soa['origin'],'',-1), $app->tform->getAuthSQL('r'));
        $public_key=str_replace(array('-----BEGIN PUBLIC KEY-----','-----END PUBLIC KEY-----',"\r","\n"),'',$sql['dkim_public']);
        $app->tpl->setVar('public_key', $public_key);
interface/web/mail/mail_domain_dkim_create.php
old mode 100644 new mode 100755
@@ -89,10 +89,10 @@
    //* validate post-values
    if ( validate_domain($domain) && validate_selector($old_selector) ) {
        //* get active selectors from dns
        $soa_rec = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE active = 'Y' AND origin = ?");
        $soa_rec = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE active = 'Y' AND origin = ?", $domain.'.');
        if ( isset($soa_rec) && !empty($soa_rec) ) {
            //* check for a dkim-record in the dns?
            $dns_data = $app->db->queryOneRecord("SELECT name FROM dns_rr WHERE name = ? AND active = 'Y''", $old_selector.'._domainkey.'.$domain.'.');
            $dns_data = $app->db->queryOneRecord("SELECT name FROM dns_rr WHERE name = ? AND active = 'Y'", $old_selector.'._domainkey.'.$domain.'.');
            if ( !empty($dns_data) ){
                $selector = str_replace( '._domainkey.'.$domain.'.', '', $dns_data['name']);
            } else {
server/plugins-available/mail_plugin.inc.php
@@ -457,7 +457,7 @@
                exec(escapeshellcmd('rm -rf '.$mail_backup_dir));
                //* cleanup database
                $sql = "DELETE FROM mail_backup WHERE server_id = ? AND parent_domain_id = ? AND mailuser_id = ?";
                $app->db->query($sql, $conf['server_id'], $domain_rec['domain_id'], $data['old']['mailuser_id']);
                $app->db->query($sql, $conf['server_id'], $data['old']['domain_id'], $data['old']['mailuser_id']);
                if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql, $conf['server_id'], $domain_rec['domain_id'], $data['old']['mailuser_id']);
                $app->log('Deleted the mail backup directory: '.$mail_backup_dir, LOGLEVEL_DEBUG);