[Mapbender-commits] r9487 - trunk/mapbender/http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri May 27 00:11:29 PDT 2016
Author: armin11
Date: 2016-05-27 00:11:28 -0700 (Fri, 27 May 2016)
New Revision: 9487
Removed:
trunk/mapbender/http/php/apc.php
trunk/mapbender/http/php/mod_editGuiWmsMeta.php_deprecated
trunk/mapbender/http/php/mod_export_image.php_deprecated
trunk/mapbender/http/php/mod_getStyles.php_deprecated
trunk/mapbender/http/php/mod_layerISOMetadataWriteToFolder.php
trunk/mapbender/http/php/mod_treefolderAdmin.php_deprecated
trunk/mapbender/http/php/nestedSets.php_deprecated
Log:
Fix wrong commit
Deleted: trunk/mapbender/http/php/apc.php
===================================================================
--- trunk/mapbender/http/php/apc.php 2016-05-27 07:07:37 UTC (rev 9486)
+++ trunk/mapbender/http/php/apc.php 2016-05-27 07:11:28 UTC (rev 9487)
@@ -1,1362 +0,0 @@
-<?php
-/*
- +----------------------------------------------------------------------+
- | APC |
- +----------------------------------------------------------------------+
- | Copyright (c) 2006-2008 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license at php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Ralf Becker <beckerr at php.net> |
- | Rasmus Lerdorf <rasmus at php.net> |
- | Ilia Alshanetsky <ilia at prohost.org> |
- +----------------------------------------------------------------------+
-
- All other licensing and usage conditions are those of the PHP Group.
-
- */
-
-$VERSION='$Id: apc.php 271315 2008-12-16 07:15:07Z shire $';
-
-////////// READ OPTIONAL CONFIGURATION FILE ////////////
-if (file_exists("apc.conf.php")) include("apc.conf.php");
-////////////////////////////////////////////////////////
-
-////////// BEGIN OF DEFAULT CONFIG AREA ///////////////////////////////////////////////////////////
-
-defaults('USE_AUTHENTICATION',1); // Use (internal) authentication - best choice if
- // no other authentication is available
- // If set to 0:
- // There will be no further authentication. You
- // will have to handle this by yourself!
- // If set to 1:
- // You need to change ADMIN_PASSWORD to make
- // this work!
-defaults('ADMIN_USERNAME','apc'); // Admin Username
-defaults('ADMIN_PASSWORD','apc'); // Admin Password - CHANGE THIS TO ENABLE!!!
-
-// (beckerr) I'm using a clear text password here, because I've no good idea how to let
-// users generate a md5 or crypt password in a easy way to fill it in above
-
-//defaults('DATE_FORMAT', "d.m.Y H:i:s"); // German
-defaults('DATE_FORMAT', 'Y/m/d H:i:s'); // US
-
-defaults('GRAPH_SIZE',200); // Image size
-
-//defaults('PROXY', 'tcp://127.0.0.1:8080');
-
-////////// END OF DEFAULT CONFIG AREA /////////////////////////////////////////////////////////////
-
-
-// "define if not defined"
-function defaults($d,$v) {
- if (!defined($d)) define($d,$v); // or just @define(...)
-}
-
-// rewrite $PHP_SELF to block XSS attacks
-//
-$PHP_SELF= isset($_SERVER['PHP_SELF']) ? htmlentities(strip_tags($_SERVER['PHP_SELF'],''), ENT_QUOTES, 'UTF-8') : '';
-$time = time();
-$host = php_uname('n');
-if($host) { $host = '('.$host.')'; }
-if ($_SERVER['SERVER_ADDR']) {
- $host .= ' ('.$_SERVER['SERVER_ADDR'].')';
-}
-
-// operation constants
-define('OB_HOST_STATS',1);
-define('OB_SYS_CACHE',2);
-define('OB_USER_CACHE',3);
-define('OB_SYS_CACHE_DIR',4);
-define('OB_VERSION_CHECK',9);
-
-// check validity of input variables
-$vardom=array(
- 'OB' => '/^\d+$/', // operational mode switch
- 'CC' => '/^[01]$/', // clear cache requested
- 'DU' => '/^.*$/', // Delete User Key
- 'SH' => '/^[a-z0-9]+$/', // shared object description
-
- 'IMG' => '/^[123]$/', // image to generate
- 'LO' => '/^1$/', // login requested
-
- 'COUNT' => '/^\d+$/', // number of line displayed in list
- 'SCOPE' => '/^[AD]$/', // list view scope
- 'SORT1' => '/^[AHSMCDTZ]$/', // first sort key
- 'SORT2' => '/^[DA]$/', // second sort key
- 'AGGR' => '/^\d+$/', // aggregation by dir level
- 'SEARCH' => '~^[a-zA-Z0-1/_.-]*$~' // aggregation by dir level
-);
-
-// default cache mode
-$cache_mode='opcode';
-
-// cache scope
-$scope_list=array(
- 'A' => 'cache_list',
- 'D' => 'deleted_list'
-);
-
-// handle POST and GET requests
-if (empty($_REQUEST)) {
- if (!empty($_GET) && !empty($_POST)) {
- $_REQUEST = array_merge($_GET, $_POST);
- } else if (!empty($_GET)) {
- $_REQUEST = $_GET;
- } else if (!empty($_POST)) {
- $_REQUEST = $_POST;
- } else {
- $_REQUEST = array();
- }
-}
-
-// check parameter syntax
-foreach($vardom as $var => $dom) {
- if (!isset($_REQUEST[$var])) {
- $MYREQUEST[$var]=NULL;
- } else if (!is_array($_REQUEST[$var]) && preg_match($dom.'D',$_REQUEST[$var])) {
- $MYREQUEST[$var]=$_REQUEST[$var];
- } else {
- $MYREQUEST[$var]=$_REQUEST[$var]=NULL;
- }
-}
-
-// check parameter sematics
-if (empty($MYREQUEST['SCOPE'])) $MYREQUEST['SCOPE']="A";
-if (empty($MYREQUEST['SORT1'])) $MYREQUEST['SORT1']="H";
-if (empty($MYREQUEST['SORT2'])) $MYREQUEST['SORT2']="D";
-if (empty($MYREQUEST['OB'])) $MYREQUEST['OB']=OB_HOST_STATS;
-if (!isset($MYREQUEST['COUNT'])) $MYREQUEST['COUNT']=20;
-if (!isset($scope_list[$MYREQUEST['SCOPE']])) $MYREQUEST['SCOPE']='A';
-
-$MY_SELF=
- "$PHP_SELF".
- "?SCOPE=".$MYREQUEST['SCOPE'].
- "&SORT1=".$MYREQUEST['SORT1'].
- "&SORT2=".$MYREQUEST['SORT2'].
- "&COUNT=".$MYREQUEST['COUNT'];
-$MY_SELF_WO_SORT=
- "$PHP_SELF".
- "?SCOPE=".$MYREQUEST['SCOPE'].
- "&COUNT=".$MYREQUEST['COUNT'];
-
-// authentication needed?
-//
-if (!USE_AUTHENTICATION) {
- $AUTHENTICATED=1;
-} else {
- $AUTHENTICATED=0;
- if (ADMIN_PASSWORD!='password' && ($MYREQUEST['LO'] == 1 || isset($_SERVER['PHP_AUTH_USER']))) {
-
- if (!isset($_SERVER['PHP_AUTH_USER']) ||
- !isset($_SERVER['PHP_AUTH_PW']) ||
- $_SERVER['PHP_AUTH_USER'] != ADMIN_USERNAME ||
- $_SERVER['PHP_AUTH_PW'] != ADMIN_PASSWORD) {
- Header("WWW-Authenticate: Basic realm=\"APC Login\"");
- Header("HTTP/1.0 401 Unauthorized");
-
- echo <<<EOB
- <html><body>
- <h1>Rejected!</h1>
- <big>Wrong Username or Password!</big><br/> <br/>
- <big><a href='$PHP_SELF?OB={$MYREQUEST['OB']}'>Continue...</a></big>
- </body></html>
-EOB;
- exit;
-
- } else {
- $AUTHENTICATED=1;
- }
- }
-}
-
-// select cache mode
-if ($AUTHENTICATED && $MYREQUEST['OB'] == OB_USER_CACHE) {
- $cache_mode='user';
-}
-// clear cache
-if ($AUTHENTICATED && isset($MYREQUEST['CC']) && $MYREQUEST['CC']) {
- apc_clear_cache($cache_mode);
-}
-
-if ($AUTHENTICATED && !empty($MYREQUEST['DU'])) {
- apc_delete($MYREQUEST['DU']);
-}
-
-if(!function_exists('apc_cache_info') || !($cache=@apc_cache_info($cache_mode))) {
- echo "No cache info available. APC does not appear to be running.";
- exit;
-}
-
-$cache_user = apc_cache_info('user', 1);
-$mem=apc_sma_info();
-if(!$cache['num_hits']) { $cache['num_hits']=1; $time++; } // Avoid division by 0 errors on a cache clear
-
-// don't cache this page
-//
-header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
-header("Cache-Control: post-check=0, pre-check=0", false);
-header("Pragma: no-cache"); // HTTP/1.0
-
-function duration($ts) {
- global $time;
- $years = (int)((($time - $ts)/(7*86400))/52.177457);
- $rem = (int)(($time-$ts)-($years * 52.177457 * 7 * 86400));
- $weeks = (int)(($rem)/(7*86400));
- $days = (int)(($rem)/86400) - $weeks*7;
- $hours = (int)(($rem)/3600) - $days*24 - $weeks*7*24;
- $mins = (int)(($rem)/60) - $hours*60 - $days*24*60 - $weeks*7*24*60;
- $str = '';
- if($years==1) $str .= "$years year, ";
- if($years>1) $str .= "$years years, ";
- if($weeks==1) $str .= "$weeks week, ";
- if($weeks>1) $str .= "$weeks weeks, ";
- if($days==1) $str .= "$days day,";
- if($days>1) $str .= "$days days,";
- if($hours == 1) $str .= " $hours hour and";
- if($hours>1) $str .= " $hours hours and";
- if($mins == 1) $str .= " 1 minute";
- else $str .= " $mins minutes";
- return $str;
-}
-
-// create graphics
-//
-function graphics_avail() {
- return extension_loaded('gd');
-}
-if (isset($MYREQUEST['IMG']))
-{
- if (!graphics_avail()) {
- exit(0);
- }
-
- function fill_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1,$color2,$text='',$placeindex=0) {
- $r=$diameter/2;
- $w=deg2rad((360+$start+($end-$start)/2)%360);
-
-
- if (function_exists("imagefilledarc")) {
- // exists only if GD 2.0.1 is avaliable
- imagefilledarc($im, $centerX+1, $centerY+1, $diameter, $diameter, $start, $end, $color1, IMG_ARC_PIE);
- imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2, IMG_ARC_PIE);
- imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color1, IMG_ARC_NOFILL|IMG_ARC_EDGED);
- } else {
- imagearc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2);
- imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2);
- imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start+1)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2);
- imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end-1)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2);
- imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2);
- imagefill($im,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2, $color2);
- }
- if ($text) {
- if ($placeindex>0) {
- imageline($im,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$diameter, $placeindex*12,$color1);
- imagestring($im,4,$diameter, $placeindex*12,$text,$color1);
-
- } else {
- imagestring($im,4,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$text,$color1);
- }
- }
- }
-
- function text_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1,$text,$placeindex=0) {
- $r=$diameter/2;
- $w=deg2rad((360+$start+($end-$start)/2)%360);
-
- if ($placeindex>0) {
- imageline($im,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$diameter, $placeindex*12,$color1);
- imagestring($im,4,$diameter, $placeindex*12,$text,$color1);
-
- } else {
- imagestring($im,4,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$text,$color1);
- }
- }
-
- function fill_box($im, $x, $y, $w, $h, $color1, $color2,$text='',$placeindex='') {
- global $col_black;
- $x1=$x+$w-1;
- $y1=$y+$h-1;
-
- imagerectangle($im, $x, $y1, $x1+1, $y+1, $col_black);
- if($y1>$y) imagefilledrectangle($im, $x, $y, $x1, $y1, $color2);
- else imagefilledrectangle($im, $x, $y1, $x1, $y, $color2);
- imagerectangle($im, $x, $y1, $x1, $y, $color1);
- if ($text) {
- if ($placeindex>0) {
-
- if ($placeindex<16)
- {
- $px=5;
- $py=$placeindex*12+6;
- imagefilledrectangle($im, $px+90, $py+3, $px+90-4, $py-3, $color2);
- imageline($im,$x,$y+$h/2,$px+90,$py,$color2);
- imagestring($im,2,$px,$py-6,$text,$color1);
-
- } else {
- if ($placeindex<31) {
- $px=$x+40*2;
- $py=($placeindex-15)*12+6;
- } else {
- $px=$x+40*2+100*intval(($placeindex-15)/15);
- $py=($placeindex%15)*12+6;
- }
- imagefilledrectangle($im, $px, $py+3, $px-4, $py-3, $color2);
- imageline($im,$x+$w,$y+$h/2,$px,$py,$color2);
- imagestring($im,2,$px+2,$py-6,$text,$color1);
- }
- } else {
- imagestring($im,4,$x+5,$y1-16,$text,$color1);
- }
- }
- }
-
-
- $size = GRAPH_SIZE; // image size
- if ($MYREQUEST['IMG']==3)
- $image = imagecreate(2*$size+150, $size+10);
- else
- $image = imagecreate($size+50, $size+10);
-
- $col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
- $col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30);
- $col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60);
- $col_black = imagecolorallocate($image, 0, 0, 0);
- imagecolortransparent($image,$col_white);
-
- switch ($MYREQUEST['IMG']) {
-
- case 1:
- $s=$mem['num_seg']*$mem['seg_size'];
- $a=$mem['avail_mem'];
- $x=$y=$size/2;
- $fuzz = 0.000001;
-
- // This block of code creates the pie chart. It is a lot more complex than you
- // would expect because we try to visualize any memory fragmentation as well.
- $angle_from = 0;
- $string_placement=array();
- for($i=0; $i<$mem['num_seg']; $i++) {
- $ptr = 0;
- $free = $mem['block_lists'][$i];
- uasort($free, 'block_sort');
- foreach($free as $block) {
- if($block['offset']!=$ptr) { // Used block
- $angle_to = $angle_from+($block['offset']-$ptr)/$s;
- if(($angle_to+$fuzz)>1) $angle_to = 1;
- if( ($angle_to*360) - ($angle_from*360) >= 1) {
- fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_red);
- if (($angle_to-$angle_from)>0.05) {
- array_push($string_placement, array($angle_from,$angle_to));
- }
- }
- $angle_from = $angle_to;
- }
- $angle_to = $angle_from+($block['size'])/$s;
- if(($angle_to+$fuzz)>1) $angle_to = 1;
- if( ($angle_to*360) - ($angle_from*360) >= 1) {
- fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_green);
- if (($angle_to-$angle_from)>0.05) {
- array_push($string_placement, array($angle_from,$angle_to));
- }
- }
- $angle_from = $angle_to;
- $ptr = $block['offset']+$block['size'];
- }
- if ($ptr < $mem['seg_size']) { // memory at the end
- $angle_to = $angle_from + ($mem['seg_size'] - $ptr)/$s;
- if(($angle_to+$fuzz)>1) $angle_to = 1;
- fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_red);
- if (($angle_to-$angle_from)>0.05) {
- array_push($string_placement, array($angle_from,$angle_to));
- }
- }
- }
- foreach ($string_placement as $angle) {
- text_arc($image,$x,$y,$size,$angle[0]*360,$angle[1]*360,$col_black,bsize($s*($angle[1]-$angle[0])));
- }
- break;
-
- case 2:
- $s=$cache['num_hits']+$cache['num_misses'];
- $a=$cache['num_hits'];
-
- fill_box($image, 30,$size,50,-$a*($size-21)/$s,$col_black,$col_green,sprintf("%.1f%%",$cache['num_hits']*100/$s));
- fill_box($image,130,$size,50,-max(4,($s-$a)*($size-21)/$s),$col_black,$col_red,sprintf("%.1f%%",$cache['num_misses']*100/$s));
- break;
-
- case 3:
- $s=$mem['num_seg']*$mem['seg_size'];
- $a=$mem['avail_mem'];
- $x=130;
- $y=1;
- $j=1;
-
- // This block of code creates the bar chart. It is a lot more complex than you
- // would expect because we try to visualize any memory fragmentation as well.
- for($i=0; $i<$mem['num_seg']; $i++) {
- $ptr = 0;
- $free = $mem['block_lists'][$i];
- uasort($free, 'block_sort');
- foreach($free as $block) {
- if($block['offset']!=$ptr) { // Used block
- $h=(GRAPH_SIZE-5)*($block['offset']-$ptr)/$s;
- if ($h>0) {
- $j++;
- if($j<75) fill_box($image,$x,$y,50,$h,$col_black,$col_red,bsize($block['offset']-$ptr),$j);
- else fill_box($image,$x,$y,50,$h,$col_black,$col_red);
- }
- $y+=$h;
- }
- $h=(GRAPH_SIZE-5)*($block['size'])/$s;
- if ($h>0) {
- $j++;
- if($j<75) fill_box($image,$x,$y,50,$h,$col_black,$col_green,bsize($block['size']),$j);
- else fill_box($image,$x,$y,50,$h,$col_black,$col_green);
- }
- $y+=$h;
- $ptr = $block['offset']+$block['size'];
- }
- if ($ptr < $mem['seg_size']) { // memory at the end
- $h = (GRAPH_SIZE-5) * ($mem['seg_size'] - $ptr) / $s;
- if ($h > 0) {
- fill_box($image,$x,$y,50,$h,$col_black,$col_red,bsize($mem['seg_size']-$ptr),$j++);
- }
- }
- }
- break;
- case 4:
- $s=$cache['num_hits']+$cache['num_misses'];
- $a=$cache['num_hits'];
-
- fill_box($image, 30,$size,50,-$a*($size-21)/$s,$col_black,$col_green,sprintf("%.1f%%",$cache['num_hits']*100/$s));
- fill_box($image,130,$size,50,-max(4,($s-$a)*($size-21)/$s),$col_black,$col_red,sprintf("%.1f%%",$cache['num_misses']*100/$s));
- break;
-
- }
- header("Content-type: image/png");
- imagepng($image);
- exit;
-}
-
-// pretty printer for byte values
-//
-function bsize($s) {
- foreach (array('','K','M','G') as $i => $k) {
- if ($s < 1024) break;
- $s/=1024;
- }
- return sprintf("%5.1f %sBytes",$s,$k);
-}
-
-// sortable table header in "scripts for this host" view
-function sortheader($key,$name,$extra='') {
- global $MYREQUEST, $MY_SELF_WO_SORT;
-
- if ($MYREQUEST['SORT1']==$key) {
- $MYREQUEST['SORT2'] = $MYREQUEST['SORT2']=='A' ? 'D' : 'A';
- }
- return "<a class=sortable href=\"$MY_SELF_WO_SORT$extra&SORT1=$key&SORT2=".$MYREQUEST['SORT2']."\">$name</a>";
-
-}
-
-// create menu entry
-function menu_entry($ob,$title) {
- global $MYREQUEST,$MY_SELF;
- if ($MYREQUEST['OB']!=$ob) {
- return "<li><a href=\"$MY_SELF&OB=$ob\">$title</a></li>";
- } else if (empty($MYREQUEST['SH'])) {
- return "<li><span class=active>$title</span></li>";
- } else {
- return "<li><a class=\"child_active\" href=\"$MY_SELF&OB=$ob\">$title</a></li>";
- }
-}
-
-function put_login_link($s="Login")
-{
- global $MY_SELF,$MYREQUEST,$AUTHENTICATED;
- // needs ADMIN_PASSWORD to be changed!
- //
- if (!USE_AUTHENTICATION) {
- return;
- } else if (ADMIN_PASSWORD=='password')
- {
- print <<<EOB
- <a href="#" onClick="javascript:alert('You need to set a password at the top of apc.php before this will work!');return false";>$s</a>
-EOB;
- } else if ($AUTHENTICATED) {
- print <<<EOB
- '{$_SERVER['PHP_AUTH_USER']}' logged in!
-EOB;
- } else{
- print <<<EOB
- <a href="$MY_SELF&LO=1&OB={$MYREQUEST['OB']}">$s</a>
-EOB;
- }
-}
-
-function block_sort($array1, $array2)
-{
- if ($array1['offset'] > $array2['offset']) {
- return 1;
- } else {
- return -1;
- }
-}
-
-
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head><title>APC INFO <?php echo $host ?></title>
-<style><!--
-body { background:white; font-size:100.01%; margin:0; padding:0; }
-body,p,td,th,input,submit { font-size:0.8em;font-family:arial,helvetica,sans-serif; }
-* html body {font-size:0.8em}
-* html p {font-size:0.8em}
-* html td {font-size:0.8em}
-* html th {font-size:0.8em}
-* html input {font-size:0.8em}
-* html submit {font-size:0.8em}
-td { vertical-align:top }
-a { color:black; font-weight:none; text-decoration:none; }
-a:hover { text-decoration:underline; }
-div.content { padding:1em 1em 1em 1em; position:absolute; width:97%; z-index:100; }
-
-
-div.head div.login {
- position:absolute;
- right: 1em;
- top: 1.2em;
- color:white;
- width:6em;
- }
-div.head div.login a {
- position:absolute;
- right: 0em;
- background:rgb(119,123,180);
- border:solid rgb(102,102,153) 2px;
- color:white;
- font-weight:bold;
- padding:0.1em 0.5em 0.1em 0.5em;
- text-decoration:none;
- }
-div.head div.login a:hover {
- background:rgb(193,193,244);
- }
-
-h1.apc { background:rgb(153,153,204); margin:0; padding:0.5em 1em 0.5em 1em; }
-* html h1.apc { margin-bottom:-7px; }
-h1.apc a:hover { text-decoration:none; color:rgb(90,90,90); }
-h1.apc div.logo span.logo {
- background:rgb(119,123,180);
- color:black;
- border-right: solid black 1px;
- border-bottom: solid black 1px;
- font-style:italic;
- font-size:1em;
- padding-left:1.2em;
- padding-right:1.2em;
- text-align:right;
- }
-h1.apc div.logo span.name { color:white; font-size:0.7em; padding:0 0.8em 0 2em; }
-h1.apc div.nameinfo { color:white; display:inline; font-size:0.4em; margin-left: 3em; }
-h1.apc div.copy { color:black; font-size:0.4em; position:absolute; right:1em; }
-hr.apc {
- background:white;
- border-bottom:solid rgb(102,102,153) 1px;
- border-style:none;
- border-top:solid rgb(102,102,153) 10px;
- height:12px;
- margin:0;
- margin-top:1px;
- padding:0;
-}
-
-ol,menu { margin:1em 0 0 0; padding:0.2em; margin-left:1em;}
-ol.menu li { display:inline; margin-right:0.7em; list-style:none; font-size:85%}
-ol.menu a {
- background:rgb(153,153,204);
- border:solid rgb(102,102,153) 2px;
- color:white;
- font-weight:bold;
- margin-right:0em;
- padding:0.1em 0.5em 0.1em 0.5em;
- text-decoration:none;
- margin-left: 5px;
- }
-ol.menu a.child_active {
- background:rgb(153,153,204);
- border:solid rgb(102,102,153) 2px;
- color:white;
- font-weight:bold;
- margin-right:0em;
- padding:0.1em 0.5em 0.1em 0.5em;
- text-decoration:none;
- border-left: solid black 5px;
- margin-left: 0px;
- }
-ol.menu span.active {
- background:rgb(153,153,204);
- border:solid rgb(102,102,153) 2px;
- color:black;
- font-weight:bold;
- margin-right:0em;
- padding:0.1em 0.5em 0.1em 0.5em;
- text-decoration:none;
- border-left: solid black 5px;
- }
-ol.menu span.inactive {
- background:rgb(193,193,244);
- border:solid rgb(182,182,233) 2px;
- color:white;
- font-weight:bold;
- margin-right:0em;
- padding:0.1em 0.5em 0.1em 0.5em;
- text-decoration:none;
- margin-left: 5px;
- }
-ol.menu a:hover {
- background:rgb(193,193,244);
- text-decoration:none;
- }
-
-
-div.info {
- background:rgb(204,204,204);
- border:solid rgb(204,204,204) 1px;
- margin-bottom:1em;
- }
-div.info h2 {
- background:rgb(204,204,204);
- color:black;
- font-size:1em;
- margin:0;
- padding:0.1em 1em 0.1em 1em;
- }
-div.info table {
- border:solid rgb(204,204,204) 1px;
- border-spacing:0;
- width:100%;
- }
-div.info table th {
- background:rgb(204,204,204);
- color:white;
- margin:0;
- padding:0.1em 1em 0.1em 1em;
- }
-div.info table th a.sortable { color:black; }
-div.info table tr.tr-0 { background:rgb(238,238,238); }
-div.info table tr.tr-1 { background:rgb(221,221,221); }
-div.info table td { padding:0.3em 1em 0.3em 1em; }
-div.info table td.td-0 { border-right:solid rgb(102,102,153) 1px; white-space:nowrap; }
-div.info table td.td-n { border-right:solid rgb(102,102,153) 1px; }
-div.info table td h3 {
- color:black;
- font-size:1.1em;
- margin-left:-0.3em;
- }
-
-div.graph { margin-bottom:1em }
-div.graph h2 { background:rgb(204,204,204);; color:black; font-size:1em; margin:0; padding:0.1em 1em 0.1em 1em; }
-div.graph table { border:solid rgb(204,204,204) 1px; color:black; font-weight:normal; width:100%; }
-div.graph table td.td-0 { background:rgb(238,238,238); }
-div.graph table td.td-1 { background:rgb(221,221,221); }
-div.graph table td { padding:0.2em 1em 0.4em 1em; }
-
-div.div1,div.div2 { margin-bottom:1em; width:35em; }
-div.div3 { position:absolute; left:40em; top:1em; width:580px; }
-//div.div3 { position:absolute; left:37em; top:1em; right:1em; }
-
-div.sorting { margin:1.5em 0em 1.5em 2em }
-.center { text-align:center }
-.aright { position:absolute;right:1em }
-.right { text-align:right }
-.ok { color:rgb(0,200,0); font-weight:bold}
-.failed { color:rgb(200,0,0); font-weight:bold}
-
-span.box {
- border: black solid 1px;
- border-right:solid black 2px;
- border-bottom:solid black 2px;
- padding:0 0.5em 0 0.5em;
- margin-right:1em;
-}
-span.green { background:#60F060; padding:0 0.5em 0 0.5em}
-span.red { background:#D06030; padding:0 0.5em 0 0.5em }
-
-div.authneeded {
- background:rgb(238,238,238);
- border:solid rgb(204,204,204) 1px;
- color:rgb(200,0,0);
- font-size:1.2em;
- font-weight:bold;
- padding:2em;
- text-align:center;
- }
-
-input {
- background:rgb(153,153,204);
- border:solid rgb(102,102,153) 2px;
- color:white;
- font-weight:bold;
- margin-right:1em;
- padding:0.1em 0.5em 0.1em 0.5em;
- }
-//-->
-</style>
-</head>
-<body>
-<div class="head">
- <h1 class="apc">
- <div class="logo"><span class="logo"><a href="http://pecl.php.net/package/APC">APC</a></span></div>
- <div class="nameinfo">Opcode Cache</div>
- </h1>
- <div class="login">
- <?php put_login_link(); ?>
- </div>
- <hr class="apc">
-</div>
-<?php
-
-
-// Display main Menu
-echo <<<EOB
- <ol class=menu>
- <li><a href="$MY_SELF&OB={$MYREQUEST['OB']}&SH={$MYREQUEST['SH']}">Refresh Data</a></li>
-EOB;
-echo
- menu_entry(1,'View Host Stats'),
- menu_entry(2,'System Cache Entries');
-if ($AUTHENTICATED) {
- echo menu_entry(4,'Per-Directory Entries');
-}
-echo
- menu_entry(3,'User Cache Entries'),
- menu_entry(9,'Version Check');
-
-if ($AUTHENTICATED) {
- echo <<<EOB
- <li><a class="aright" href="$MY_SELF&CC=1&OB={$MYREQUEST['OB']}" onClick="javascipt:return confirm('Are you sure?');">Clear $cache_mode Cache</a></li>
-EOB;
-}
-echo <<<EOB
- </ol>
-EOB;
-
-
-// CONTENT
-echo <<<EOB
- <div class=content>
-EOB;
-
-// MAIN SWITCH STATEMENT
-
-switch ($MYREQUEST['OB']) {
-
-
-
-
-
-// -----------------------------------------------
-// Host Stats
-// -----------------------------------------------
-case OB_HOST_STATS:
- $mem_size = $mem['num_seg']*$mem['seg_size'];
- $mem_avail= $mem['avail_mem'];
- $mem_used = $mem_size-$mem_avail;
- $seg_size = bsize($mem['seg_size']);
- $req_rate = sprintf("%.2f",($cache['num_hits']+$cache['num_misses'])/($time-$cache['start_time']));
- $hit_rate = sprintf("%.2f",($cache['num_hits'])/($time-$cache['start_time']));
- $miss_rate = sprintf("%.2f",($cache['num_misses'])/($time-$cache['start_time']));
- $insert_rate = sprintf("%.2f",($cache['num_inserts'])/($time-$cache['start_time']));
- $req_rate_user = sprintf("%.2f",($cache_user['num_hits']+$cache_user['num_misses'])/($time-$cache_user['start_time']));
- $hit_rate_user = sprintf("%.2f",($cache_user['num_hits'])/($time-$cache_user['start_time']));
- $miss_rate_user = sprintf("%.2f",($cache_user['num_misses'])/($time-$cache_user['start_time']));
- $insert_rate_user = sprintf("%.2f",($cache_user['num_inserts'])/($time-$cache_user['start_time']));
- $apcversion = phpversion('apc');
- $phpversion = phpversion();
- $number_files = $cache['num_entries'];
- $size_files = bsize($cache['mem_size']);
- $number_vars = $cache_user['num_entries'];
- $size_vars = bsize($cache_user['mem_size']);
- $i=0;
- echo <<< EOB
- <div class="info div1"><h2>General Cache Information</h2>
- <table cellspacing=0><tbody>
- <tr class=tr-0><td class=td-0>APC Version</td><td>$apcversion</td></tr>
- <tr class=tr-1><td class=td-0>PHP Version</td><td>$phpversion</td></tr>
-EOB;
-
- if(!empty($_SERVER['SERVER_NAME']))
- echo "<tr class=tr-0><td class=td-0>APC Host</td><td>{$_SERVER['SERVER_NAME']} $host</td></tr>\n";
- if(!empty($_SERVER['SERVER_SOFTWARE']))
- echo "<tr class=tr-1><td class=td-0>Server Software</td><td>{$_SERVER['SERVER_SOFTWARE']}</td></tr>\n";
-
- echo <<<EOB
- <tr class=tr-0><td class=td-0>Shared Memory</td><td>{$mem['num_seg']} Segment(s) with $seg_size
- <br/> ({$cache['memory_type']} memory, {$cache['locking_type']} locking)
- </td></tr>
-EOB;
- echo '<tr class=tr-1><td class=td-0>Start Time</td><td>',date(DATE_FORMAT,$cache['start_time']),'</td></tr>';
- echo '<tr class=tr-0><td class=td-0>Uptime</td><td>',duration($cache['start_time']),'</td></tr>';
- echo '<tr class=tr-1><td class=td-0>File Upload Support</td><td>',$cache['file_upload_progress'],'</td></tr>';
- echo <<<EOB
- </tbody></table>
- </div>
-
- <div class="info div1"><h2>File Cache Information</h2>
- <table cellspacing=0><tbody>
- <tr class=tr-0><td class=td-0>Cached Files</td><td>$number_files ($size_files)</td></tr>
- <tr class=tr-1><td class=td-0>Hits</td><td>{$cache['num_hits']}</td></tr>
- <tr class=tr-0><td class=td-0>Misses</td><td>{$cache['num_misses']}</td></tr>
- <tr class=tr-1><td class=td-0>Request Rate (hits, misses)</td><td>$req_rate cache requests/second</td></tr>
- <tr class=tr-0><td class=td-0>Hit Rate</td><td>$hit_rate cache requests/second</td></tr>
- <tr class=tr-1><td class=td-0>Miss Rate</td><td>$miss_rate cache requests/second</td></tr>
- <tr class=tr-0><td class=td-0>Insert Rate</td><td>$insert_rate cache requests/second</td></tr>
- <tr class=tr-1><td class=td-0>Cache full count</td><td>{$cache['expunges']}</td></tr>
- </tbody></table>
- </div>
-
- <div class="info div1"><h2>User Cache Information</h2>
- <table cellspacing=0><tbody>
- <tr class=tr-0><td class=td-0>Cached Variables</td><td>$number_vars ($size_vars)</td></tr>
- <tr class=tr-1><td class=td-0>Hits</td><td>{$cache_user['num_hits']}</td></tr>
- <tr class=tr-0><td class=td-0>Misses</td><td>{$cache_user['num_misses']}</td></tr>
- <tr class=tr-1><td class=td-0>Request Rate (hits, misses)</td><td>$req_rate_user cache requests/second</td></tr>
- <tr class=tr-0><td class=td-0>Hit Rate</td><td>$hit_rate_user cache requests/second</td></tr>
- <tr class=tr-1><td class=td-0>Miss Rate</td><td>$miss_rate_user cache requests/second</td></tr>
- <tr class=tr-0><td class=td-0>Insert Rate</td><td>$insert_rate_user cache requests/second</td></tr>
- <tr class=tr-1><td class=td-0>Cache full count</td><td>{$cache_user['expunges']}</td></tr>
-
- </tbody></table>
- </div>
-
- <div class="info div2"><h2>Runtime Settings</h2><table cellspacing=0><tbody>
-EOB;
-
- $j = 0;
- foreach (ini_get_all('apc') as $k => $v) {
- echo "<tr class=tr-$j><td class=td-0>",$k,"</td><td>",str_replace(',',',<br />',$v['local_value']),"</td></tr>\n";
- $j = 1 - $j;
- }
-
- if($mem['num_seg']>1 || $mem['num_seg']==1 && count($mem['block_lists'][0])>1)
- $mem_note = "Memory Usage<br /><font size=-2>(multiple slices indicate fragments)</font>";
- else
- $mem_note = "Memory Usage";
-
- echo <<< EOB
- </tbody></table>
- </div>
-
- <div class="graph div3"><h2>Host Status Diagrams</h2>
- <table cellspacing=0><tbody>
-EOB;
- $size='width='.(GRAPH_SIZE+50).' height='.(GRAPH_SIZE+10);
- echo <<<EOB
- <tr>
- <td class=td-0>$mem_note</td>
- <td class=td-1>Hits & Misses</td>
- </tr>
-EOB;
-
- echo
- graphics_avail() ?
- '<tr>'.
- "<td class=td-0><img alt=\"\" $size src=\"$PHP_SELF?IMG=1&$time\"></td>".
- "<td class=td-1><img alt=\"\" $size src=\"$PHP_SELF?IMG=2&$time\"></td></tr>\n"
- : "",
- '<tr>',
- '<td class=td-0><span class="green box"> </span>Free: ',bsize($mem_avail).sprintf(" (%.1f%%)",$mem_avail*100/$mem_size),"</td>\n",
- '<td class=td-1><span class="green box"> </span>Hits: ',$cache['num_hits'].sprintf(" (%.1f%%)",$cache['num_hits']*100/($cache['num_hits']+$cache['num_misses'])),"</td>\n",
- '</tr>',
- '<tr>',
- '<td class=td-0><span class="red box"> </span>Used: ',bsize($mem_used ).sprintf(" (%.1f%%)",$mem_used *100/$mem_size),"</td>\n",
- '<td class=td-1><span class="red box"> </span>Misses: ',$cache['num_misses'].sprintf(" (%.1f%%)",$cache['num_misses']*100/($cache['num_hits']+$cache['num_misses'])),"</td>\n";
- echo <<< EOB
- </tr>
- </tbody></table>
-
- <br/>
- <h2>Detailed Memory Usage and Fragmentation</h2>
- <table cellspacing=0><tbody>
- <tr>
- <td class=td-0 colspan=2><br/>
-EOB;
-
- // Fragementation: (freeseg - 1) / total_seg
- $nseg = $freeseg = $fragsize = $freetotal = 0;
- for($i=0; $i<$mem['num_seg']; $i++) {
- $ptr = 0;
- foreach($mem['block_lists'][$i] as $block) {
- if ($block['offset'] != $ptr) {
- ++$nseg;
- }
- $ptr = $block['offset'] + $block['size'];
- /* Only consider blocks <5M for the fragmentation % */
- if($block['size']<(5*1024*1024)) $fragsize+=$block['size'];
- $freetotal+=$block['size'];
- }
- $freeseg += count($mem['block_lists'][$i]);
- }
-
- if ($freeseg > 1) {
- $frag = sprintf("%.2f%% (%s out of %s in %d fragments)", ($fragsize/$freetotal)*100,bsize($fragsize),bsize($freetotal),$freeseg);
- } else {
- $frag = "0%";
- }
-
- if (graphics_avail()) {
- $size='width='.(2*GRAPH_SIZE+150).' height='.(GRAPH_SIZE+10);
- echo <<<EOB
- <img alt="" $size src="$PHP_SELF?IMG=3&$time">
-EOB;
- }
- echo <<<EOB
- </br>Fragmentation: $frag
- </td>
- </tr>
-EOB;
- if(isset($mem['adist'])) {
- foreach($mem['adist'] as $i=>$v) {
- $cur = pow(2,$i); $nxt = pow(2,$i+1)-1;
- if($i==0) $range = "1";
- else $range = "$cur - $nxt";
- echo "<tr><th align=right>$range</th><td align=right>$v</td></tr>\n";
- }
- }
- echo <<<EOB
- </tbody></table>
- </div>
-EOB;
-
- break;
-
-
-// -----------------------------------------------
-// User Cache Entries
-// -----------------------------------------------
-case OB_USER_CACHE:
- if (!$AUTHENTICATED) {
- echo '<div class="error">You need to login to see the user values here!<br/> <br/>';
- put_login_link("Login now!");
- echo '</div>';
- break;
- }
- $fieldname='info';
- $fieldheading='User Entry Label';
- $fieldkey='info';
-
-// -----------------------------------------------
-// System Cache Entries
-// -----------------------------------------------
-case OB_SYS_CACHE:
- if (!isset($fieldname))
- {
- $fieldname='filename';
- $fieldheading='Script Filename';
- if(ini_get("apc.stat")) $fieldkey='inode';
- else $fieldkey='filename';
- }
- if (!empty($MYREQUEST['SH']))
- {
- echo <<< EOB
- <div class="info"><table cellspacing=0><tbody>
- <tr><th>Attribute</th><th>Value</th></tr>
-EOB;
-
- $m=0;
- foreach($scope_list as $j => $list) {
- foreach($cache[$list] as $i => $entry) {
- if (md5($entry[$fieldkey])!=$MYREQUEST['SH']) continue;
- foreach($entry as $k => $value) {
- if (!$AUTHENTICATED) {
- // hide all path entries if not logged in
- $value=preg_replace('/^.*(\\/|\\\\)/','<i><hidden></i>/',$value);
- }
-
- if ($k == "num_hits") {
- $value=sprintf("%s (%.2f%%)",$value,$value*100/$cache['num_hits']);
- }
- if ($k == 'deletion_time') {
- if(!$entry['deletion_time']) $value = "None";
- }
- echo
- "<tr class=tr-$m>",
- "<td class=td-0>",ucwords(preg_replace("/_/"," ",$k)),"</td>",
- "<td class=td-last>",(preg_match("/time/",$k) && $value!='None') ? date(DATE_FORMAT,$value) : $value,"</td>",
- "</tr>";
- $m=1-$m;
- }
- if($fieldkey=='info') {
- echo "<tr class=tr-$m><td class=td-0>Stored Value</td><td class=td-last><pre>";
- $output = var_export(apc_fetch($entry[$fieldkey]),true);
- echo htmlspecialchars($output);
- echo "</pre></td></tr>\n";
- }
- break;
- }
- }
-
- echo <<<EOB
- </tbody></table>
- </div>
-EOB;
- break;
- }
-
- $cols=6;
- echo <<<EOB
- <div class=sorting><form>Scope:
- <input type=hidden name=OB value={$MYREQUEST['OB']}>
- <select name=SCOPE>
-EOB;
- echo
- "<option value=A",$MYREQUEST['SCOPE']=='A' ? " selected":"",">Active</option>",
- "<option value=D",$MYREQUEST['SCOPE']=='D' ? " selected":"",">Deleted</option>",
- "</select>",
- ", Sorting:<select name=SORT1>",
- "<option value=H",$MYREQUEST['SORT1']=='H' ? " selected":"",">Hits</option>",
- "<option value=Z",$MYREQUEST['SORT1']=='Z' ? " selected":"",">Size</option>",
- "<option value=S",$MYREQUEST['SORT1']=='S' ? " selected":"",">$fieldheading</option>",
- "<option value=A",$MYREQUEST['SORT1']=='A' ? " selected":"",">Last accessed</option>",
- "<option value=M",$MYREQUEST['SORT1']=='M' ? " selected":"",">Last modified</option>",
- "<option value=C",$MYREQUEST['SORT1']=='C' ? " selected":"",">Created at</option>",
- "<option value=D",$MYREQUEST['SORT1']=='D' ? " selected":"",">Deleted at</option>";
- if($fieldname=='info') echo
- "<option value=D",$MYREQUEST['SORT1']=='T' ? " selected":"",">Timeout</option>";
- echo
- '</select>',
- '<select name=SORT2>',
- '<option value=D',$MYREQUEST['SORT2']=='D' ? ' selected':'','>DESC</option>',
- '<option value=A',$MYREQUEST['SORT2']=='A' ? ' selected':'','>ASC</option>',
- '</select>',
- '<select name=COUNT onChange="form.submit()">',
- '<option value=10 ',$MYREQUEST['COUNT']=='10' ? ' selected':'','>Top 10</option>',
- '<option value=20 ',$MYREQUEST['COUNT']=='20' ? ' selected':'','>Top 20</option>',
- '<option value=50 ',$MYREQUEST['COUNT']=='50' ? ' selected':'','>Top 50</option>',
- '<option value=100',$MYREQUEST['COUNT']=='100'? ' selected':'','>Top 100</option>',
- '<option value=150',$MYREQUEST['COUNT']=='150'? ' selected':'','>Top 150</option>',
- '<option value=200',$MYREQUEST['COUNT']=='200'? ' selected':'','>Top 200</option>',
- '<option value=500',$MYREQUEST['COUNT']=='500'? ' selected':'','>Top 500</option>',
- '<option value=0 ',$MYREQUEST['COUNT']=='0' ? ' selected':'','>All</option>',
- '</select>',
- ' Search: <input name=SEARCH value="',$MYREQUEST['SEARCH'],'" type=text size=25/>',
- ' <input type=submit value="GO!">',
- '</form></div>';
-
- if (isset($MYREQUEST['SEARCH'])) {
- // Don't use preg_quote because we want the user to be able to specify a
- // regular expression subpattern.
- $MYREQUEST['SEARCH'] = '/'.str_replace('/', '\\/', $MYREQUEST['SEARCH']).'/i';
- if (preg_match($MYREQUEST['SEARCH'], 'test') === false) {
- echo '<div class="error">Error: enter a valid regular expression as a search query.</div>';
- break;
- }
- }
-
- echo
- '<div class="info"><table cellspacing=0><tbody>',
- '<tr>',
- '<th>',sortheader('S',$fieldheading, "&OB=".$MYREQUEST['OB']),'</th>',
- '<th>',sortheader('H','Hits', "&OB=".$MYREQUEST['OB']),'</th>',
- '<th>',sortheader('Z','Size', "&OB=".$MYREQUEST['OB']),'</th>',
- '<th>',sortheader('A','Last accessed',"&OB=".$MYREQUEST['OB']),'</th>',
- '<th>',sortheader('M','Last modified',"&OB=".$MYREQUEST['OB']),'</th>',
- '<th>',sortheader('C','Created at', "&OB=".$MYREQUEST['OB']),'</th>';
-
- if($fieldname=='info') {
- $cols+=2;
- echo '<th>',sortheader('T','Timeout',"&OB=".$MYREQUEST['OB']),'</th>';
- }
- echo '<th>',sortheader('D','Deleted at',"&OB=".$MYREQUEST['OB']),'</th></tr>';
-
- // builds list with alpha numeric sortable keys
- //
- $list = array();
- foreach($cache[$scope_list[$MYREQUEST['SCOPE']]] as $i => $entry) {
- switch($MYREQUEST['SORT1']) {
- case 'A': $k=sprintf('%015d-',$entry['access_time']); break;
- case 'H': $k=sprintf('%015d-',$entry['num_hits']); break;
- case 'Z': $k=sprintf('%015d-',$entry['mem_size']); break;
- case 'M': $k=sprintf('%015d-',$entry['mtime']); break;
- case 'C': $k=sprintf('%015d-',$entry['creation_time']); break;
- case 'T': $k=sprintf('%015d-',$entry['ttl']); break;
- case 'D': $k=sprintf('%015d-',$entry['deletion_time']); break;
- case 'S': $k=''; break;
- }
- if (!$AUTHENTICATED) {
- // hide all path entries if not logged in
- $list[$k.$entry[$fieldname]]=preg_replace('/^.*(\\/|\\\\)/','*hidden*/',$entry);
- } else {
- $list[$k.$entry[$fieldname]]=$entry;
- }
- }
-
- if ($list) {
-
- // sort list
- //
- switch ($MYREQUEST['SORT2']) {
- case "A": krsort($list); break;
- case "D": ksort($list); break;
- }
-
- // output list
- $i=0;
- foreach($list as $k => $entry) {
- if(!$MYREQUEST['SEARCH'] || preg_match($MYREQUEST['SEARCH'], $entry[$fieldname]) != 0) {
- $field_value = htmlentities(strip_tags($entry[$fieldname],''), ENT_QUOTES, 'UTF-8');
- echo
- '<tr class=tr-',$i%2,'>',
- "<td class=td-0><a href=\"$MY_SELF&OB=",$MYREQUEST['OB'],"&SH=",md5($entry[$fieldkey]),"\">",$field_value,'</a></td>',
- '<td class="td-n center">',$entry['num_hits'],'</td>',
- '<td class="td-n right">',$entry['mem_size'],'</td>',
- '<td class="td-n center">',date(DATE_FORMAT,$entry['access_time']),'</td>',
- '<td class="td-n center">',date(DATE_FORMAT,$entry['mtime']),'</td>',
- '<td class="td-n center">',date(DATE_FORMAT,$entry['creation_time']),'</td>';
-
- if($fieldname=='info') {
- if($entry['ttl'])
- echo '<td class="td-n center">'.$entry['ttl'].' seconds</td>';
- else
- echo '<td class="td-n center">None</td>';
- }
- if ($entry['deletion_time']) {
-
- echo '<td class="td-last center">', date(DATE_FORMAT,$entry['deletion_time']), '</td>';
- } else if ($MYREQUEST['OB'] == OB_USER_CACHE) {
-
- echo '<td class="td-last center">';
- echo '[<a href="', $MY_SELF, '&OB=', $MYREQUEST['OB'], '&DU=', urlencode($entry[$fieldkey]), '">Delete Now</a>]';
- echo '</td>';
- } else {
- echo '<td class="td-last center"> </td>';
- }
- echo '</tr>';
- $i++;
- if ($i == $MYREQUEST['COUNT'])
- break;
- }
- }
-
- } else {
- echo '<tr class=tr-0><td class="center" colspan=',$cols,'><i>No data</i></td></tr>';
- }
- echo <<< EOB
- </tbody></table>
-EOB;
-
- if ($list && $i < count($list)) {
- echo "<a href=\"$MY_SELF&OB=",$MYREQUEST['OB'],"&COUNT=0\"><i>",count($list)-$i,' more available...</i></a>';
- }
-
- echo <<< EOB
- </div>
-EOB;
- break;
-
-
-// -----------------------------------------------
-// Per-Directory System Cache Entries
-// -----------------------------------------------
-case OB_SYS_CACHE_DIR:
- if (!$AUTHENTICATED) {
- break;
- }
-
- echo <<<EOB
- <div class=sorting><form>Scope:
- <input type=hidden name=OB value={$MYREQUEST['OB']}>
- <select name=SCOPE>
-EOB;
- echo
- "<option value=A",$MYREQUEST['SCOPE']=='A' ? " selected":"",">Active</option>",
- "<option value=D",$MYREQUEST['SCOPE']=='D' ? " selected":"",">Deleted</option>",
- "</select>",
- ", Sorting:<select name=SORT1>",
- "<option value=H",$MYREQUEST['SORT1']=='H' ? " selected":"",">Total Hits</option>",
- "<option value=Z",$MYREQUEST['SORT1']=='Z' ? " selected":"",">Total Size</option>",
- "<option value=T",$MYREQUEST['SORT1']=='T' ? " selected":"",">Number of Files</option>",
- "<option value=S",$MYREQUEST['SORT1']=='S' ? " selected":"",">Directory Name</option>",
- "<option value=A",$MYREQUEST['SORT1']=='A' ? " selected":"",">Avg. Size</option>",
- "<option value=C",$MYREQUEST['SORT1']=='C' ? " selected":"",">Avg. Hits</option>",
- '</select>',
- '<select name=SORT2>',
- '<option value=D',$MYREQUEST['SORT2']=='D' ? ' selected':'','>DESC</option>',
- '<option value=A',$MYREQUEST['SORT2']=='A' ? ' selected':'','>ASC</option>',
- '</select>',
- '<select name=COUNT onChange="form.submit()">',
- '<option value=10 ',$MYREQUEST['COUNT']=='10' ? ' selected':'','>Top 10</option>',
- '<option value=20 ',$MYREQUEST['COUNT']=='20' ? ' selected':'','>Top 20</option>',
- '<option value=50 ',$MYREQUEST['COUNT']=='50' ? ' selected':'','>Top 50</option>',
- '<option value=100',$MYREQUEST['COUNT']=='100'? ' selected':'','>Top 100</option>',
- '<option value=150',$MYREQUEST['COUNT']=='150'? ' selected':'','>Top 150</option>',
- '<option value=200',$MYREQUEST['COUNT']=='200'? ' selected':'','>Top 200</option>',
- '<option value=500',$MYREQUEST['COUNT']=='500'? ' selected':'','>Top 500</option>',
- '<option value=0 ',$MYREQUEST['COUNT']=='0' ? ' selected':'','>All</option>',
- '</select>',
- ", Group By Dir Level:<select name=AGGR>",
- "<option value='' selected>None</option>";
- for ($i = 1; $i < 10; $i++)
- echo "<option value=$i",$MYREQUEST['AGGR']==$i ? " selected":"",">$i</option>";
- echo '</select>',
- ' <input type=submit value="GO!">',
- '</form></div>',
-
- '<div class="info"><table cellspacing=0><tbody>',
- '<tr>',
- '<th>',sortheader('S','Directory Name', "&OB=".$MYREQUEST['OB']),'</th>',
- '<th>',sortheader('T','Number of Files',"&OB=".$MYREQUEST['OB']),'</th>',
- '<th>',sortheader('H','Total Hits', "&OB=".$MYREQUEST['OB']),'</th>',
- '<th>',sortheader('Z','Total Size', "&OB=".$MYREQUEST['OB']),'</th>',
- '<th>',sortheader('C','Avg. Hits', "&OB=".$MYREQUEST['OB']),'</th>',
- '<th>',sortheader('A','Avg. Size', "&OB=".$MYREQUEST['OB']),'</th>',
- '</tr>';
-
- // builds list with alpha numeric sortable keys
- //
- $tmp = $list = array();
- foreach($cache[$scope_list[$MYREQUEST['SCOPE']]] as $entry) {
- $n = dirname($entry['filename']);
- if ($MYREQUEST['AGGR'] > 0) {
- $n = preg_replace("!^(/?(?:[^/\\\\]+[/\\\\]){".($MYREQUEST['AGGR']-1)."}[^/\\\\]*).*!", "$1", $n);
- }
- if (!isset($tmp[$n])) {
- $tmp[$n] = array('hits'=>0,'size'=>0,'ents'=>0);
- }
- $tmp[$n]['hits'] += $entry['num_hits'];
- $tmp[$n]['size'] += $entry['mem_size'];
- ++$tmp[$n]['ents'];
- }
-
- foreach ($tmp as $k => $v) {
- switch($MYREQUEST['SORT1']) {
- case 'A': $kn=sprintf('%015d-',$v['size'] / $v['ents']);break;
- case 'T': $kn=sprintf('%015d-',$v['ents']); break;
- case 'H': $kn=sprintf('%015d-',$v['hits']); break;
- case 'Z': $kn=sprintf('%015d-',$v['size']); break;
- case 'C': $kn=sprintf('%015d-',$v['hits'] / $v['ents']);break;
- case 'S': $kn = $k; break;
- }
- $list[$kn.$k] = array($k, $v['ents'], $v['hits'], $v['size']);
- }
-
- if ($list) {
-
- // sort list
- //
- switch ($MYREQUEST['SORT2']) {
- case "A": krsort($list); break;
- case "D": ksort($list); break;
- }
-
- // output list
- $i = 0;
- foreach($list as $entry) {
- echo
- '<tr class=tr-',$i%2,'>',
- "<td class=td-0>",$entry[0],'</a></td>',
- '<td class="td-n center">',$entry[1],'</td>',
- '<td class="td-n center">',$entry[2],'</td>',
- '<td class="td-n center">',$entry[3],'</td>',
- '<td class="td-n center">',round($entry[2] / $entry[1]),'</td>',
- '<td class="td-n center">',round($entry[3] / $entry[1]),'</td>',
- '</tr>';
-
- if (++$i == $MYREQUEST['COUNT']) break;
- }
-
- } else {
- echo '<tr class=tr-0><td class="center" colspan=6><i>No data</i></td></tr>';
- }
- echo <<< EOB
- </tbody></table>
-EOB;
-
- if ($list && $i < count($list)) {
- echo "<a href=\"$MY_SELF&OB=",$MYREQUEST['OB'],"&COUNT=0\"><i>",count($list)-$i,' more available...</i></a>';
- }
-
- echo <<< EOB
- </div>
-EOB;
- break;
-
-// -----------------------------------------------
-// Version check
-// -----------------------------------------------
-case OB_VERSION_CHECK:
- echo <<<EOB
- <div class="info"><h2>APC Version Information</h2>
- <table cellspacing=0><tbody>
- <tr>
- <th></th>
- </tr>
-EOB;
- if (defined('PROXY')) {
- $ctxt = stream_context_create( array( 'http' => array( 'proxy' => PROXY, 'request_fulluri' => True ) ) );
- $rss = @file_get_contents("http://pecl.php.net/feeds/pkg_apc.rss", False, $ctxt);
- } else {
- $rss = @file_get_contents("http://pecl.php.net/feeds/pkg_apc.rss");
- }
- if (!$rss) {
- echo '<tr class="td-last center"><td>Unable to fetch version information.</td></tr>';
- } else {
- $apcversion = phpversion('apc');
-
- preg_match('!<title>APC ([0-9.]+)</title>!', $rss, $match);
- echo '<tr class="tr-0 center"><td>';
- if (version_compare($apcversion, $match[1], '>=')) {
- echo '<div class="ok">You are running the latest version of APC ('.$apcversion.')</div>';
- $i = 3;
- } else {
- echo '<div class="failed">You are running an older version of APC ('.$apcversion.'),
- newer version '.$match[1].' is available at <a href="http://pecl.php.net/package/APC/'.$match[1].'">
- http://pecl.php.net/package/APC/'.$match[1].'</a>
- </div>';
- $i = -1;
- }
- echo '</td></tr>';
- echo '<tr class="tr-0"><td><h3>Change Log:</h3><br/>';
-
- preg_match_all('!<(title|description)>([^<]+)</\\1>!', $rss, $match);
- next($match[2]); next($match[2]);
-
- while (list(,$v) = each($match[2])) {
- list(,$ver) = explode(' ', $v, 2);
- if ($i < 0 && version_compare($apcversion, $ver, '>=')) {
- break;
- } else if (!$i--) {
- break;
- }
- echo "<b><a href=\"http://pecl.php.net/package/APC/$ver\">".htmlspecialchars($v)."</a></b><br><blockquote>";
- echo nl2br(htmlspecialchars(current($match[2])))."</blockquote>";
- next($match[2]);
- }
- echo '</td></tr>';
- }
- echo <<< EOB
- </tbody></table>
- </div>
-EOB;
- break;
-
-}
-
-echo <<< EOB
- </div>
-EOB;
-
-?>
-
-<!-- <?php echo "\nBased on APCGUI By R.Becker\n$VERSION\n"?> -->
-</body>
-</html>
Deleted: trunk/mapbender/http/php/mod_editGuiWmsMeta.php_deprecated
===================================================================
--- trunk/mapbender/http/php/mod_editGuiWmsMeta.php_deprecated 2016-05-27 07:07:37 UTC (rev 9486)
+++ trunk/mapbender/http/php/mod_editGuiWmsMeta.php_deprecated 2016-05-27 07:11:28 UTC (rev 9487)
@@ -1,190 +0,0 @@
-<?php
-# $Id: mod_editGuiWmsMeta.php 7097 2010-11-08 07:48:25Z apour $
-# http://www.mapbender.org/index.php/mod_editGuiWmsMeta.php
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-
-/*
- * @security_patch irv open
- */
-// security_patch_log(__FILE__,__LINE__);
-import_request_variables("PG");
-include(dirname(__FILE__)."/../php/mb_validateSession.php");
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="0">
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
-?>
-<title>Edit WMS Meta Data</title>
-<?php
-include '../include/dyn_css.php';
-?>
-<style type="text/css">
- <!--
- body{
- background-color: #ffffff;
- font-family: Arial, Helvetica, sans-serif;
- font-size : 12px;
- color: #808080
- }
- .guiList1{
- position:absolute;
- top:30px;
- left:10px;
- width:200px
- }
- .buttonbar{
- position:absolute;
- top:40px;
- left:10px;
- }
- .guiList1_text{
- position:absolute;
- top:10px;
- left:10px;
- font-size:16px;
- color: #0066cc;
- }
- .guiList2{
- position:absolute;
- top:40px;
- left:400px;
- width:200px
- }
- .all{
- position:absolute;
- top:38px;
- left:610px;
- }
- .guiList2_header{
- position:absolute;
- top:10px;
- left:400px;
- font-size:16px;
- color: #0066cc;
- }
- .myElements{
- position:absolute;
- top:70px;
- left:400px;
- }
- .myTable{
- border: 1px solid;
- font-size: 11px;
- }
- .myForm{
- position:absolute;
- top:70px;
- left:10px;
- }
- .textfield{
- width:277px
- }
- .textfield_small{
- width:150px
- }
- .on{
- color: #0066cc;
- }
- -->
-</style>
-
-<script type="text/javascript">
-<!--
- function windowSize() {
- window.resizeTo(800,500)
- window.moveTo(130,200)
- }
-
- function windowQuit() {
- window.close()
- }
-// -->
-</script>
-
- </head>
- <body onload='windowSize()'>
-
-<?php
- echo " <form name='editMetaData' action='".$self."' method='get'>\n";
-
- $layer_id = $_REQUEST["layer_id"];
-
- if ( isset($_REQUEST["function"] ) ) {
- $function = $_REQUEST["function"];
-
- if ( $function = "update" ) {
- $sql = "UPDATE layer SET layer_meta_datum = $1, ";
- $sql.= "layer_meta_lieferant = $2, ";
- $sql.= "layer_meta_quelle = $3, ";
- $sql.= "layer_meta_ansprechpartner = $4, ";
- $sql.= "layer_meta_lieferant_basis = $5, ";
- $sql.= "layer_meta_copyright = $6 ";
- $sql.= " WHERE layer_id = $7;";
- $v = array($_REQUEST["layer_meta_datum"], $_REQUEST["layer_meta_lieferant"], $_REQUEST["layer_meta_quelle"], $_REQUEST["layer_meta_ansprechpartner"], $_REQUEST["layer_meta_lieferant_basis"], $_REQUEST["layer_meta_copyright"], $layer_id);
- $t = array("s", "s", "s", "s", "s", "s", "i");
- $res = db_prep_query($sql, $v, $t);
- }
- }
-
- $sql = "SELECT * FROM layer WHERE layer_id = $1;";
- $v = array($layer_id);
- $t = array("i");
- $res = db_prep_query($sql, $v, $t);
-
- if ( db_fetch_row($res, 0) ) {
- echo " <h3>Editieren von Metadaten</h3>\n";
- echo " <table class='myTable' border='1' cellpadding='2'>\n";
- echo " <tr>\n";
- echo " <td >Aktualisierungsdatum</td>\n";
- echo " <td><input name='layer_meta_datum' type='text' size='100' value='".db_result($res, 0, "layer_meta_datum")."'></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>Datenlieferant</td>\n";
- echo " <td><input name='layer_meta_lieferant' type='text' size='100' value='".db_result($res, 0, "layer_meta_lieferant")."'></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>Datenquelle</td>\n";
- echo " <td><input name='layer_meta_quelle' type='text' size='100' value='".db_result($res, 0, "layer_meta_quelle")."'></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>Ansprechpartner</td>\n";
- echo " <td><input name='layer_meta_ansprechpartner' type='text' size='100' value='".db_result($res, 0, "layer_meta_ansprechpartner")."'></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>Datenlieferant (Basisdaten)</td>\n";
- echo " <td><input name='layer_meta_lieferant_basis' type='text' size='100' value='".db_result($res, 0, "layer_meta_lieferant_basis")."'></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>Copyright</td>\n";
- echo " <td><input name='layer_meta_copyright' type='text' size='100' value='".db_result($res, 0, "layer_meta_copyright")."'></td>\n";
- echo " </tr>\n";
- echo " </table>\n";
- }
- echo " <p></p>\n";
- echo " <input type='submit' name='function' value='update'>\n";
- echo " <input type='button' onclick='windowQuit()' value=' exit '>\n";
- echo " <input type='hidden' name='layer_id' value='".$layer_id."'>\n";
-?>
- </form>
- </body>
-</html>
\ No newline at end of file
Deleted: trunk/mapbender/http/php/mod_export_image.php_deprecated
===================================================================
--- trunk/mapbender/http/php/mod_export_image.php_deprecated 2016-05-27 07:07:37 UTC (rev 9486)
+++ trunk/mapbender/http/php/mod_export_image.php_deprecated 2016-05-27 07:11:28 UTC (rev 9487)
@@ -1,45 +0,0 @@
-<?php
-# $Id: mod_export_image.php 7097 2010-11-08 07:48:25Z apour $
-# http://www.mapbender.org/index.php/mod_export_image.php
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-
-/*
- * @security_patch irv open
- */
-// security_patch_log(__FILE__,__LINE__);
-import_request_variables("PG");
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-
-Mapbender::session()->set("mb_print_url",$map_url);
-Mapbender::session()->set("mb_print_resolution",$quality);
-header("Content-type: application/png"); // mark the following content as PNG file
-$date = date("d.m.y");
-header("Content-Disposition: attachment; filename=export".$date.".png");
-header("Pragma: no-cache");
-header("Expires: 0");
-include(dirname(__FILE__)."/../../conf/print.conf");
-$header_height = intval($_REQUEST["header_height"]) * $deformation;
-$map_width = intval($_REQUEST["map_width"]) * $deformation;
-$map_height = intval($_REQUEST["map_height"]) * $deformation;
-$date = date("d.m.y");
-#map
-//include "../classes/class_weldMaps2PNG.php";
-include "../extensions/exp_weldMaps.php";
-//$i = new weldMaps($map_urls, Mapbender::session()->get("mb_print_resolution"));
-//print $i;
-?>
\ No newline at end of file
Deleted: trunk/mapbender/http/php/mod_getStyles.php_deprecated
===================================================================
--- trunk/mapbender/http/php/mod_getStyles.php_deprecated 2016-05-27 07:07:37 UTC (rev 9486)
+++ trunk/mapbender/http/php/mod_getStyles.php_deprecated 2016-05-27 07:11:28 UTC (rev 9487)
@@ -1,186 +0,0 @@
-<?php
-# $Id: mod_getStyles.php 7097 2010-11-08 07:48:25Z apour $
-# http://www.mapbender.org/index.php/Administration
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-
-/*
- * @security_patch irv open
- */
-// security_patch_log(__FILE__,__LINE__);
-import_request_variables("PG");
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-
-$pattern = "admin_name";
-?>
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
-<html>
-<head>
-<meta name="author-mail" content="info at ccgis.de">
-<meta name="author" content="U. Rothstein">
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="0">
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
-?>
-<title>SLD Get Styles</title>
-<?php
-include '../include/dyn_css.php';
-?>
-<style type="text/css">
-<!--
-body{
- background-color: #ffffff;
-}
-.button_del{
- color: red;
-
-}
-.textfield{
-
-}
-.wmsList{
-
- width:200px
-}
--->
-</style>
-<script type="text/javascript">
-<!--
-function validate(){
- var ind = document.form1.wmsList.selectedIndex;
-
- document.form1.getstyle.value = 1;
- document.form1.submit();
-}
-// -->
-</script>
-</head>
-<body>
-<?php
-###delete
-if($wmsList && $getstyle == '1'){
-
-function proxy_url($proxy_url)
-{
- global $proxy_name,$proxy_port,$proxy_cont,$proxy_user,$proxy_pass;
-//echo $proxy_user;
- $proxy_fp = fsockopen($proxy_name, $proxy_port) or die ("Fehler beim �ffnen der Verbindung zum Proxy");
- if (!$proxy_fp) {return false;}
- $headers = "GET $proxy_url HTTP/1.0\r\nHost: $proxy_name\r\n";
- $headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($proxy_user . ':' . $proxy_pass)."\r\nConnection: Keep-Alive\r\n\r\n";
- fputs($proxy_fp, $headers);
- while(!feof($proxy_fp))
- {$proxy_cont .= fread($proxy_fp,4096);
- }
- fclose($proxy_fp);
- $proxy_cont = substr($proxy_cont, strpos($proxy_cont,"\r\n\r\n")+4);
- return $proxy_cont;
-}
-
-
-/* Sends an http request to www.example.com
- with additional headers shown above */
-//$fp = fopen('http://www.example.com', 'r', false, $context);
-
- $style_xml = proxy_url($url) or die("Error: ". $ur . " .. no valid resource");
- #echo "<pre>";
- #echo $style_xml;
- #echo "</pre>";
- #$style_content = fread($style_xml);
- #<ogc:PropertyName>admin_name</ogc:PropertyName><ogc:Literal>Brandenburg</ogc:Literal>
-
- $style_filename = "../getstyles/wms_".$wmsList.".php";
- $style_file = fopen($style_filename,"w") or die ($style_filename." not writable!");
- if(!is_writable($style_filename)){
- echo $style_filename."not writable!!!<br>";
- }
- $cnt_line = 0;
- fwrite($style_file, "<".chr(63)."php echo '<?xml version=\"1.0\" encoding=\"ISO-8859-1\" standalone=\"yes\" ?>'; ".chr(63).">\r\n");
- //while(!feof($style_xml)){
- //$line = preg_replace("md5userid", "<".chr(63)."php echo ".chr(36)."_REQUEST['id']; ".chr(63).">",fgets($style_xml));
-
- fwrite($style_file, $style_xml);
- #echo fgets($style_xml);
- //$cnt_line++;
- //}
- #fputs($style_file, $style_content) or die ($style_filename." not writable");
-
-
- @fclose($style_xml);
- fclose($style_file);
- #include(dirname(__FILE__)."/../../conf/www.conf");
- $pattern = "/" . basename($login) . "/";
- $sql = "UPDATE wms SET wms_filter = $1 WHERE wms_id = $2";
- $v = array(preg_replace($pattern,$style_filename,$login), $wmsList);
- $t = array("s", "i");
- echo $sql;
- db_prep_query($sql, $v, $t) or die("unable to change filter!");
-}
-###
-
-$sql = "SELECT * FROM wms ORDER BY wms_title";
-$res = db_query($sql);
-$cnt = 0;
-echo "<form name='form1' action='" . $self ."' method='post'>";
-echo "<select class='wmsList' size='20' name='wmsList' class='wmsList' onchange='submit()'>";
-while($row = db_fetch_array($res)){
- # getStyle - Request:
- if($wmsList && $row["wms_id"] == $wmsList){
- $getStyle = $row["wms_getmap"]."&VERSION=1.1.1&REQUEST=getStyles&SERVICE=WMS&LAYERS=";
- $sql_style = "SELECT layer_name FROM layer WHERE fkey_wms_id = $1";
- $v = array($wmsList);
- $t = array("i");
- $res_style = db_prep_query($sql_style, $v, $t);
-
- $cnt_style = 0;
- while($row2 = db_fetch_array($res_style)){
- if($cnt_style > 0){
- if($cnt_style > 1){
- $getStyle .= ",";
- }
- $getStyle .= $row2["layer_name"];
- }
- $cnt_style++;
- }
- }
- echo "<option value='".$row["wms_id"]."' ";
- if($row["wms_id"] == $wmsList){
- echo "selected";
- }
- echo ">".$row["wms_title"]."</option>";
- $cnt++;
-}
-echo "</select><br>";
-echo "<textarea class='textfield' name='url' cols='70' rows='3' wrap='virtual'>".htmlentities($getStyle,ENT_QUOTES)."</textarea><br>";
-echo "<input class='button_del' type='button' value='getStyle' onclick='validate()'><br>";
-if($style_filename){
- $style_file = fopen($style_filename,"r");
- while(!feof($style_file)){
- $content = preg_replace("/</","<",fgets($style_file));
- echo preg_replace("/>/",">",$content)."<br>";
- }
- fclose($style_file);
-}
-?>
-<input type='hidden' name='getstyle'>
-</form>
-</body>
-</html>
Deleted: trunk/mapbender/http/php/mod_layerISOMetadataWriteToFolder.php
===================================================================
--- trunk/mapbender/http/php/mod_layerISOMetadataWriteToFolder.php 2016-05-27 07:07:37 UTC (rev 9486)
+++ trunk/mapbender/http/php/mod_layerISOMetadataWriteToFolder.php 2016-05-27 07:11:28 UTC (rev 9487)
@@ -1,110 +0,0 @@
-<?php
-#http://www.geoportal.rlp.de/mapbender/php/mod_exportISOMetadata.php?
-# $Id: mod_exportISOMetadata.php 235
-# http://www.mapbender.org/index.php/Inspire_Metadata_Editor
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-require_once(dirname(__FILE__) . "/../../core/globalSettings.php");
-require_once(dirname(__FILE__) . "/../classes/class_connector.php");
-
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
-
-//define the view or table where to read out the layer ids for which metadatafiles should be generated
-$wmsView = "search_wms_view";
-//$wmsView = '';
-//parse request parameter
-//make all parameters available as upper case
-
-foreach($_REQUEST as $key => $val) {
- $_REQUEST[strtoupper($key)] = $val;
-}
-//validate request params
-
-//
-if (!isset($_REQUEST['TYPE'])) {
- echo 'GET Parameter Type lacks';
- die();
-}
-
-if (isset($_REQUEST['TYPE']) and $_REQUEST['TYPE'] != "ALL") {
- //
- echo 'validate: <b>'.$_REQUEST['TYPE'].'</b> is not valid.<br/>';
- die();
-}
-
-$sql = "SELECT layer_id, uuid ";
-//$sql .= "FROM ".$wmsView;
-$sql .= "FROM layer WHERE layer_id IN (20203,20202)";
-$v = array();
-$t = array();
-$res = db_prep_query($sql,$v,$t);
-
-$generatorScript = '/mapbender/php/mod_layerISOMetadata.php?';
-$generatorBaseUrl = 'http://'.$_SERVER['HTTP_HOST'].$generatorScript;
-
-$generatorScriptMetadata = '/mapbender/php/mod_dataISOMetadata.php?';
-$generatorBaseUrlMetadata = 'http://'.$_SERVER['HTTP_HOST'].$generatorScriptMetadata;
-
-echo $generatorBaseUrl."<br>";
-
-while($row = db_fetch_array($res)){
- $generatorUrl = $generatorBaseUrl."SERVICE=WMS&outputFormat=iso19139&id=".$row['layer_id'];
- echo "URL requested : ".$generatorUrl."<br>";
- $generatorInterfaceObject = new connector($generatorUrl);
- $ISOFile = $generatorInterfaceObject->file;
- $layerId = $row['layer_id'];
- echo "File for layer ".$row['layer_id']." will be generated<br>";
- //generate temporary files under tmp
- if($h = fopen(TMPDIR."/metadata/mapbenderServiceMetadata_".$layerId."_iso19139.xml","w")){
- if(!fwrite($h,$ISOFile)){
- $e = new mb_exception("mod_exportISOMetadata.php: cannot write to file: ".TMPDIR."/mapbenderLayerMetadata_".$row['layer_id']."_iso19139.xml");
- }
- echo "Service metadata file for layer ".$row['layer_id']." written to TMP<br>";
- fclose($h);
- //get all connected metadata for this layer and save it too
- $sql = <<<SQL
-
-SELECT metadata_id, uuid, link, linktype, md_format, origin FROM mb_metadata
-INNER JOIN (SELECT * from ows_relation_metadata
-WHERE fkey_layer_id = $layerId ) as relation ON
-mb_metadata.metadata_id = relation.fkey_metadata_id WHERE mb_metadata.export2csw = TRUE
-
-SQL;
- $i = 0;
- $res_metadata = db_query($sql);
- while ($row_metadata = db_fetch_array($res_metadata)) {
- $generatorUrlMetadata = $generatorBaseUrlMetadata."outputFormat=iso19139&id=".$row_metadata['uuid'];
- echo "URL requested : ".$generatorUrlMetadata."<br>";
- $generatorInterfaceObject = new connector($generatorUrlMetadata);
- $ISOFile = $generatorInterfaceObject->file;
- echo "Metadata uuid: ".$row_metadata['uuid']."<br>";
- //generate temporary files under tmp
- if($h = fopen(TMPDIR."/metadata/mapbenderMetadata_".$layerId."_".$row_metadata['uuid']."_iso19139.xml","w")){
- if(!fwrite($h,$ISOFile)){
- $e = new mb_exception("mod_exportISOMetadata.php: cannot write to file: ".TMPDIR."/metadata/mapbenderMetadata_".$layerId."_".$row_metadata['uuid']."_iso19139.xml");
- }
- echo "Data metadate file for layer ".$row['layer_id']." and metadata ".$row_metadata['uuid']." written to TMP<br>";
- fclose($h);
- $i++;
- }
-}
-
-
-
-
-
Deleted: trunk/mapbender/http/php/mod_treefolderAdmin.php_deprecated
===================================================================
--- trunk/mapbender/http/php/mod_treefolderAdmin.php_deprecated 2016-05-27 07:07:37 UTC (rev 9486)
+++ trunk/mapbender/http/php/mod_treefolderAdmin.php_deprecated 2016-05-27 07:11:28 UTC (rev 9487)
@@ -1,563 +0,0 @@
-<?php
-# $Id: mod_treefolderAdmin.php 7097 2010-11-08 07:48:25Z apour $
-# http://www.mapbender.org/index.php/Administration
-# Copyright (C) see license below
-#
-# Dual License
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-
-/*
- * @security_patch irv open
- */
-// security_patch_log(__FILE__,__LINE__);
-import_request_variables("PG");
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-<META NAME="Generator" CONTENT="Cosmo Create 1.0.3">
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
-?>
-<TITLE>Treefolder Administration</TITLE>
-<STYLE TYPE="text/css">
- <!--
- .sitemap {
- font-family:Arial,Helvetica;
- font-size:10pt;
- line-height:6pt;
- }
-
- body { margin-top:7px;
- margin-left:4px;
- }
- a:link { text-decoration: none }
- a:visited { text-decoration: none }
- a:active { text-decoration: none }
- // -->
-</STYLE>
-<SCRIPT language="JavaScript1.2">
- <!--
-
- /*
- * sitemap.js 1.31 05/02/2000
- * - Opera 5
- *
- * sitemap.js 1.3 27/11/2000
- * - Netscape 6
- *
- * sitemap.js 1.2 20/05/2000
- * - split array tree into arrays for each element old tree
- * - no mory type flag, an folder is an entry which has sons
- * - a folder can have an link
- * - while initing an default layers is shown
- *
- * sitemap.js 1.1 20/10/1999
- * - showTree only updates and init layers new which have been really changed
- * - add deep to knot entry
- * - substitute knotDeep[ id ] w/ tree[ id2treeIndex[ id ] ].deep
- * - add alignment to img and a at the beginning of eyery line
- * - add a fake img for bookmarks on top panel
- *
- * sitemap.js 1.02 14/10/1999
- * - fix bug in initStyles
- *
- * sitemap.js 1.01 06/10/1999
- * - fix bug in knotDeep for Netscape 4.00-4.0.5
- *
- * sitemap.js 1.0 20/09/1999
- *
- * Javascript function for displaying hierarchic directory structures with
- * the ability to collapse and expand directories.
- *
- * Copyright (c) 1999 Polzin GmbH, Duesseldorf. All Rights Reserved.
- * Author: Lutz Eymers <ixtab at polzin.com>
- * Download: http://www.polzin.com/inet/fset_inet.phtml?w=goodies
- *
- * Permission to use, copy, modify, and distribute this software
- * and its documentation for any purposes and without fee
- * is hereby granted provided that this copyright notice
- * appears in all copies.
- *
- * Of course, this software is provided "as is" without express or implied
- * warranty of any kind.
- *
- */
-
-window.onError=null;
-
-var idx=0
-var treeId = new Array();
-var treeP_id = new Array();
-var treeIsOn = new Array();
-var treeTyp = new Array();
-var treeName = new Array();
-var treeUrl = new Array();
-var treeWasOn = new Array();
-var treeDeep = new Array();
-var treeLastY = new Array();
-var treeIsShown = new Array();
-var treeURL = new Array();
-var treeWMS = new Array();
-
-function Note( id,p_id,name,url,left,wms_id) {
- treeId[ idx ] = id;
- treeP_id[ idx ] = p_id;
- treeIsOn[ idx ] = true;
- treeTyp[ idx ] = 'f';
- treeName[ idx ] = name + " <input type='radio' value='"+left+"' name='radio1' style='width:10px;height:10px' onclick='parent.document.forms[0].left.value="+left+"'>" + left + " ("+url+" - "+wms_id+")";
- treeUrl[ idx ] = url ;
- treeWasOn[ idx ] = true;
- treeDeep[ idx ] = 0;
- treeLastY[ idx ] = 0;
- treeIsShown[ idx ] = true;
- treeURL [ idx ] = url;
- treeWMS [ idx ] = wms_id;
- idx++;
-// if(url != ''){
-// parent.loadImage(name);
-// }
- }
-
- function initDiv ( )
- {
- if ( isDOM || isDomIE )
- {
- divPrefix='<DIV CLASS="sitemap" style="position:absolute; left:0; top:0; visibility:hidden;" ID="sitemap'
- divInfo='<DIV CLASS="sitemap" style="position:absolute; visibility:visible" ID="sitemap'
- }
- else
- {
- divPrefix='<DIV CLASS="sitemap" ID="sitemap'
- divInfo='<DIV CLASS="sitemap" ID="sitemap'
- }
- document.writeln( divInfo + 'info">Bitte haben Sie etwas Geduld.<BR> <BR>Es werden die Einträge aus<BR> <BR>der Datenbank initialisiert.</DIV> ' );
- document.writeln("<form name='treeForm'>");
- for ( var i=1; i<idx; i++ )
- {
-
- // linked Name ?
- if ( treeUrl[i] != '' )
-// onClick='if(this.checked){parent.addSelectedLayer("1",""+treeURL[i]+"","visibles")} else{parent.removeSelectedLayer("1",""+treeURL[i]+"","visibles")}'
- linkedName = "<input type='checkbox' onClick=''><IMG SRC='../img/tree/1w.gif' BORDER='0' WIDTH='3'><span>" + treeName[i] + "</span>"
- else
- linkedName = '<IMG SRC="../img/tree/1w.gif" BORDER="0" WIDTH="3">' + treeName[i]
- // don't link folder icon if node has no sons
- if ( i == idx-1 || treeP_id[i+1] != treeId[i] ) {
- if ( treeDeep[ i ] == 0 )
- folderImg = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file_empty.gif" BORDER="0" HEIGHT="16" WIDTH="1" HSPACE="0">'
- else
- folderImg = ''
- } else {
- folderImg = '<A HREF="javascript:sitemapClick(' + treeId[i] + ')"><IMG ALIGN="BOTTOM" SRC="../img/tree/folder_off.gif" BORDER="0" NAME="folder' + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0"></A>'
- }
- // which type of file icon should be displayed?
- if ( treeP_id[i] != 0 )
- {
- if ( lastEntryInFolder( treeId[i] ) )
- fileImg = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file_last.gif" BORDER="0" NAME="file'
- + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0">'
- else
- fileImg = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file.gif" BORDER="0" NAME="file'
- + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0">'
- }
- else
- fileImg = ''
- // traverse parents up to root and show vertical lines if parent
- // is not the last entry on this layer
- verticales = ''
- for( var act_id=treeId[i] ; treeDeep[ id2treeIndex[ act_id ] ] > 1; )
- {
- act_id = treeP_id[ id2treeIndex[ act_id ]]
- if ( lastEntryInFolder( act_id ) )
- {
- verticales = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file_empty.gif" BORDER="0" HEIGHT="16" WIDTH="30" HSPACE="0">' + verticales
- }
- else
- {
- verticales = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file_vert.gif" BORDER="0" HEIGHT="16" WIDTH="30" HSPACE="0">' + verticales
- }
- }
-
-
- document.writeln( divPrefix + treeId[i] + '"><NOBR> ' + verticales + fileImg + folderImg + linkedName + '</NOBR></DIV><BR>'
- )
- }
- document.writeln("</form>");
- }
-
- function initStyles ( )
- {
- document.writeln( '<STYLE TYPE="text/css">' + "\n" + '<!--' )
- for ( var i=1,y=y0; i<idx; i++ )
- {
- document.writeln( '#sitemap' + treeId[i] + ' {POSITION: absolute; VISIBILITY: hidden;}' )
- if ( treeIsOn[ id2treeIndex[ treeP_id[i] ] ] )
- y += deltaY
- }
- document.writeln( '#sitemapinfo {POSITION: absolute; VISIBILITY: visible;}' )
- document.writeln( '//-->' + "\n" + '</STYLE>' )
- }
-
-
-
- function sitemapClick( id )
- {
- var i = id2treeIndex[ id ]
-
- if ( treeIsOn[ i ] )
- // close directory
- {
- // mark node as invisible
- treeIsOn[ i ]=false
- // mark all sons as invisible
- actDeep = treeDeep[ i ]
- for( var j=i+1; j<idx && treeDeep[j] > actDeep; j++ )
- {
- treeWasOn[ j ] = treeIsOn[ j ]
- treeIsOn[ j ]=false
- }
- gif_off( id )
- }
- else
- // open directory
- {
- treeIsOn[ i ]=true
- // remember and restore old status
- actDeep = treeDeep[ i ]
- for( var j=i+1; j<idx && treeDeep[j] > actDeep; j++ )
- {
- treeIsOn[ j ] = treeWasOn[ j ]
- }
- gif_on( id )
- }
- showTree()
- }
-
- function knotDeep( id )
- {
- var deep=0
- while ( true )
- if ( treeP_id[ id2treeIndex[id] ] == 0 )
- return deep
- else
- {
- ++deep
- id = treeP_id[ id2treeIndex[id] ]
- }
- return deep
- }
-
- function initTree( id )
- {
- treeIsOn[ id2treeIndex[id] ] = true
- if ( treeTyp[ id2treeIndex[id] ] != 'b' )
- gif_on( id )
- while ( treeP_id[ id2treeIndex[id] ] != 0 )
- {
- id = treeP_id[ id2treeIndex[id] ]
- treeIsOn[ id2treeIndex[id] ] = true
- if ( treeTyp[ id2treeIndex[id] ] != 'b' )
- gif_on( id )
- }
- }
-
- function lastEntryInFolder( id )
- {
- var i = id2treeIndex[id]
- if ( i == idx-1 )
- return true
- if ( treeTyp[i] == 'b' )
- {
- if ( treeP_id[i+1] != treeP_id[i] )
- return true
- else
- return false
- }
- else
- {
- var actDeep = treeDeep[i]
- for( var j=i+1; j<idx && treeDeep[j] > actDeep ; j++ )
- ;
- if ( j<idx && treeDeep[j] == actDeep )
- return false
- else
- return true
- }
- }
-
- function showTree()
- {
- for( var i=1, y=y0, x=x0; i<idx; i++ )
- {
- if ( treeIsOn[ id2treeIndex[ treeP_id[i] ] ] )
- {
- // show current node
- if ( !(y == treeLastY[i] && treeIsShown[i] ) )
- {
- showLayer( "sitemap"+ treeId[i] )
- setyLayer( "sitemap"+ treeId[i], y )
- treeIsShown[i] = true
- }
- treeLastY[i] = y
- y += deltaY
- }
- else
- {
- // hide current node and all sons
- if ( treeIsShown[ i ] )
- {
- hideLayer( "sitemap"+ treeId[i] )
- treeIsShown[i] = false
- }
- }
- }
- }
-
- function initIndex() {
- for( var i=0; i<idx; i++ )
- id2treeIndex[ treeId[i] ] = i
- }
-
- function gif_name (name, width, height) {
- this.on = new Image (width, height);
- this.on.src ="../img/tree/" + name + "_on.gif"
- this.off = new Image (width, height);
- this.off.src ="../img/tree/" + name + "_off.gif"
- }
-
- function load_gif (name, width, height) {
- gif_name [name] = new gif_name (name,width,height);
- }
-
- function load_all () {
- load_gif ('folder',30,16)
- file_last = new Image( 30,16 )
- file_last.src = "file_last.gif"
- file_middle = new Image( 30,16 )
- file_middle.src = "file.gif"
- file_vert = new Image( 30,16 )
- file_vert.src = "file_vert.gif"
- file_empty = new Image( 30,16 )
- file_empty = "file_empty.gif"
- }
-
- function gif_on ( id ) {
- eval("document['folder" + id + "'].src = gif_name['folder'].on.src")
- }
-
- function gif_off ( id ) {
- eval("document['folder" + id + "'].src = gif_name['folder'].off.src")
- }
-
- // global configuration
- var deltaX = 30
- var deltaY = 16
- var x0 = 5
- var y0 = 5
- var defaultTarget = 'examplemain'
-
- var browserName = navigator.appName;
- var browserVersion = parseInt(navigator.appVersion);
- var isIE = false;
- var isNN = false;
- var isDOM = false;
- var isDomIE = false;
- var isDomNN = false;
- var layerok = false;
-
- var isIE = browserName.indexOf("Microsoft Internet Explorer" )==-1?false:true;
- var isNN = browserName.indexOf("Netscape")==-1?false:true;
- var isOpera = browserName.indexOf("Opera")==-1?false:true;
- var isDOM = document.getElementById?true:false;
- var isDomNN = document.layers?true:false;
- var isDomIE = document.all?true:false;
-
- if ( isNN && browserVersion>=4 ) layerok=true;
- if ( isIE && browserVersion>=4 ) layerok=true;
- if ( isOpera && browserVersion>=5 ) layerok=true;
-
-
- function hideLayer(layerName) {
- if (isDOM)
- document.getElementById(layerName).style.visibility="hidden"
- else if (isDomIE)
- document.all[layerName].style.visibility="hidden";
- else if (isDomNN)
- document.layers[layerName].visibility="hidden";
- }
-
- function showLayer(layerName) {
- if (isDOM)
- document.getElementById(layerName).style.visibility="visible"
- else if (isDomIE)
- document.all[layerName].style.visibility="visible";
- else if (isDomNN)
- document.layers[layerName].visibility="visible";
- }
-
- function setyLayer(layerName, y) {
- if (isDOM)
- document.getElementById(layerName).style.top=y + "px"
- else if (isDomIE)
- document.all[layerName].style.top=y + "px";
- else if (isDomNN)
- document.layers[layerName].top=y + "px";
- }
-
- var id2treeIndex = new Array()
-
- // the structure is easy to understand with a simple example
- // p_id is the id of the parent
- // E0 ( id=0,p_id=-1 )
- // E11 ( id=1,p_id=0)
- // E111 ( id=2,p_id=1 )
- // E112 ( id=3,p_id=1 )
- // E12 ( id=4,p_id=0 )
- // E121 ( id=5,p_id=4 )
- // E13 ( id=6,p_id=0 )
- // E131 ( id=7,p_id=6 )
- // E1311 ( id=8,p_id=7 )
- // E132 ( id=9,p_id=6 )
- // this is a multinary tree structure which is easy to
- // populate with database data :)
-<?php
-$sql = "SELECT id FROM gui_treegde WHERE fkey_gui_id = $1";
-// $v and $t will be re-used below!
-$v = array($guiList);
-$t = array("s");
-$res = db_prep_query($sql, $v, $t);
-if(!db_fetch_row($res)){
- $sql = "INSERT INTO gui_treegde(fkey_gui_id, my_layer_title,lft,rgt,layer) VALUES($1, 'new','1','4','')";
- //using $v and $t fom above
- db_prep_query($sql, $v, $t);
- $sql = "INSERT INTO gui_treegde(fkey_gui_id,my_layer_title,lft,rgt,layer) VALUES($1,'new','2','3','')";
- //using $v and $t fom above
- db_prep_query($sql, $v, $t);
-}
-
-$sql = "SELECT n.wms_id, n.id, n.my_layer_title, n.lft, n.rgt, n.layer, COUNT(*) AS level1, ((n.rgt - n.lft -1)/2) AS offspring ";
-$sql .= "FROM gui_treegde as n, gui_treegde as p WHERE n.lft BETWEEN p.lft AND p.rgt ";
-$sql .= " AND n.fkey_gui_id = $1 AND p.fkey_gui_id = $2 ";
-$sql .= " GROUP BY n.wms_id, n.lft, n.my_layer_title, ((n.rgt - n.lft -1)/2) , n.id, n.rgt, n.layer ORDER BY n.lft;";
-#echo $sql;
-$v = array($guiList, $guiList);
-$t = array("s", "s");
-$res = db_prep_query($sql, $v, $t);
- echo "function initArray(){";
- echo "Note(0,-1,'','');";
- $cnt = 0;
-
- while($row = db_fetch_array($res)){
- if(db_result($res, $cnt, "level1") == 1 && $row["offspring"] >= 0 ){
- if(count($parent) > 0){unset($parent);}
- $level = db_result($res, $cnt, "level1");
- $parent[$level+1] = db_result($res, $cnt, "id");
- echo "Note(".$row["id"].",0,'".$row["my_layer_title"]."','".$row["layer"]."',".$row["lft"];
- if($row["wms_id"] != ''){
- echo ", '".$row["wms_id"]."'";
- }
- echo ");";
- }
- /**/
- else if($row["level1"] > $level){
- $level = $row["level1"];
- $parent[$level+1] = $row["id"];
- echo "Note(".$row["id"].",".$parent[$level].",'".$row["my_layer_title"]."','".$row["layer"]."',".$row["lft"];
- if($row["wms_id"] != ''){
- echo ", '".$row["wms_id"]."'";
- }
- echo ");";
- }
- /**/
- else if($row["level1"] == $level){
- $level = $row["level1"];
- $parent[$level+1] = $row["id"];
- echo "Note(".$row["id"].",".$parent[$level].",'".$row["my_layer_title"]."','".$row["layer"]."',".$row["lft"];
- if($row["wms_id"] != ''){
- echo ", '".$row["wms_id"]."'";
- }
- echo ");";
- }
- /**/
- else if($row["level1"] < $level){
- $level = $row["level1"];
- $parent[$level + 1] = $row["id"];
- echo "Note(".$row["id"].",".$parent[$level].",'".$row["my_layer_title"]."','".$row["layer"]."',".$row["lft"];
- if($row["wms_id"] != ''){
- echo ", '".$row["wms_id"]."'";
- }
- echo ");";
- }
-
- $cnt++;
- }
- echo "treeTyp[0] = 'f'; treeIsOn[0] = true; treeWasOn[0] = true;";
- echo "}";
-?>
- function initArray_()
- {
- Note(0,-1,'','')
- Note(1,0,'Tutorials','')
- Note(8,1,'HTML','')
- Note(10,8,'SelfHtml','http://www.teamone.de/selfaktuell/')
- Note(9,1,'willi','')
- Note(100,9,'SelfHtml','http://www.teamone.de/selfaktuell/')
- Note(3,1,'JavaScript','')
- Note(4,3, 'Netscape Guide 1.3','http://developer.netscape.com/docs/manuals/js/client/jsguide/index.htm')
- Note(7,3, 'Introduction to Javascript','http://rummelplatz.uni-mannheim.de/~skoch/js/script.htm')
- Note(12,1, 'Perl','')
- Note(14,12, 'Perl Tutorial','http://www.awu.id.ethz.ch/~didi/perl/perl_start.html')
- Note(13,1,'SQL','')
- Note(15,13, 'Introduction to SQL','http://w3.one.net/~jhoffman/sqltut.htm')
- Note(111,1, 'Introduction to SQL','http://w3.one.net/~jhoffman/sqltut.htm')
- Note(2,0, 'Reference Manuals','')
- Note(11,2, 'HTML Version 3.2 Referenz','http://www.cls-online.de/htmlref/index.htm')
- Note(6,2,'Netscape Reference 1.3','http://developer.netscape.com/docs/manuals/js/client/jsref/index.htm')
- Note(17,2,'PHP Manual','http://www.php.net/manual/html/')
- treeTyp[0] = 'f'
- treeIsOn[0] = true
- treeWasOn[0] = true
- }
-
- var idx=0
- initArray()
- initIndex()
- load_all()
- for( i=1; i<idx; i++ )
- {
- treeDeep[i] = knotDeep( treeId[i] )
- if ( treeDeep[i] == 0 )
- treeIsShown[i] = true
- }
- if ( isDomNN )
- initStyles();
- //-->
- </SCRIPT>
-</HEAD>
-<BODY VLINK="#000000" ALINK="#000000" LINK="#000000" BGCOLOR="#ffffff" TEXT="#000000"
- onLoad="if (layerok) showTree();"
- MARGINHEIGHT="0" MARGINWIDTH="0" LEFTMARGIN="0" TOPMARGIN="0" onkeydown="parent.keyhandler('FolderFrame')">
-<SCRIPT language="JavaScript1.2">
-<!--
- initDiv();
- hideLayer("sitemapinfo");
-//-->
-</SCRIPT>
-</BODY>
-</HTML>
Deleted: trunk/mapbender/http/php/nestedSets.php_deprecated
===================================================================
--- trunk/mapbender/http/php/nestedSets.php_deprecated 2016-05-27 07:07:37 UTC (rev 9486)
+++ trunk/mapbender/http/php/nestedSets.php_deprecated 2016-05-27 07:11:28 UTC (rev 9487)
@@ -1,412 +0,0 @@
-<?php
-# $Id: nestedSets.php 7097 2010-11-08 07:48:25Z apour $
-# http://www.mapbender.org/index.php/Administration
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-
-/*
- * @security_patch irv open
- */
-// security_patch_log(__FILE__,__LINE__);
-import_request_variables("PG");
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="0">
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
-?>
-<title>nestedSets</title>
-<?php
-include '../include/dyn_css.php';
-?>
-
-<style type="text/css">
- <!--
- input{
- width: 164px;
- }
- body{
- font-family : Arial, Helvetica, sans-serif;
- font-size: 12px;
- }
- -->
-</style>
-</head>
-<!-- <link rel='stylesheet' type='text/css' href='administration.css'> -->
-<script type="text/javascript">
-<!--
-function validate(value){
- var permission = true;
- if(value == 'insert'){
- /*
- if(document.forms[0].title.value == ''){alert("Bitte geben Sie einen Titel an."); permission = false; return;}
- if(document.forms[0].left.value == ''){alert("Wählen Sie eine Position."); permission = false; return;}
- */
- if(document.forms[0].title.value == ''){alert("<?php echo _mb("Please insert a title.") ?>"); permission = false; return;}
- if(document.forms[0].left.value == ''){alert("Please choose a position."); permission = false; return;}
-
- if(document.forms[0].wmsList.selectedIndex > 0 && document.forms[0].layer.selectedIndex == 0){alert("Wählen Sie einen Layer."); permission = false; return;}
- if(permission == true){document.forms[0].action.value = "insert"; document.forms[0].submit();}
- }
- if(value == 'delete'){
- //permission = confirm("Soll das Objekt mit Inhalten gelöscht werden?");
- permission = confirm("Do you want to delete the object and the content of the object?");
- if(permission == true){
- document.forms[0].action.value = "delete";
- document.forms[0].submit();
- }
- }
- if(value == 'update'){
- /*
- if(document.forms[0].title.value == ''){alert("Bitte geben Sie einen Titel an."); permission = false; return;}
- if(document.forms[0].left.value == ''){alert("Bitte wählen Sie eine Position."); permission = false; return;}
- */
-
- if(document.forms[0].title.value == ''){alert("Please fill in a labeling."); permission = false; return;}
- if(document.forms[0].left.value == ''){alert("Please choose a position."); permission = false; return;}
-
- if(permission == true){document.forms[0].action.value = "update"; document.forms[0].submit();}
- }
- if(value == 'add'){
- /*
- if(document.forms[0].left.value == ''){alert("Bitte wählen Sie eine Position."); permission = false; return;}
- if(document.forms[0].guiList.selectedIndex == 0){alert("Bitte wählen Sie eine GUI."); permission = false; return;}
- if(document.forms[0].wmsList.selectedIndex == 0){alert("Bitte wählen Sie einen WMS."); permission = false; return;}
- if(document.forms[0].layer.selectedIndex == 0){alert("Bitte wählen Sie eine Ebene."); permission = false; return;}
- */
-
- if(document.forms[0].left.value == ''){alert("Please fill in a position."); permission = false; return;}
- if(document.forms[0].guiList.selectedIndex == 0){alert("Please choose a GUI."); permission = false; return;}
- if(document.forms[0].wmsList.selectedIndex == 0){alert("Please choose a WMS."); permission = false; return;}
- if(document.forms[0].layer.selectedIndex == 0){alert("Please choose a layer."); permission = false; return;}
-
- if(permission == true){document.forms[0].action.value = "add"; document.forms[0].submit();}
- }
-}
-function rmWMS(obj){
- if(obj.value == ''){
- document.forms[0].wmsList.selectedIndex = 0;
- }
-}
-// -->
-</script>
-<body >
-<?php
-
-if(isset($action)){
- if($layer == 'Ordner'){$layer = "";}
-}
-if(isset($action) && $action == "insert"){
- $temp = explode("###", $layer);
- $sql = "SELECT rgt FROM gui_treegde WHERE lft = $1 AND fkey_gui_id = $2";
- $v = array($left, $guiList);
- $t = array("i", "s");
- $res = db_prep_query($sql, $v, $t);
- if($pos == 'in'){$left = $left + 1;}
- else if($pos == 'hinter'){$left = db_result($res,0,"rgt") + 1;}
- else{ $left = $left + 2;}
-
- $sql = "UPDATE gui_treegde SET rgt=rgt+2 WHERE rgt >= $1 AND fkey_gui_id = $2";
- $v = array($left, $guiList);
- $t = array("i", "s");
- db_prep_query($sql, $v, $t);
-#echo $sql . " 1: ".$left." 2:".$guiList."<br>";
- $sql = "UPDATE gui_treegde SET lft=lft+2 WHERE lft >= $1 AND fkey_gui_id = $2";
- $v = array($left, $guiList);
- $t = array("i", "s");
- db_prep_query($sql, $v, $t);
-#echo $sql . " 1: ".$left." 2:".$guiList."<br>";
-
- $sql = "INSERT INTO gui_treegde(fkey_gui_id, fkey_layer_id, lft,rgt, ";
- $sql .= "my_layer_title, layer, wms_id) VALUES($1, $2, $3, $4, $5, $6, $7)";
-#echo $sql . "<br>";
- $v = array($guiList, $temp[0], $left, ($left+1), $name, $temp[1], $wmsList);
- $t = array("s", "s", "i", "i", "s", "s", "s");
- db_prep_query($sql, $v, $t);
-
- /*
- if($layer == ""){
- $left = $left + 1;
- $sql = "UPDATE gui_treegde SET rgt=rgt+2 WHERE rgt >=". $left." AND fkey_gui_id = '".$guiList."'";
- db_query($sql);
- $sql = "UPDATE gui_treegde SET lft=lft+2 WHERE lft >=".$left." AND fkey_gui_id = '".$guiList."'";
- db_query($sql);
- #hier ist noch was falsch
- $sql = "INSERT INTO gui_treegde(fkey_gui_id,my_layer_title,lft,rgt,layer) VALUES('".$guiList."','new',".$left.",".($left+1).",'new')";
- #echo $sql . "<br />";
- db_query($sql);
- }
- */
-}
-if(isset($action) && $action == "delete"){
- if($left){
- $sql = "SELECT rgt FROM gui_treegde WHERE lft = $1 AND fkey_gui_id = $2";
- $v = array($left, $guiList);
- $t = array("i", "s");
- $res = db_prep_query($sql, $v, $t);
- $right = db_result($res,0,"rgt");
-
- $sql = "DELETE FROM gui_treegde WHERE lft BETWEEN $1 and $2 AND fkey_gui_id = $3";
- $v = array($left, $right, $guiList);
- $t = array("i", "i", "s");
- db_prep_query($sql, $v, $t);
-
- $sql = "UPDATE gui_treegde SET lft=lft-$1 WHERE lft > $2 AND fkey_gui_id = $3";
- $v = array($right-$left+1, $right, $guiList);
- $t = array("i", "i", "s");
- db_prep_query($sql, $v, $t);
-#echo $sql . " r:".$right." l:".$left." 2:".$guiList."<br>";
- $sql = "UPDATE gui_treegde SET rgt=rgt-$1 WHERE rgt > $2 AND fkey_gui_id = $3";
- $v = array($right-$left+1, $right, $guiList);
- $t = array("i", "i", "s");
-#echo $sql . " r:".$right." l:".$left." 2:".$guiList."<br>";
- db_prep_query($sql, $v, $t);
- }
-}
-if(isset($action) && $action == "update"){
- $temp = explode("###", $layer);
- $sql = "UPDATE gui_treegde SET ";
- $sql .= "my_layer_title = $1, ";
- $sql .= "fkey_layer_id = $2, ";
- $sql .= "layer = $3, ";
- $sql .= "wms_id = $4";
- $sql .= " WHERE lft = $5 AND fkey_gui_id = $6";
- $v = array($name, $temp[0], $temp[1], $wmsList, $left, $guiList);
- $t = array("s", "s", "s", "s", "i", "s");
- db_prep_query($sql, $v, $t);
-}
-if(isset($action) && $action == "add"){
- $temp = explode("###", $layer);
-
- $sql_val = "SELECT * FROM gui_treegde WHERE lft = $1 AND fkey_gui_id = $2";
- $v = array($left, $guiList);
- $t = array("i", "s");
- $res_val = db_prep_query($sql_val, $v, $t);
-
- $sql = "UPDATE gui_treegde SET ";
- $sql .= "fkey_layer_id = $1, layer = $2, wms_id = $3 ";
- $sql .= "WHERE lft = $4 AND fkey_gui_id = $5";
-
- $v = array();
- $t = array("s", "s", "s", "i", "s");
-
- if (db_result($res_val, 0, "fkey_layer_id") != '') {
- array_push($v, db_result($res_val, 0, "fkey_layer_id") . "," . $temp[0]);
- }
- else {
- array_push($v, $temp[0]);
- }
-
- if (db_result($res_val, 0, "layer") != '') {
- array_push($v, db_result($res_val, 0, "layer") . "," . $temp[1]);
- }
- else {
- array_push($v, $temp[1]);
- }
-
- if (db_result($res_val, 0, "wms_id") != '') {
- array_push($v, db_result($res_val, 0, "wms_id") . "," . $wmsList);
- }
- else {
- array_push($v, $wmsList);
- }
- array_push($v, $left);
- array_push($v, $guiList);
- db_prep_query($sql, $v, $t);
-}
-?>
-<br />
-<b>Create your own tree for your GUI. Include the element treeconfGDE to see this tree</b><br />
-Find detailed infos in the (<a href='http://www.mapbender.org/index.php/ConfTreeGde' target='_blank'>Mapbender Wiki</a>)<br />
-1. Select the GUI you want to create the new tree for <br />
-2. Select an element in the folder view<br />
-<br />
-<br />
-<!-- -->
-<?php
-if(isset($guiList) && $guiList != ""){
- echo "<iframe ID='foldertree' name='foldertree' height='400' width='300' src='mod_treefolderAdmin.php?guiList=".urlencode($guiList)."' scrolling='auto' frameborder='1'></iframe>";
-}
-else{
- echo "<iframe ID='foldertree' name='foldertree' height='400' width='300' src='../html/mod_blank.html' scrolling='auto' frameborder='1'></iframe>";
-}
-?>
-
-<div style='position:absolute;top:50px;left:350px'>
-<form action='<?php $self; ?>' method='POST'>
-<br><br>
-<table >
-<tr><td></td><td></td></tr>
-<?php
-require_once(dirname(__FILE__)."/../classes/class_administration.php");
-$admin = new administration();
-$ownguis = $admin->getGuisByOwner(Mapbender::session()->get("mb_user_id"),true);
-
-$sql = "SELECT * FROM gui WHERE gui_id IN (";
-$v = $ownguis;
-$t = array();
-for ($i = 1; $i <= count($ownguis); $i++){
- if ($i > 1) {
- $sql .= ",";
- }
- $sql .= "$" . $i;
- array_push($t, "s");
-}
-$sql .= ") ORDER BY gui_name";
-
-$res = db_prep_query($sql, $v, $t);
-$cnt = 0;
-echo "<select class='guiList' size='10' name='guiList' class='guiList' onchange='document.forms[0].submit()'>";
-echo "<option value=''>GUI ...</option>";
-while($row = db_fetch_array($res)){
- echo "<option value='".$row["gui_id"]."' ";
- if(isset($guiList) && $guiList == $row["gui_id"]){
- echo "selected";
- }
- echo ">".$row["gui_name"]."</option>";
- $cnt++;
-}
-echo "</select><br>";
-echo "<tr>";
- #echo "<td>Beschriftung:</td>";
- echo "<td>Labeling:</td>";
- echo "<td><input type='text' size='16' name='name' value='";
- echo htmlentities($name, ENT_QUOTES);
- echo "'></td>";
-echo "</tr>";
-?>
-<tr>
-<td>WMS: </td>
-<td>
- <select name='wmsList' onchange='document.forms[0].submit()'>
- <option value=''>WMS ...</option>
- <?php
- if(isset($guiList) && $guiList != ""){
- $sql = "SELECT gui_wms.fkey_wms_id, wms.wms_title FROM gui_wms ";
- $sql .= "INNER JOIN wms ON gui_wms.fkey_wms_id = wms.wms_id ";
- $sql .= "WHERE gui_wms.fkey_gui_id = $1 ";
- $sql .= "ORDER BY wms.wms_title";
- $v = array($guiList);
- $t = array("s");
- $res = db_prep_query($sql, $v, $t);
- $cnt = 0;
- while($row = db_fetch_array($res)){
- echo "<option value='".$row["fkey_wms_id"]."' ";
- if($wmsList == $row["fkey_wms_id"]){
- echo "selected";
- }
- echo ">";
- echo $row["wms_title"];
- echo "</option>";
- $cnt++;
- }
- }
-
- else{echo "<option value=''>no gui selected</option>";}
- echo"</select>";
- echo"</td> </tr><tr>";
- #echo"<td>Ordner oder Ebene: </td>";
- echo"<td>Folder or Layer: </td>";
- echo"<td>";
- echo"<select name='layer' onchange='rmWMS(this)'>";
- #echo"<option value=''>Ordner</option>";
- echo"<option value=''>Folder</option>";
- if(isset($wmsList) && $wmsList != ""){
- $sql_l = "SELECT gui_layer.fkey_layer_id, layer.layer_name, layer.layer_title FROM gui_layer ";
- $sql_l .= "LEFT JOIN layer ON gui_layer.fkey_layer_id = layer.layer_id ";
- $sql_l .= "WHERE gui_layer.gui_layer_wms_id = $1 AND layer.layer_parent = '0' AND gui_layer.fkey_gui_id = $2";
- $sql_l .= " ORDER BY layer.layer_title";
- $v = array($wmsList, $guiList);
- $t = array("i", "s");
- $res_l = db_prep_query($sql_l, $v, $t);
- $cnt = 0;
- while($row = db_fetch_array($res_l)){
- echo "<option value='".$row["fkey_layer_id"]."###".$row["layer_name"]."'>";
- echo $row["layer_title"];
- echo "</option>";
- $cnt++;
- }
- }
- ?>
- </select>
-</td>
-</tr>
-<tr>
- <td>Position: </td>
- <td>
- <select name='pos'>
-<?php
- #echo "<option value='hinter'>hinter</option>";
- echo "<option value='hinter'>behind</option>";
- echo "<option value='in' ";
- if($pos == 'in'){
- echo "selected";
- }
- echo ">in</option>";
- echo"</select> </td> </tr><tr>";
- #echo"<td>Hinter bzw. in Element Nr.:</td>";
- echo"<td>Insert behind or <br>in element with number:</td>";
- echo "<td><input type='text' size='1' name='left' ";
- if($left)
- {
- echo "value='".htmlentities($left,ENT_QUOTES)."'";
- }
- echo "></td>";
-?>
-</tr>
-<tr>
- <td>
- <!--<input class='abutton' type='button' name="insert" value='einfügen' onclick="validate('insert')"></td>
- -->
- <input class='abutton' type='button' name="insert" value='create new element' onclick="validate('insert')"></td>
- <td></td>
-</tr>
-<tr>
- <td>
- <!--
- <input class='abutton' type='button' name="delete" value='löschen' onclick="validate('delete')"></td>
- -->
- <input class='abutton' type='button' name="delete" value='delete element' onclick="validate('delete')"></td>
- <td></td>
-</tr>
-<tr>
- <td>
- <!--
- <input class='abutton' type='button' name="update" value='&amlndern' onclick="validate('update')"></td>
- -->
- <input class='abutton' type='button' name="update" value='change element' onclick="validate('update')"></td>
- <td></td>
-</tr>
-<tr>
- <td>
- <!--
- <input class='abutton' type='button' name="update" value='Ebene verbinden' onclick="validate('add')"></td>
- -->
- <input class='abutton' type='button' name="update" value='join layer' onclick="validate('add')"></td>
- <td></td>
-</tr>
-<input type='hidden' name="action">
-</table>
-</form>
-</div>
-</body>
-</html>
More information about the Mapbender_commits
mailing list