ftimme
2012-03-07 f0ed72bf69ac76b872d8040d85efaf5b0c51040a
interface/web/sites/ajax_get_json.php
@@ -38,7 +38,7 @@
$web_id = intval($_GET["web_id"]);
$type = $_GET["type"];
if($_SESSION["s"]["user"]["typ"] == 'admin') {
//if($_SESSION["s"]["user"]["typ"] == 'admin') {
   if($type == 'getservertype'){
      $json = '{"servertype":"';
@@ -59,8 +59,24 @@
      unset($server);
      $json .= '"}';
   }
   if($type == 'getphpfastcgi'){
      $json = '{';
      $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 = "";
      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'];
            $json .= '"'.$php_version.'": "'.$php_record['name'].'",';
         }
      }
      unset($php_records);
      if(substr($json,-1) == ',') $json = substr($json,0,-1);
      $json .= '}';
   }
}
//}
echo $json;
?>