ftimme
2012-03-07 f0ed72bf69ac76b872d8040d85efaf5b0c51040a
interface/web/sites/web_domain_edit.php
@@ -74,6 +74,11 @@
         if(!$app->tform->checkResellerLimit('limit_web_domain',"type = 'vhost'")) {
            $app->error('Reseller: '.$app->tform->wordbook["limit_web_domain_txt"]);
         }
         // Get the limits of the client
         $client_group_id = $_SESSION["s"]["user"]["default_group"];
         $client = $app->db->queryOneRecord("SELECT client.default_webserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
         $app->tpl->setVar("server_id_value", $client['default_webserver']);
      }
      parent::onShowNew();
@@ -123,6 +128,20 @@
         $app->tpl->setVar("ipv6_address",$ip_select);
         unset($tmp);
         unset($ips);
         //PHP Version Selection (FastCGI)
         $sql = "SELECT * FROM server_php WHERE php_fastcgi_binary != '' AND php_fastcgi_ini_dir != '' AND server_id = ".$client['default_webserver']." AND (client_id = 0 OR client_id=".$_SESSION['s']['user']['client_id'].")";
         $php_records = $app->db->queryAllRecords($sql);
         $php_select = "<option value=''>Default</option>";
         if(is_array($php_records) && !empty($php_records)) {
            foreach( $php_records as $php_record) {
               $php_version = $php_record['name'].':'.$php_record['php_fastcgi_binary'].':'.$php_record['php_fastcgi_ini_dir'];
               $selected = ($php_version == $this->dataRecord["fastcgi_php_version"])?'SELECTED':'';
               $php_select .= "<option value='$php_version' $selected>".$php_record['name']."</option>\r\n";
            }
         }
         $app->tpl->setVar("fastcgi_php_version",$php_select);
         unset($php_records);
         //* 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'])) {
@@ -179,6 +198,20 @@
         $app->tpl->setVar("ipv6_address",$ip_select);
         unset($tmp);
         unset($ips);
         //PHP Version Selection (FastCGI)
         $sql = "SELECT * FROM server_php WHERE php_fastcgi_binary != '' AND php_fastcgi_ini_dir != '' AND server_id = ".$client['default_webserver']." AND (client_id = 0 OR client_id=".$_SESSION['s']['user']['client_id'].")";
         $php_records = $app->db->queryAllRecords($sql);
         $php_select = "<option value=''>Default</option>";
         if(is_array($php_records) && !empty($php_records)) {
            foreach( $php_records as $php_record) {
               $php_version = $php_record['name'].':'.$php_record['php_fastcgi_binary'].':'.$php_record['php_fastcgi_ini_dir'];
               $selected = ($php_version == $this->dataRecord["fastcgi_php_version"])?'SELECTED':'';
               $php_select .= "<option value='$php_version' $selected>".$php_record['name']."</option>\r\n";
            }
         }
         $app->tpl->setVar("fastcgi_php_version",$php_select);
         unset($php_records);
         //* Admin: If the logged in user is admin
      } else {
@@ -221,6 +254,20 @@
         $app->tpl->setVar("ipv6_address",$ip_select);
         unset($tmp);
         unset($ips);
         //PHP Version Selection (FastCGI)
         $sql = "SELECT * FROM server_php WHERE php_fastcgi_binary != '' AND php_fastcgi_ini_dir != '' AND server_id = $server_id";
         $php_records = $app->db->queryAllRecords($sql);
         $php_select = "<option value=''>Default</option>";
         if(is_array($php_records) && !empty($php_records)) {
            foreach( $php_records as $php_record) {
               $php_version = $php_record['name'].':'.$php_record['php_fastcgi_binary'].':'.$php_record['php_fastcgi_ini_dir'];
               $selected = ($php_version == $this->dataRecord["fastcgi_php_version"])?'SELECTED':'';
               $php_select .= "<option value='$php_version' $selected>".$php_record['name']."</option>\r\n";
            }
         }
         $app->tpl->setVar("fastcgi_php_version",$php_select);
         unset($php_records);
         // Fill the client select field
         $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name";