[Mapbender-commits] r9139 - trunk/mapbender/http/plugins
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Jan 8 00:40:35 PST 2015
Author: verenadiewald
Date: 2015-01-08 00:40:35 -0800 (Thu, 08 Jan 2015)
New Revision: 9139
Modified:
trunk/mapbender/http/plugins/mb_owsproxy_log_csv.php
Log:
enable two ways of filling the user select box in the form for owsproxy_csv
Modified: trunk/mapbender/http/plugins/mb_owsproxy_log_csv.php
===================================================================
--- trunk/mapbender/http/plugins/mb_owsproxy_log_csv.php 2015-01-06 15:37:29 UTC (rev 9138)
+++ trunk/mapbender/http/plugins/mb_owsproxy_log_csv.php 2015-01-08 08:40:35 UTC (rev 9139)
@@ -1,6 +1,7 @@
<?php
require_once dirname(__FILE__) . "/../../core/globalSettings.php";
+require_once dirname(__FILE__) . "/../../conf/geoportal.conf";
$LIMIT_INT = OWS_LOG_EXPORT_LIMIT;
@@ -28,20 +29,60 @@
if($_REQUEST['action'] == "getForm"){
$mb_user_id = $_SESSION['mb_user_id'];
- $v = array($mb_user_id);
- $t = array('i');
- $users = array();
- $wmses = array();
- $sql = "SELECT DISTINCT u.mb_user_id, w.wms_id,w.wms_title,u.mb_user_name"
- ." FROM mb_proxy_log AS m INNER JOIN wms AS w ON"
- ." (m.fkey_wms_id = w.wms_id AND w.wms_owner=$1)"
- ." INNER JOIN mb_user u ON(m.fkey_mb_user_id = u.mb_user_id)"
- ." ORDER BY u.mb_user_name ASC, u.mb_user_id ";
- $result = db_prep_query($sql,$v,$t);
- while($row = db_fetch_assoc($result)){
- $users[$row['mb_user_id']] = $row['mb_user_name'];
- $wmses[$row['wms_id']] = $row['wms_title'];
+ if (defined("SECURED_SERVICES_GUIS") && SECURED_SERVICES_GUIS !== "" ) {
+ // SQL für WMS Services
+ $v = array($mb_user_id);
+ $t = array('i');
+ $wmses = array();
+ $sql = "SELECT DISTINCT w.wms_id,w.wms_title"
+ ." FROM mb_proxy_log AS m INNER JOIN wms AS w ON"
+ ." (m.fkey_wms_id = w.wms_id AND w.wms_owner=$1)"
+ ." ORDER BY w.wms_title ";
+ $result = db_prep_query($sql,$v,$t);
+ while($row = db_fetch_assoc($result)){
+ #$users[$row['mb_user_id']] = $row['mb_user_name'];
+ $wmses[$row['wms_id']] = $row['wms_title'];
+ }
+
+ // SQL für User mit geschützten Diensten
+ $securedServiceGuis = explode(",", SECURED_SERVICES_GUIS);
+
+ $vUser = array();
+ $tUser = array();
+ $users = array();
+ $sqlUser = "SELECT DISTINCT g.fkey_mb_user_id, u.mb_user_name FROM gui_mb_user g ".
+ "LEFT JOIN mb_user u ON u.mb_user_id = g.fkey_mb_user_id ".
+ "WHERE fkey_gui_id ";
+ $inOffset = 1;
+ foreach($securedServiceGuis as $gui) {
+ $vUser[] = trim($gui);
+ $tUser[] = "s";
+ $inParams[] = "$".$inOffset;
+ $inOffset++;
+ }
+ $sqlUser .= "IN (" .implode(",",$inParams) .")";
+ $sqlUser .= " ORDER BY u.mb_user_name ASC;";
+ $resultUser = db_prep_query($sqlUser,$vUser,$tUser);
+ while($rowUser = db_fetch_assoc($resultUser)){
+ $users[$rowUser['fkey_mb_user_id']] = $rowUser['mb_user_name'];
+ }
}
+ else {
+ $v = array($mb_user_id);
+ $t = array('i');
+ $users = array();
+ $wmses = array();
+ $sql = "SELECT DISTINCT u.mb_user_id, w.wms_id,w.wms_title,u.mb_user_name"
+ ." FROM mb_proxy_log AS m INNER JOIN wms AS w ON"
+ ." (m.fkey_wms_id = w.wms_id AND w.wms_owner=$1)"
+ ." INNER JOIN mb_user u ON(m.fkey_mb_user_id = u.mb_user_id)"
+ ." ORDER BY u.mb_user_name ASC, u.mb_user_id ";
+ $result = db_prep_query($sql,$v,$t);
+ while($row = db_fetch_assoc($result)){
+ $users[$row['mb_user_id']] = $row['mb_user_name'];
+ $wmses[$row['wms_id']] = $row['wms_title'];
+ }
+ }
$form = '<div class="form">
<input name="serviceType" id="serviceType" value="wms" type="hidden" />
More information about the Mapbender_commits
mailing list