old mode 100644
new mode 100755
| | |
| | | |
| | | 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); |
old mode 100644
new mode 100755
| | |
| | | //* 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 { |
| | |
| | | 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); |