Till Brehm
2016-05-27 51a7b5e29a1cbf53e9858a6b11aa0be1f8fc59d2
interface/web/mail/mail_domain_edit.php
@@ -210,7 +210,7 @@
      $sql = "SELECT domain, dkim_private, dkim_public, dkim_selector FROM mail_domain WHERE domain_id = ?";
      $rec = $app->db->queryOneRecord($sql, $app->functions->intval($_GET['id']));
      $dns_key = str_replace(array('-----BEGIN PUBLIC KEY-----','-----END PUBLIC KEY-----',"\r","\n"),'',$rec['dkim_public']);
      $dns_record = '.' . $rec['dkim_selector'] . '_domainkey._' . $rec['domain'] . '. 3600   TXT   v=DKIM1; t=s; p=' . $dns_key;
      $dns_record = $rec['dkim_selector'] . '._domainkey.' . $rec['domain'] . '. 3600   TXT   v=DKIM1; t=s; p=' . $dns_key;
      $app->tpl->setVar('dkim_selector', $rec['dkim_selector']);
      $app->tpl->setVar('dkim_private', $rec['dkim_private']);
      $app->tpl->setVar('dkim_public', $rec['dkim_public']);
@@ -241,7 +241,7 @@
      if($_SESSION["s"]["user"]["typ"] != 'admin') {
         // Get the limits of the client
         $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
         $client = $app->db->queryOneRecord("SELECT limit_maildomain, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
         $client = $app->db->queryOneRecord("SELECT client.mail_servers, limit_maildomain, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
         // When the record is updated
         if($this->id > 0) {
            // restore the server ID if the user is not admin and record is edited
@@ -332,7 +332,7 @@
      } else {
         //* We do not allow users to change a domain which has been created by the admin
         $rec = $app->db->queryOneRecord("SELECT domain from mail_domain WHERE domain_id = ?", $this->id);
         if($rec['domain'] != $this->dataRecord["domain"] && $app->tform->checkPerm($this->id, 'u')) {
         if($rec['domain'] != $this->dataRecord["domain"] && !$app->tform->checkPerm($this->id, 'u')) {
            //* Add a error message and switch back to old server
            $app->tform->errorMessage .= $app->lng('The Domain can not be changed. Please ask your Administrator if you want to change the domain name.');
            $this->dataRecord["domain"] = $rec['domain'];