if ($currentWfsConf !== null) {
             $result[] = $currentWfsConf;
         }
     }
     $ajaxResponse->setResult($result);
     $ajaxResponse->send();
     break;
 case "getWfsConfs":
     $currentUser = new User(Mapbender::session()->get("mb_user_id"));
     $wfsConfIds = $currentUser->getWfsConfByWfsOwner();
     if ($wfsConfIds === null) {
         $wfsConfIds = array();
     }
     $result = array();
     foreach ($wfsConfIds as $id) {
         $currentWfsConf = WfsConfiguration::createFromDb($id);
         if ($currentWfsConf !== null) {
             $result[] = $currentWfsConf;
         }
     }
     $ajaxResponse->setResult($result);
     $ajaxResponse->send();
     break;
 case "getWfs":
     $aWFS = new wfs_conf();
     $aWFS->getallwfs(Mapbender::session()->get("mb_user_id"));
     $result = array();
     for ($i = 0; $i < count($aWFS->wfs_id); $i++) {
         // featuretypes
         $featuretypeArray = array();
         $aWFS->getfeatures($aWFS->wfs_id[$i]);
    $availableWfsConfIds = $user->getWfsConfByPermission(Mapbender::session()->get("mb_user_gui"));
    $obj = new WfsConf();
    $obj->load($availableWfsConfIds);
    $json = new Mapbender_JSON();
    $output = $json->encode($obj->confArray);
    echo $output;
} else {
    if ($command == "getSearchResults") {
        $wfs_conf_id = $_REQUEST["wfs_conf_id"];
        $backlink = $_REQUEST["backlink"];
        $frame = $_REQUEST["frame"];
        $filter = $_REQUEST["filter"];
        $url = $_REQUEST["url"];
        $typename = $_REQUEST["typename"];
        $destSrs = $_REQUEST["destSrs"];
        $wfsConf = WfsConfiguration::createFromDb($wfs_conf_id);
        if (is_null($wfsConf)) {
            sendErrorMessage("Invalid WFS conf: " . $wfs_conf_id);
        }
        // append authorisation condition to filter
        $filter = checkAccessConstraint($filter, $wfs_conf_id);
        $admin = new administration();
        $filter = administration::convertIncomingString($filter);
        $wfsId = $wfsConf->wfsId;
        $myWfsFactory = new UniversalWfsFactory();
        $myWfs = $myWfsFactory->createFromDb($wfsId);
        $data = $myWfs->getFeature($typename, $filter, $destSrs);
        if ($data === null) {
            die('{}');
        }
        if (defined("WFS_RESPONSE_SIZE_LIMIT") && WFS_RESPONSE_SIZE_LIMIT < strlen($data)) {