Commit 0e72ef1f authored by Florian Schaal's avatar Florian Schaal

fixed sql-queries

parent 2e9ac915
......@@ -71,7 +71,7 @@ class page_action extends tform_actions {
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);
......
......@@ -89,10 +89,10 @@ function new_selector ($old_selector, $domain, $client_id = -1) {
//* 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 {
......
......@@ -457,7 +457,7 @@ class mail_plugin {
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);
......
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