Marius Cramer
2015-04-07 cc7a82756b4f4d7ab18e928527c37489adbaf564
interface/web/sites/web_childdomain_edit.php
@@ -136,7 +136,7 @@
      } else {
         if($this->_childdomain_type == 'subdomain') {
            // Get the record of the parent domain
            $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".$app->functions->intval(@$this->dataRecord["parent_domain_id"]));
            $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ?", @$this->dataRecord["parent_domain_id"]);
            // remove the parent domain part of the domain name before we show it in the text field.
            $this->dataRecord["domain"] = str_replace('.'.$parent_domain["domain"], '', $this->dataRecord["domain"]);
@@ -168,13 +168,13 @@
      
      // Get the record of the parent domain
      if(!@$this->dataRecord["parent_domain_id"] && $this->id) {
         $tmp = $app->db->queryOneRecord("SELECT parent_domain_id FROM web_domain WHERE domain_id = ".$app->functions->intval($this->id));
         $tmp = $app->db->queryOneRecord("SELECT parent_domain_id FROM web_domain WHERE domain_id = ?", $this->id);
         if($tmp) $this->dataRecord["parent_domain_id"] = $tmp['parent_domain_id'];
         unset($tmp);
      }
      // Get the record of the parent domain
      $parent_domain = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval(@$this->dataRecord["parent_domain_id"]) . " AND ".$app->tform->getAuthSQL('r'));
      $parent_domain = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ? AND ".$app->tform->getAuthSQL('r'), @$this->dataRecord["parent_domain_id"]);
      if(!$parent_domain || $parent_domain['domain_id'] != @$this->dataRecord['parent_domain_id']) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm");
      /* check if the domain module is used - and check if the selected domain can be used! */
      $app->uses('ini_parser,getconf');
@@ -236,7 +236,7 @@
         //* Update the old website, so that the vhost alias gets removed
         //* We force the update by inserting a transaction record without changes manually.
         $old_website = $app->db->queryOneRecord('SELECT * FROM web_domain WHERE domain_id = '.$app->functions->intval($this->oldDataRecord['domain_id']));
         $old_website = $app->db->queryOneRecord('SELECT * FROM web_domain WHERE domain_id = ?', $this->oldDataRecord['domain_id']);
         $app->db->datalogSave('web_domain', 'UPDATE', 'domain_id', $app->functions->intval($this->oldDataRecord['parent_domain_id']), $old_website, $old_website, true);
      }