Falko Timme
2013-10-18 2d2fd172e1548dd24e1719accd0b856cff6a31a0
interface/web/sites/web_subdomain_edit.php
@@ -132,7 +132,8 @@
      global $app, $conf;
      
        // 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 = ".$app->functions->intval(@$this->dataRecord["parent_domain_id"]) . " AND ".$app->tform->getAuthSQL('r'));
        if(!$parent_domain || $parent_domain['domain_id'] != @$this->dataRecord['parent_domain_id']) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm");
        
      $app->uses('ini_parser,getconf');
      $settings = $app->getconf->get_global_config('domains');
@@ -147,6 +148,11 @@
        } else {
            $this->dataRecord["domain"] = $this->dataRecord["domain"].'.'.$parent_domain["domain"];
        }
      // nginx: if redirect type is proxy and redirect path is no URL, display error
      if($this->dataRecord["redirect_type"] == 'proxy' && substr($this->dataRecord['redirect_path'],0,1) == '/'){
         $app->tform->errorMessage .= $app->tform->lng("error_proxy_requires_url")."<br />";
      }
        
      // Set a few fixed values
      $this->dataRecord["type"] = 'subdomain';