ftimme
2011-09-20 1d6d38ce488ea4d4421eea20fdc3baef43a0b30f
interface/web/sites/web_domain_edit.php
@@ -82,7 +82,7 @@
   function onShowEnd() {
      global $app, $conf;
      //* Client: If the logged in user is not admin and has no sub clients (no rseller)
      //* Client: If the logged in user is not admin and has no sub clients (no reseller)
      if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) {
         // Get the limits of the client
@@ -95,9 +95,7 @@
         unset($tmp);
         // Fill the IP select field with the IP addresses that are allowed for this client
         // $ip_select = "<option value='*'>*</option>";
         // $app->tpl->setVar("ip_address",$ip_select);
         $sql = "SELECT ip_address FROM server_ip WHERE server_id = ".$client['default_webserver'];
         $sql = "SELECT ip_address FROM server_ip WHERE server_id = ".$client['default_webserver']." AND client_id=0 OR client_id=".$_SESSION['s']['user']['client_id'];
         $ips = $app->db->queryAllRecords($sql);
         $ip_select = "<option value='*'>*</option>";
         //$ip_select = "";
@@ -111,7 +109,7 @@
         unset($tmp);
         unset($ips);
         //* Reseller: If the logged in user is not admin and has sub clients (is a rseller)
         //* Reseller: If the logged in user is not admin and has sub clients (is a reseller)
      } elseif ($_SESSION["s"]["user"]["typ"] != 'admin' && $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
         // Get the limits of the client
@@ -138,9 +136,7 @@
         $app->tpl->setVar("client_group_id",$client_select);
         // Fill the IP select field with the IP addresses that are allowed for this client
         //$ip_select = "<option value='*'>*</option>";
         //$app->tpl->setVar("ip_address",$ip_select);
         $sql = "SELECT ip_address FROM server_ip WHERE server_id = ".$client['default_webserver'];
         $sql = "SELECT ip_address FROM server_ip WHERE server_id = ".$client['default_webserver']." AND client_id=0 OR client_id=".$_SESSION['s']['user']['client_id'];
         $ips = $app->db->queryAllRecords($sql);
         $ip_select = "<option value='*'>*</option>";
         //$ip_select = "";
@@ -563,12 +559,16 @@
         unset($subdomain);
      }
      //* Set allow_override and php_open_basedir if empty
      //* Set allow_override if empty
      if($web_rec['allow_override'] == '') {
         $sql = "UPDATE web_domain SET allow_override = '".$app->db->quote($web_config["htaccess_allow_override"])."' WHERE domain_id = ".$this->id;
         $app->db->query($sql);
      }
      if($web_rec['php_open_basedir'] == '' || (isset($this->dataRecord["client_group_id"]) && $this->dataRecord["client_group_id"] != $this->oldDataRecord["sys_groupid"])) {
      //* Set php_open_basedir if empty or domain or client has been changed
      if($web_rec['php_open_basedir'] == '' ||
      ($this->dataRecord["domain"] != '' && $this->oldDataRecord["domain"] != '' && $this->dataRecord["domain"] != $this->oldDataRecord["domain"]) ||
      (isset($this->dataRecord["client_group_id"]) && $this->dataRecord["client_group_id"] != $this->oldDataRecord["sys_groupid"])) {
         $document_root = $app->db->quote(str_replace("[client_id]",$client_id,$document_root));
         $php_open_basedir = str_replace("[website_path]",$document_root,$web_config["php_open_basedir"]);
         $php_open_basedir = $app->db->quote(str_replace("[website_domain]",$web_rec['domain'],$php_open_basedir));