You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(49) |
Sep
(25) |
Oct
(2) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(24) |
Nov
(50) |
Dec
(4) |
2004 |
Jan
(2) |
Feb
(2) |
Mar
(5) |
Apr
|
May
(10) |
Jun
|
Jul
(10) |
Aug
(22) |
Sep
(10) |
Oct
|
Nov
(57) |
Dec
(5) |
2005 |
Jan
(24) |
Feb
(12) |
Mar
|
Apr
|
May
(3) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
(5) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: <le...@pr...> - 2004-11-07 09:49:54
|
Update of /cvsroot/meshdb/src/geo/alt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4547/alt Modified Files: Tag: leonard-dev main.c Added Files: Tag: leonard-dev Makefile.am Removed Files: Tag: leonard-dev BSDmakefile GNUmakefile Makefile.common Log Message: autoconf --- NEW FILE: Makefile.am --- # $Id: Makefile.am,v 1.1.2.1 2004/11/07 09:49:42 leonard Exp $ AM_CPPFLAGS = -I$(top_srcdir) bin_PROGRAMS = alt alt_SOURCES = main.c alt_LDADD = ../libgeo/libgeo.a Index: main.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/alt/main.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- main.c 24 Nov 2003 07:19:22 -0000 1.3 +++ main.c 7 Nov 2004 09:49:42 -0000 1.3.2.1 @@ -20,8 +20,8 @@ #include <ieeefp.h> #endif -#include "alt.h" -#include "image.h" +#include "libgeo/alt.h" +#include "libgeo/image.h" #include "compat/compat.h" #include "compat/err.h" --- BSDmakefile DELETED --- --- GNUmakefile DELETED --- --- Makefile.common DELETED --- |
Update of /cvsroot/meshdb/src/geo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4547 Added Files: Tag: leonard-dev Makefile.am configure.ac Removed Files: Tag: leonard-dev BSDmakefile GNUmakefile Makefile.common Makefile.inc Log Message: autoconf --- NEW FILE: Makefile.am --- # $Id: Makefile.am,v 1.1.2.1 2004/11/07 09:49:42 leonard Exp $ SUBDIRS = libgeo SUBDIRS += alt SUBDIRS += elev SUBDIRS += rf SUBDIRS += shift SUBDIRS += make-alt-qt SUBDIRS += make-hgt-qt SUBDIRS += httphead --- NEW FILE: configure.ac --- AC_INIT(meshdb-geo, 1.0, [ohg...@br...]) AC_REVISION([$Id]) AM_INIT_AUTOMAKE(foreign) AM_CONFIG_HEADER(libgeo/config.h) AC_CONFIG_FILES([Makefile libgeo/Makefile alt/Makefile elev/Makefile rf/Makefile shift/Makefile make-alt-qt/Makefile make-hgt-qt/Makefile httphead/Makefile ]) AC_PROG_CC AC_PROG_RANLIB AC_HEADER_STDC AC_CHECK_HEADERS(err.h inttypes.h) #-- Portable network graphics AC_ARG_WITH(libpng, AC_HELP_STRING([--with-libpng=PREFIX], [specify libpng installation]), ac_cv_use_libpng=$withval, ac_cv_use_libpng=auto) AC_CACHE_CHECK([libpng-config], [ac_cv_libpng_config], [if test "auto" = "$ac_cv_use_libpng"; then prog=libpng-config else prog="$ac_cv_use_libpng/bin/libpng-config" fi if $prog --version >/dev/null 2>/dev/null; then ac_cv_libpng_config=$prog else ac_cv_libpng_config=no fi]) if test "no" != "$ac_cv_libpng_config"; then CPPFLAGS="$CPPFLAGS `$ac_cv_libpng_config --cppflags`" CFLAGS="$CFLAGS `$ac_cv_libpng_config --cflags`" LDFLAGS="$LDFLAGS `$ac_cv_libpng_config --L_opts`" LDFLAGS="$LDFLAGS `$ac_cv_libpng_config --R_opts`" LIBS="$LIBS `$ac_cv_libpng_config --libs`" fi AC_CHECK_HEADER(png.h,, [AC_MSG_ERROR([unable to find required PNG headers])]) AC_SEARCH_LIBS(png_init_io,png,, [AC_MSG_ERROR([unable to find required PNG library])]) AC_C_BIGENDIAN AC_OUTPUT --- BSDmakefile DELETED --- --- GNUmakefile DELETED --- --- Makefile.common DELETED --- --- Makefile.inc DELETED --- |
From: <le...@pr...> - 2004-11-07 09:43:32
|
Update of /cvsroot/meshdb/src/geo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3411/geo Modified Files: Tag: leonard-dev README Log Message: better readmes Index: README =================================================================== RCS file: /cvsroot/meshdb/src/geo/README,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- README 15 Sep 2002 12:58:29 -0000 1.2 +++ README 7 Nov 2004 09:42:55 -0000 1.2.2.1 @@ -1,5 +1,6 @@ -The source code to these mapping tools and database are placed in the Public Domain. +The source code to these mapping tools and database are placed +in the Public Domain. Edit Makefile.inc to set up some paths @@ -9,14 +10,10 @@ * Other packages you may need installed are: php, mysql, netpbm * Brisbane Mesh database at http://www.brismesh.net/ -David Leonard, Brisbane. October 2001. - +Interesting reading: -NTv2 shift files available from: - http://www.anzlic.org.au/icsm/gdatm/zipfiles/national66.zip - http://www.anzlic.org.au/icsm/gdatm/zipfiles/national84.zip + http://www.asprs.org/asprs/resources/grids/12-2003-australia.pdf -On makefiles: - - i used both BSD make and GNU make... the BSDmakefile and - GNUmakefile files are automatically read by the right ones. +David Leonard, Brisbane. October 2001. +$Id$ |
From: <le...@pr...> - 2004-11-07 09:43:32
|
Update of /cvsroot/meshdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3411 Modified Files: Tag: leonard-dev README Added Files: Tag: leonard-dev README.setup Log Message: better readmes --- NEW FILE: README.setup --- $Id: README.setup,v 1.1.2.1 2004/11/07 09:42:55 leonard Exp $ Procedure for setting up the MeshDB database for Brismesh.org. 1. Obtain a copy of the meshdb source and web tree The source can be obtained from the meshdb CVS repository on sourceforge. See <http://sf.net/cvs/?group_id=50949> for details. You will need to check out the modules 'src' and 'www/db2'. The latter directory will be referred to as 'the db2 directory' and should be visible by your web server. This README.setup file is found in the 'src' module. 2. Obtain map data (a) Digital Elevation Model In 2001, I bought 9 second DEM data from an AUSLIG agent. The tiles I purchased were SG56 and SH56. The data came on a CDROM in various formats, but the easiest to work with was the '.grd' versions. - sg56.grd - sh56.grd (b) Grid distortion tables This table is required for the UTM/GPS conversions. Download the AGD66-GDA94 data (national66.zip) from one of the following: - http://www.nrme.qld.gov.au/property/surveying/gdasoftware.html#grids - http://www.icsm.gov.au/icsm/gda/gdatm/national66.zip (c) VPF topographic data for Australia Download VPF data bundle for Australia from http://www.iscgm.org/ - gmaus-1_1-20001230.zip You may need to register (email turnaround about 2 days). (The source data 'globalmap' is also available through http://www.ga.gov.au/ but has a restrictive licence, is not free in VPF format and also requires a registration.) 2. Install required software: - mysql (server) - apache (web server) - php4 (apache module, with mysql extension) - libpng - gd (version 2.0+) - freetype - zlib - gcc, make 3. Set up your MySQL server and create a 'mesh' database. (a) Create db2/config-local.php First, copy the 'db2/config-local.php-dist' file to 'db2/config-local.php', and edit it, setting the host and user names as you desire. In this example, I'll assume mysql username 'www' with password 'pass', with database name 'mesh' running on localhost. (b) Create a mesh database and www user Make sure that the mysql database server is installed and running, and create a 'mesh' database using the server's root account: $ mysql -u root -p Password: mysql> create database mesh; mysql> use mesh mysql> grant select,insert,delete,update on mesh.* to www@localhost identified by 'pass'; mysql> flush privileges; (Note: localhost has been used in the grant clause because that is the name of the host that the server sees the client connect *from*. It is only a coincidence that it is the same name as the host that the client thinks it is connecting *to*) (c) Create the mesh databases, using the creation script $ mysql -u root -p mesh < src/geo/dist/create.sql (d) Test that the database is working. Use the hostname from config-local.php, and connect from the host running the web server, if you can. $ mysql -h localhost -u www -p mesh Password: pass mysql> select * from admin; Empty set (0.00 sec) 4. Compile and install DEM and geodesy tools (a) Edit geo/Makefile.inc * DBDIR should point to absolute path for the db2 directory. * Create the subdirectory 'db2/bin/' (important!) and then create the file 'db2/bin/.htaccess' with the words 'Deny from all' * Check BINOWN and BINGRP to make sure they are the right user and group names (or use your own user/group name) Other includes flags (like -I/usr/local/include) should be checked to make sure they point to where things like libpng can be found. (b) Change into the 'geo' directory and run 'make', then 'make install'. The following programs should be compiled and instaled: - alt - generates altitude map images - elev - generates elevation cut-through diagrams - rf - translates between GPS and AGD coordinates - shift - translates coords according to a distortion grid - make-alt-qt - creates quadtree altitude data 5. Preprocess map data files This step creates a master index file called 'db2/lib/alt.desc' and one or more random-access binary altitude data files. The way this is done is to create a desc file and a binary file for each of the DEM tiles, and then hand-merge the desc files together to make the master 'alt.desc'. (a) Create the 'db2/lib' directory if needed. If you use a different directory, make sure you update 'db2/config-local.php'. Also create a file 'db2/lib/.htaccess' containing the words 'Deny from all'. (b) Unzip the national66.zip archive, rename and move the resulting GSB file into 'db2/lib/national66.gsb'. (c) Create the data and desc files for each DEM tile and put them in the db2/lib directory. Here is how I did it in db2/lib: ../bin/make-alt-qt /cdrom/sg56.grd sg56.data sg56.desc ../bin/make-alt-qt /cdrom/SH56_DEM.grd sh56.data sg56.desc (After doing this, the source files (*.grd) may be deleted). cat sg56.desc sh56.desc > alt.desc (After doing this, the source files (s[gh]56.desc) can be deleted). (d) Unzip the global map into db2/lib. This should create a directory called globalm (e) Check that you have a db2/lib directory with the following files: alt.desc national66.gsb sg56.data sh56.data globalm/ Check also that the file db2/config-local.php points to lib/national.gsb and also to lib/alt.desc. 6. Compile and install the topographic map tools Need to get these compiled and installed in db2/bin: * psplot * gdps Index: README =================================================================== RCS file: /cvsroot/meshdb/src/README,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -d -r1.1 -r1.1.2.1 --- README 22 Oct 2003 05:26:25 -0000 1.1 +++ README 7 Nov 2004 09:42:55 -0000 1.1.2.1 @@ -1,3 +1,6 @@ geo - surface elevation and altitude plotting/utils mailt - mail archive viewer for the web vpf - topographic map plotting (roads, cities, coastline etc) + +If you have obtained the source from CVS, you will need to run +'autoreconf --install' to build the configure script. |
From: <le...@pr...> - 2004-11-07 09:42:09
|
Update of /cvsroot/meshdb/src/geo/libgeo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3111/libgeo Modified Files: Tag: leonard-dev alt.c Log Message: no more defaults Index: alt.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/libgeo/alt.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- alt.c 24 Nov 2003 07:19:22 -0000 1.3 +++ alt.c 7 Nov 2004 09:41:12 -0000 1.3.2.1 @@ -43,9 +43,9 @@ int fd; if (shiftfile == NULL) - shiftfile = LIBPATH "QLD_0900.gsb"; + err(1, "no shiftfile given"); if (altfile == NULL) - altfile = LIBPATH "alt.desc"; + err(1, "no altfile given"); a->qt = qtopen(altfile, 0, NULL); |
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28180 Modified Files: Tag: leonard-dev config-local.php-dist elev.php gawd.php gps.php map2d.inc map3b.php util.php view.php vrml3b.php Log Message: use local config var $BINDIR to indicate executables Index: config-local.php-dist =================================================================== RCS file: /cvsroot/meshdb/www/db2/config-local.php-dist,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -d -r1.4 -r1.4.2.1 --- config-local.php-dist 27 Nov 2003 04:52:28 -0000 1.4 +++ config-local.php-dist 7 Nov 2004 05:50:06 -0000 1.4.2.1 @@ -22,6 +22,7 @@ $ZONE = 56; /* UTM zone (56 for Brisbane) */ $SHIFTFILE = "lib/QLD_0900.gsb";/* Shift file */ + $BINDIR = "./bin"; /* Binary directory for meshdb-bin */ $ALTFILE = "lib/alt.desc"; /* Altitude file */ ?> Index: elev.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/elev.php,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -d -r1.1.1.1 -r1.1.1.1.2.1 --- elev.php 10 Aug 2002 03:33:24 -0000 1.1.1.1 +++ elev.php 7 Nov 2004 05:50:06 -0000 1.1.1.1.2.1 @@ -21,7 +21,7 @@ header("Content-type: image/png"); /* if ($REQUEST_METHOD == "GET") */ - mypassthru("bin/elev" + mypassthru("$BINDIR/elev" ." -i -g ${w}x${h}" ." -z ${ZONE}" ." -S ${SHIFTFILE} -A ${ALTFILE}" Index: gawd.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/gawd.php,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- gawd.php 10 Aug 2002 11:42:39 -0000 1.3 +++ gawd.php 7 Nov 2004 05:50:06 -0000 1.3.2.1 @@ -32,8 +32,8 @@ global $SHIFTFILE, $ZONE; $E1 = doubleval($E); $N1 = doubleval($N); - $latlon = mybacktick("bin/rf -F \"%l %L\" -z $ZONE -g $E1 $N1 2>&1"); - $latlon = mybacktick("bin/shift -r -S ${SHIFTFILE} -- $latlon"); + $latlon = mybacktick("$BINDIR/rf -F \"%l %L\" -z $ZONE -g $E1 $N1 2>&1"); + $latlon = mybacktick("$BINDIR/shift -r -S ${SHIFTFILE} -- $latlon"); list($Lat,$Lon) = split(" ", $latlon, 2); $Lat = doubleval($Lat); $Lon = doubleval($Lon); Index: gps.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/gps.php,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -d -r1.3.2.1 -r1.3.2.2 --- gps.php 7 Nov 2004 05:38:28 -0000 1.3.2.1 +++ gps.php 7 Nov 2004 05:50:06 -0000 1.3.2.2 @@ -44,14 +44,14 @@ } function geo_to_grid($lat,$lon) { - return execnum("bin/rf" + return execnum("$BINDIR/rf" ." -F ".shquote("%e %n %z") ." -l ".shquote($lat)." ".shquote($lon) , 3); } function grid_to_geo($e,$n,$z) { - return execnum("bin/rf" + return execnum("$BINDIR/rf" ." -z ".shquote($z) ." -F ".shquote("%l %L") ." -g ".shquote($e)." ".shquote($n) @@ -62,7 +62,7 @@ global $SHIFTFILE; if ($reverse == -1) return array($lat, $lon); - return execnum("bin/shift" + return execnum("$BINDIR/shift" ." -S ${SHIFTFILE}" .($reverse ? " -r" : "") ." --" Index: map2d.inc =================================================================== RCS file: /cvsroot/meshdb/www/db2/map2d.inc,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -d -r1.4.2.1 -r1.4.2.2 --- map2d.inc 7 Nov 2004 05:38:45 -0000 1.4.2.1 +++ map2d.inc 7 Nov 2004 05:50:06 -0000 1.4.2.2 @@ -48,7 +48,7 @@ list($lat,$lon) = cvtlatlon($e,$n,$noshift=1); $sc = intval(2820/doubleval($s)); $url = "http://www.mapblast.com/myblastd/MakeMap.d?CT=${lat}:${lon}:${sc}&IC=&W=${w}&H=${h}&FAM=myblast&DU=KM&LB="; - $postproc = "| bin/giftopnm | bin/pnmtopng"; + $postproc = "| giftopnm | pnmtopng"; } else if ($src == "terra") { /* Terraserver */ $tle = intval($e-$s*$w/2); @@ -56,13 +56,13 @@ $bre = intval($tle+$s*$w); $brn = intval($tln-$s*$h); $url = "http://64.132.109.116/ecwimage/ecw_img.dll?image?ecw=/image_data/orbimage/Orbimage_Brisbane_Australia.ecw&sizex=${w}&sizey=${h}&worldtlx=${tle}&worldtly=${tln}&worldbrx=${bre}&worldbry=${brn}"; - $postproc = "| djpeg | bin/pnmscale -xysize ${w} ${h} | bin/pnmtopng"; + $postproc = "| djpeg | pnmscale -xysize ${w} ${h} | pnmtopng"; } else if ($src == "local") { /* Local map stuff */ list($lat,$lon) = cvtlatlon($e,$n); $sc = intval(1.0/doubleval($s)); - $cmd = "(./bin/psplot -g${w}x${h} -- $lat $lon $sc < templ.ps" - ."| ./bin/gdps -g${w}x${h} > $tmpfile ) 2>$errfile"; + $cmd = "($BINDIR/psplot -g${w}x${h} -- $lat $lon $sc < templ.ps" + ."| $BINDIR/gdps -g${w}x${h} > $tmpfile ) 2>$errfile"; /* $cmd = "(echo 'lat=$lat'; echo 'lon=$lon'; echo 'sc=$sc') >$errfile"; */ exec("ulimit -c 0; ulimit -t 120; ".$cmd); $url = false; Index: map3b.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/map3b.php,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -d -r1.4 -r1.4.2.1 --- map3b.php 9 May 2004 03:32:30 -0000 1.4 +++ map3b.php 7 Nov 2004 05:50:06 -0000 1.4.2.1 @@ -66,7 +66,7 @@ $c .= " -$x ".doubleval($row["e"])." ".doubleval($row["n"]); } -mypassthru("bin/alt" +mypassthru("$BINDIR/alt" ." -A ${ALTFILE} -S ${SHIFTFILE}" .($vrml ? " -v" : "") ." $c -- $e $n $w $h $s"); Index: util.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/util.php,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- util.php 16 Sep 2004 22:58:16 -0000 1.2 +++ util.php 7 Nov 2004 05:50:06 -0000 1.2.2.1 @@ -16,9 +16,9 @@ return array("",""); $E1 = doubleval($E); $N1 = doubleval($N); - $latlon = mybacktick("bin/rf -F \"%l %L\" -z $ZONE -g $E1 $N1 2>&1"); + $latlon = mybacktick("$BINDIR/rf -F \"%l %L\" -z $ZONE -g $E1 $N1 2>&1"); if (!$noshift) - $latlon = mybacktick("bin/shift -S ${SHIFTFILE} -- $latlon"); + $latlon = mybacktick("$BINDIR/shift -S ${SHIFTFILE} -- $latlon"); list($Lat,$Lon) = split(" ", $latlon, 2); $Lat = doubleval($Lat); $Lon = doubleval($Lon); @@ -31,8 +31,8 @@ return array("",""); $Lat = doubleval($Lat); $Lon = doubleval($Lon); - $latlon = mybacktick("bin/shift -r -S ${SHIFTFILE} -- $Lat $Lon"); - $enz = mybacktick("bin/rf -F \"%e %n %z\" -l $latlon 2>&1"); + $latlon = mybacktick("$BINDIR/shift -r -S ${SHIFTFILE} -- $Lat $Lon"); + $enz = mybacktick("$BINDIR/rf -F \"%e %n %z\" -l $latlon 2>&1"); list($E,$N,$Z) = split(" ", $enz, 3); if ($Z != $ZONE) die ("Lat/lon $Lat/$Lon is in zone $Z. should be in zone $ZONE"); Index: view.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/view.php,v retrieving revision 1.16.2.1 retrieving revision 1.16.2.2 diff -u -d -r1.16.2.1 -r1.16.2.2 --- view.php 7 Nov 2004 05:39:28 -0000 1.16.2.1 +++ view.php 7 Nov 2004 05:50:06 -0000 1.16.2.2 @@ -119,7 +119,7 @@ $h2 = doubleval($loc2["h"]); $info = split(" ", - mybacktick("bin/elev -z ${ZONE} -a $e1 $n1 $h1" + mybacktick("$BINDIR/elev -z ${ZONE} -a $e1 $n1 $h1" ." -b $e2 $n2 $h2")); $distance = $info[0]; @@ -296,7 +296,7 @@ $w=doubleval($w); $h=doubleval($h); $s=doubleval($s); - $altinfo = split(" ", mybacktick("bin/alt -t" + $altinfo = split(" ", mybacktick("$BINDIR/alt -t" ." -S ${SHIFTFILE} -A ${ALTFILE}" ." $e $n $w $h $s")); Index: vrml3b.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/vrml3b.php,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -d -r1.4 -r1.4.2.1 --- vrml3b.php 9 May 2004 03:32:30 -0000 1.4 +++ vrml3b.php 7 Nov 2004 05:50:06 -0000 1.4.2.1 @@ -63,7 +63,7 @@ } */ -mypassthru("bin/alt" +mypassthru("$BINDIR/alt" ." -A ${ALTFILE} -S ${SHIFTFILE}" ." -v" ." $c -- $e $n $w $h $s"); |
From: <le...@pr...> - 2004-11-07 05:46:47
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27534 Added Files: Tag: leonard-dev templ.ps Log Message: keep the postscript template here --- NEW FILE: templ.ps --- %!PS % $Id: templ.ps,v 1.1.2.1 2004/11/07 05:46:36 leonard Exp $ % David Leonard, 2002. Public domain. %-- copy the builtin operations as function objects rather than % wrap in a separate proc /l /lineto load def /m /moveto load def /s /stroke load def /f /fill load def /c /closepath load def /n /newpath load def /x /exch load def /r /rlineto load def %.ABBREV lineto=l moveto=m stroke=s fill=f closepath=c newpath=n %.DATABASE lib/globalm %.LIBRARY area %150 150 translate 0.5 0.5 scale % debug %-- clip to the viewing rectangle %%.SIZE %n 0 0 m dup 0 x r x 0 r 0 x neg r c clip %-- plot the sea area %.COVERAGE bnd %.FEATURE oceansea 0.678 0.847 0.902 setrgbcolor % light-blue %.PLOT %-- plot the land masses %.FEATURE polbnda 1 1 .7 setrgbcolor % yellow %.PLOT %-- plot the state boundaries (use=(23:intl, 26:state, 30:local)) %.IF scale < 12M %.COVERAGE bnd %.FEATURE polbndl 0.9 0.9 0.9 setrgbcolor % light-grey 3.0 setlinewidth %.PLOT use = 26 % (26=state) 1.0 0.9 0.9 setrgbcolor % light-pink %.PLOT use = 23 % (23=intl) %.ENDIF %.IF scale < 1M %-- plot some built-up areas %. COVERAGE pop %. FEATURE builtupa 0.83 0.83 0.83 setrgbcolor % light-grey %. PLOT %.ENDIF %.IF scale < 1.5M %-- plot some inland water %.COVERAGE hydro %.FEATURE inwatera 0.678 0.847 1 setrgbcolor % more-blue-than-light-blue %.PLOT hyc=8 %.FEATURE watrcrsl 0.3 setlinewidth 0.5 0.7 1 setrgbcolor %.PLOT hyc=8 %.ENDIF %.IF scale < 800k %-- plot the roads (rtt=(14:primary, 15:secondary, 16:fway) %. COVERAGE trans %. FEATURE railrdl 0.75 0.75 0.75 setrgbcolor % dark grey 0.4 setlinewidth %. PLOT %. FEATURE roadl 0.686 0.721 0.819 setrgbcolor % tan 2.0 setlinewidth %. PLOT rtt=16 % 'freeway' 1 0.8 0.8 setrgbcolor % red 1.0 setlinewidth %. PLOT rtt=15 % 'secondary route' %. IF scale < 400k .930 .871 .796 setrgbcolor % brown 1.0 setlinewidth %. PLOT rtt=14 % 'primary route' 0.2 setlinewidth 0.8 0.7 0.7 setrgbcolor % light grey %. PLOT rtt > 16 % 'other roads' %. ENDIF %.ENDIF %-- plot the coastlines %.IF scale < 15M %. COVERAGE bnd %. FEATURE coastl 0.5 setlinewidth 0.6 0.6 0.9 setrgbcolor % dark-blue %. PLOT %.ENDIF %%- show outline of database clip %%0.5 setlinewidth 0 0 0 setrgbcolor %%.WHOLEPATH %stroke showpage %-- draw the legend %.SIZE /h exch def /w exch def %.LEGEND 60 /legwidth exch def /segcount exch def /legstr exch def /segwidth legwidth segcount div def /legheight 8 def % height of legend /leginset 1 def % black inset around legend %-- draw legend outline (dark grey box) 0.6 setgray newpath w 0 moveto legwidth leginset 2 mul add neg 0 rlineto 0 legheight leginset 2 mul add rlineto legwidth leginset 2 mul add 0 rlineto closepath fill %-- draw grey/white segments 1 1 segcount { dup 2 mod 0 eq { 1.0 } { 0.9 } ifelse setgray newpath segwidth mul w exch sub leginset sub leginset moveto segwidth 0 rlineto 0 legheight rlineto segwidth neg 0 rlineto closepath fill } for %-- draw the legend dimension centred 0 setgray /Helvetica findfont legheight scalefont setfont legstr stringwidth pop 2 div legwidth 2 div add leginset add w exch sub leginset legheight 0.15 mul add moveto legstr show showpage |
From: <le...@pr...> - 2004-11-07 05:39:39
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26229 Modified Files: Tag: leonard-dev view.php Log Message: use _GET Index: view.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/view.php,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -d -r1.16 -r1.16.2.1 --- view.php 28 Jul 2004 07:28:53 -0000 1.16 +++ view.php 7 Nov 2004 05:39:28 -0000 1.16.2.1 @@ -9,6 +9,9 @@ $EDITONLY = 0; + + if (isset($_GET["nodeid"])) + $nodeid = $_GET["nodeid"]; if ($nodeid == "") die("no nodeid"); |
From: <le...@pr...> - 2004-11-07 05:39:14
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26137 Modified Files: Tag: leonard-dev submit.php Log Message: use _SERVER Index: submit.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/submit.php,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -u -d -r1.14 -r1.14.2.1 --- submit.php 18 Sep 2004 06:08:11 -0000 1.14 +++ submit.php 7 Nov 2004 05:39:03 -0000 1.14.2.1 @@ -492,7 +492,7 @@ /* return to the index */ if (!isset($location)) - $location = "http://".$HTTP_HOST.dirname($PHP_SELF)."/"; + $location = "http://".$_SERVER["HTTP_HOST"].dirname($_SERVER["PHP_SELF"])."/"; } |
From: <le...@pr...> - 2004-11-07 05:38:56
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26086 Modified Files: Tag: leonard-dev map2d.inc Added Files: templ.ps Log Message: use templ.ps in local directory --- NEW FILE: templ.ps --- %!PS % $Id: templ.ps,v 1.1 2004/11/07 05:38:45 leonard Exp $ % David Leonard, 2002. Public domain. %-- copy the builtin operations as function objects rather than % wrap in a separate proc /l /lineto load def /m /moveto load def /s /stroke load def /f /fill load def /c /closepath load def /n /newpath load def /x /exch load def /r /rlineto load def %.ABBREV lineto=l moveto=m stroke=s fill=f closepath=c newpath=n %.DATABASE lib/globalm %.LIBRARY area %150 150 translate 0.5 0.5 scale % debug %-- clip to the viewing rectangle %%.SIZE %n 0 0 m dup 0 x r x 0 r 0 x neg r c clip %-- plot the sea area %.COVERAGE bnd %.FEATURE oceansea 0.678 0.847 0.902 setrgbcolor % light-blue %.PLOT %-- plot the land masses %.FEATURE polbnda 1 1 .7 setrgbcolor % yellow %.PLOT %-- plot the state boundaries (use=(23:intl, 26:state, 30:local)) %.IF scale < 12M %.COVERAGE bnd %.FEATURE polbndl 0.9 0.9 0.9 setrgbcolor % light-grey 3.0 setlinewidth %.PLOT use = 26 % (26=state) 1.0 0.9 0.9 setrgbcolor % light-pink %.PLOT use = 23 % (23=intl) %.ENDIF %.IF scale < 1M %-- plot some built-up areas %. COVERAGE pop %. FEATURE builtupa 0.83 0.83 0.83 setrgbcolor % light-grey %. PLOT %.ENDIF %.IF scale < 1.5M %-- plot some inland water %.COVERAGE hydro %.FEATURE inwatera 0.678 0.847 1 setrgbcolor % more-blue-than-light-blue %.PLOT hyc=8 %.FEATURE watrcrsl 0.3 setlinewidth 0.5 0.7 1 setrgbcolor %.PLOT hyc=8 %.ENDIF %.IF scale < 800k %-- plot the roads (rtt=(14:primary, 15:secondary, 16:fway) %. COVERAGE trans %. FEATURE railrdl 0.75 0.75 0.75 setrgbcolor % dark grey 0.4 setlinewidth %. PLOT %. FEATURE roadl 0.686 0.721 0.819 setrgbcolor % tan 2.0 setlinewidth %. PLOT rtt=16 % 'freeway' 1 0.8 0.8 setrgbcolor % red 1.0 setlinewidth %. PLOT rtt=15 % 'secondary route' %. IF scale < 400k .930 .871 .796 setrgbcolor % brown 1.0 setlinewidth %. PLOT rtt=14 % 'primary route' 0.2 setlinewidth 0.8 0.7 0.7 setrgbcolor % light grey %. PLOT rtt > 16 % 'other roads' %. ENDIF %.ENDIF %-- plot the coastlines %.IF scale < 15M %. COVERAGE bnd %. FEATURE coastl 0.5 setlinewidth 0.6 0.6 0.9 setrgbcolor % dark-blue %. PLOT %.ENDIF %%- show outline of database clip %%0.5 setlinewidth 0 0 0 setrgbcolor %%.WHOLEPATH %stroke showpage %-- draw the legend %.SIZE /h exch def /w exch def %.LEGEND 60 /legwidth exch def /segcount exch def /legstr exch def /segwidth legwidth segcount div def /legheight 8 def % height of legend /leginset 1 def % black inset around legend %-- draw legend outline (dark grey box) 0.6 setgray newpath w 0 moveto legwidth leginset 2 mul add neg 0 rlineto 0 legheight leginset 2 mul add rlineto legwidth leginset 2 mul add 0 rlineto closepath fill %-- draw grey/white segments 1 1 segcount { dup 2 mod 0 eq { 1.0 } { 0.9 } ifelse setgray newpath segwidth mul w exch sub leginset sub leginset moveto segwidth 0 rlineto 0 legheight rlineto segwidth neg 0 rlineto closepath fill } for %-- draw the legend dimension centred 0 setgray /Helvetica findfont legheight scalefont setfont legstr stringwidth pop 2 div legwidth 2 div add leginset add w exch sub leginset legheight 0.15 mul add moveto legstr show showpage Index: map2d.inc =================================================================== RCS file: /cvsroot/meshdb/www/db2/map2d.inc,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -d -r1.4 -r1.4.2.1 --- map2d.inc 16 Sep 2004 22:59:23 -0000 1.4 +++ map2d.inc 7 Nov 2004 05:38:45 -0000 1.4.2.1 @@ -61,7 +61,7 @@ /* Local map stuff */ list($lat,$lon) = cvtlatlon($e,$n); $sc = intval(1.0/doubleval($s)); - $cmd = "(cd ../mapdata && ./bin/psplot -g${w}x${h} -- $lat $lon $sc < templ.ps" + $cmd = "(./bin/psplot -g${w}x${h} -- $lat $lon $sc < templ.ps" ."| ./bin/gdps -g${w}x${h} > $tmpfile ) 2>$errfile"; /* $cmd = "(echo 'lat=$lat'; echo 'lon=$lon'; echo 'sc=$sc') >$errfile"; */ exec("ulimit -c 0; ulimit -t 120; ".$cmd); |
From: <le...@pr...> - 2004-11-07 05:38:38
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26036 Modified Files: Tag: leonard-dev gps.php Log Message: use _POST. earlier doublevals Index: gps.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/gps.php,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- gps.php 2 Nov 2003 02:07:00 -0000 1.3 +++ gps.php 7 Nov 2004 05:38:28 -0000 1.3.2.1 @@ -71,24 +71,30 @@ , 2); } - if ($togrid == $TOGRID) { + if ($_POST["togrid"] == $TOGRID) { + $lat = doubleval($_POST["lat"]); + $lon = doubleval($_POST["lon"]); + $llsystem = $_POST["llsystem"]; /* Convert from GPS lat/long to UBD eastings/northings */ - if (doubleval($lat) > 85 || doubleval($lat) < -85) + if ($lat > 85 || $lat < -85) echo "<p><strong>Warning: latitude value out of range</strong></p>"; - if (doubleval($lon) > 180 || doubleval($lat) < -180) + if ($lon > 180 || $lat < -180) echo "<p><strong>Warning: longitude value out of range</strong></p>"; /* Convert from GRS80 to ANS if needed */ if ($llsystem == "grs80") - $ll = ans_to_grs80(doubleval($lat), doubleval($lon), 1); + $ll = ans_to_grs80($lat, $lon, 1); else $ll = array($lat, $lon); /* Convert from lat/lon to grid */ list($e,$n,$zone) = geo_to_grid($ll[0], $ll[1]); } - if ($togrid == $FROMGRID) { + if ($_POST["togrid"] == $FROMGRID) { /* Convert from grid to lat/lon */ - $ll = grid_to_geo(doubleval($e), - doubleval($n), doubleval($zone)); + $e = doubleval($_POST["e"]); + $n = doubleval($_POST["n"]); + $zone = intval($_POST["zone"]); + $ll = grid_to_geo($e, + $n, $zone); /* Convert from ANS to GRS80 if needed */ if ($llsystem == "grs80") list($lat,$lon) = ans_to_grs80($ll[0], $ll[1], 0); |
From: <le...@pr...> - 2004-11-07 05:32:25
|
Update of /cvsroot/meshdb/src/geo/libgeo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25015 Modified Files: Tag: leonard-dev ntv2.c Log Message: debugging & clearer conditional stmt Index: ntv2.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/libgeo/ntv2.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -d -r1.4 -r1.4.2.1 --- ntv2.c 3 Nov 2004 11:54:02 -0000 1.4 +++ ntv2.c 7 Nov 2004 05:32:15 -0000 1.4.2.1 @@ -25,10 +25,12 @@ /* XXX - these currently assume little endian */ #if defined(__i386__) +/* For big endian (like i386) */ #define HOSTFLOAT(f) (f) #define HOSTINT(i) (i) #define HOSTDOUBLE(d) (d) #else +/* For little endian (like sparc) */ #define HOSTFLOAT(f) swap4f(f) #define HOSTINT(i) swap4i(i) #define HOSTDOUBLE(d) swap8d(d) @@ -368,18 +370,21 @@ if (g->sibling && lookup(nt, g->sibling, lat, lon, result) == 0) return 0; - if (lat < g->s_lat || lat > g->n_lat) - return -1; - if (lon < g->e_lon || lon > g->w_lon) + if (!( g->s_lat < lat && lat < g->n_lat && + g->e_lon < lon && lon < g->w_lon )) return -1; if (g->firstchild && lookup(nt, g->firstchild, lat, lon, result) == 0) return 0; + Vprintf("* (%f, %f) is in grid %.8s\n", lat, lon, g->name); + /* Calculate the node coordinates within the subgrid */ x = (lon - g->e_lon) / g->lon_inc; y = (lat - g->s_lat) / g->lat_inc; + Vprintf("* using virtual node (%f, %f)\n", x, y); + /* Determine which 4 nodes around the give point to use (may be same) */ xlo = (int)floorf(x); ylo = (int)floorf(y); @@ -390,6 +395,12 @@ c = &g->nodes[xlo + yhi * g->w]; d = &g->nodes[xhi + yhi * g->w]; + Vprintf("* first approx delta=(%f, %f) +-(%f,%f) rad\n", + HOSTFLOAT(a->lat_shift) * nt->gs_scale, + HOSTFLOAT(a->lon_shift) * nt->gs_scale, + HOSTFLOAT(a->lat_shift_acc) * nt->gs_scale, + HOSTFLOAT(a->lon_shift_acc) * nt->gs_scale); + /* Perform bilinear interpolation of the four nodes */ xo = x - xlo; yo = y - ylo; @@ -406,6 +417,12 @@ HOSTFLOAT(b->lon_shift_acc), HOSTFLOAT(c->lon_shift_acc), HOSTFLOAT(d->lon_shift_acc), xo, yo) * nt->gs_scale; + Vprintf("* result = shift:(%f, %f) acc:(%f, %f)\n", + result->lat_shift, + result->lon_shift, + result->lat_shift_acc, + result->lon_shift_acc); + return 0; } @@ -419,5 +436,6 @@ double lat, lon; /* longitude is positive east */ struct ntv2_shift *result; { + Vprintf("* looking for (%f, %f)\n", lat, -lon); return lookup(nt, nt->root, lat, -lon, result); } |
From: <le...@pr...> - 2004-11-07 00:47:57
|
Update of /cvsroot/meshdb/src/vpf/libvpf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2883/vpf/libvpf Modified Files: Tag: leonard-dev Makefile.common Log Message: add no-op install target Index: Makefile.common =================================================================== RCS file: /cvsroot/meshdb/src/vpf/libvpf/Makefile.common,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -d -r1.1 -r1.1.2.1 --- Makefile.common 15 Sep 2002 13:55:42 -0000 1.1 +++ Makefile.common 7 Nov 2004 00:47:35 -0000 1.1.2.1 @@ -6,3 +6,5 @@ LDADD= -lm NOPIC= +install: + @echo no install needed |
From: <le...@pr...> - 2004-11-07 00:47:30
|
Update of /cvsroot/meshdb/src/vpf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2797/vpf Modified Files: Tag: leonard-dev Makefile.common Log Message: add gdps directory Index: Makefile.common =================================================================== RCS file: /cvsroot/meshdb/src/vpf/Makefile.common,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -d -r1.1 -r1.1.2.1 --- Makefile.common 15 Sep 2002 13:55:42 -0000 1.1 +++ Makefile.common 7 Nov 2004 00:47:06 -0000 1.1.2.1 @@ -1 +1 @@ -SUBDIR= libvpf dump psplot +SUBDIR= libvpf gdps dump psplot |
From: <le...@pr...> - 2004-11-07 00:47:01
|
Update of /cvsroot/meshdb/src/geo/shift In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2699/geo/shift Modified Files: Tag: leonard-dev main.c Log Message: possible fix to convergence bug Index: main.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/shift/main.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- main.c 24 Nov 2003 07:04:51 -0000 1.2 +++ main.c 7 Nov 2004 00:46:51 -0000 1.2.2.1 @@ -112,11 +112,19 @@ result.lon_shift = 0; break; } - if (abs(lat+result.lat_shift-olat)<result.lat_shift_acc - && abs(lon+result.lon_shift-olon)<result.lon_shift_acc) + if (abs(lat+result.lat_shift-olat)<abs(result.lat_shift_acc) + && abs(lon+result.lon_shift-olon)<abs(result.lon_shift_acc)) break; + + if (verbose) { + fprintf(stderr, "converged one step:\n"); + fprintf(stderr, " lat: old=%f shift=%f acc=%f -> %f\n", lat, result.lat_shift, result.lat_shift_acc, olat - result.lat_shift); + fprintf(stderr, " lon: old=%f shift=%f acc=%f -> %f\n", lon, result.lon_shift, result.lon_shift_acc, olon - result.lon_shift); + } + lat = olat - result.lat_shift; lon = olon - result.lon_shift; + } if (i == 5) errx(1, "reverse algorithm didn't converge"); |
From: <il...@pr...> - 2004-11-03 12:06:36
|
Update of /cvsroot/meshdb/src/geo/libgeo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23056/src/geo/libgeo Modified Files: spread.c Log Message: Fixed comment tyop. Index: spread.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/libgeo/spread.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- spread.c 24 Nov 2003 07:04:49 -0000 1.2 +++ spread.c 3 Nov 2004 12:06:25 -0000 1.3 @@ -1,5 +1,5 @@ /* - * Compute partial index tables for accelating quadtree file access. + * Compute partial index tables for accelerating quadtree file access. * Nelson's order is assumed. * * David Leonard, 2001. Public domain. |
From: <il...@pr...> - 2004-11-03 12:00:06
|
Update of /cvsroot/meshdb/src/geo/libgeo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21766/src/geo/libgeo Modified Files: qt.c Log Message: Fixed comment tyops. Index: qt.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/libgeo/qt.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- qt.c 24 Nov 2003 07:04:49 -0000 1.3 +++ qt.c 3 Nov 2004 11:59:56 -0000 1.4 @@ -61,7 +61,7 @@ if (yip) *yip = (y - q->yll) / q->cellsz; } -/* Retreive one pixel from the quadree raster file */ +/* Retreive one pixel from the quadtree raster file */ void * qtgetpoint_bycoord(q, x, y) struct qt *q; @@ -271,7 +271,7 @@ if ((desc = fopen(descname, "r")) == NULL) err(1, "%s", descname); if (datadir == NULL) { - strcpy(path, descname); /* dirname() may motify argument */ + strcpy(path, descname); /* dirname() may modify argument */ datadir = dirname(path); } qt = qtopenf(desc, forwrite, datadir); |
From: <il...@pr...> - 2004-11-03 11:54:11
|
Update of /cvsroot/meshdb/src/geo/libgeo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20986/src/geo/libgeo Modified Files: ntv2.c Log Message: Read little-endian data as-is (no byte swapping) on x86 machines. It would be nice to test for this properly (autoconf or whatever), but this is better than nothing for now. Index: ntv2.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/libgeo/ntv2.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ntv2.c 24 Nov 2003 07:04:49 -0000 1.3 +++ ntv2.c 3 Nov 2004 11:54:02 -0000 1.4 @@ -24,7 +24,7 @@ /* XXX - these currently assume little endian */ -#if 0 +#if defined(__i386__) #define HOSTFLOAT(f) (f) #define HOSTINT(i) (i) #define HOSTDOUBLE(d) (d) |
From: <il...@pr...> - 2004-11-03 11:52:08
|
Update of /cvsroot/meshdb/src/geo/elev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20668/src/geo/elev Modified Files: elev.c Log Message: Avoid a warning about using a type of undefined signedness as an array index. Index: elev.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/elev/elev.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- elev.c 18 Mar 2004 10:47:56 -0000 1.6 +++ elev.c 3 Nov 2004 11:51:56 -0000 1.7 @@ -74,7 +74,7 @@ int error = 0; int ch; int aset = 0, bset = 0; - char *img; + unsigned char *img; float *alth; double *surfh; float altmin, altmax; |
From: <ma...@pr...> - 2004-09-20 15:00:47
|
Update of /cvsroot/meshdb/www/ipdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21407 Added Files: adduser.php admin.php deluser.php edituser.php logout.php Log Message: allow "admin" users to add/edit/remove users --- NEW FILE: adduser.php --- <?php require_once('include/globals.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $HTTP_SERVER_VARS['PHP_SELF']; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING']; } if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "addUser")) { $insertSQL = sprintf("INSERT INTO auth (fullName, userid, password) VALUES (%s, %s, %s)", GetSQLValueString($HTTP_POST_VARS['fullName'], "text"), GetSQLValueString($HTTP_POST_VARS['username'], "text"), GetSQLValueString($HTTP_POST_VARS['password'], "text")); mysql_select_db($database_meship, $meship); $Result1 = mysql_query($insertSQL, $meship) or die(mysql_error()); $insertGoTo = "admin.php"; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } ?> <?php include_once("include/globals.php"); ?> <?php auth_check("admin"); ?> <html><!-- InstanceBegin template="/Templates/default.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- InstanceEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="css/style.css" rel="stylesheet" type="text/css"> <link rel="SHORTCUT ICON" href="images/mesh-favico.ico"> <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable --> </head> <body> <table width="100%" border="1" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <tr> <td width="203" bgcolor="#FFFFFF"> <div align="center"><img src="images/mesh-small.gif" width="137" height="86"></div></td> <!-- InstanceBeginEditable name="banner" --> <td width="479" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <h1>Add New User</h1></td> <!-- InstanceEndEditable --> </tr> <tr> <td width="203" valign="top" nowrap bordercolor="#0099FF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">Client IP: <?php echo getServerVariable("REMOTE_ADDR"); ?></font></div></td> <td valign="top" nowrap bordercolor="#0099FF" bgcolor="#0099FF"> <div align="right"> <?php if (issetSessionVariable("username")) { ?> <font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">Logged in as <strong><?php echo getSessionVariable("username"); ?></strong> <a href="logout.php">[log out] </a></font> <?php } else { ?> <font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">Logged in as <strong>nobody</strong> <a href="login.php">[log in]</a></font> <?php } ?> </div> </td> </tr> <tr> <td width="203" valign="top" bgcolor="#FFFFFF"> <div align="center"> <table width="80%" border="0" cellpadding="2" cellspacing="2" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="index.php">Home</a></font></div></td> </tr> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="zones.php">Browse</a></font></div></td> </tr> <?php if (issetSessionVariable("username") && isUserInRole(getSessionVariable("username"), "admin")) { ?> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="admin.php">Administration</a></font></div></td> </tr> <?php } ?> <?php if (issetSessionVariable("username")) { ?> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="logout.php">Logout</a></font></div></td> </tr> <?php } else { ?> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="login.php">Log In</a></font></div></td> </tr> <?php } ?> </table> </div></td> <!-- InstanceBeginEditable name="body" --> <td valign="top" bordercolor="#FFFFFF" bgcolor="#FFFFFF"><p> </p> <form name="addUser" method="POST" action="<?php echo $editFormAction; ?>"> <table border="1"> <tr> <td>User Name</td> <td width="73%"><input type="text" name="username"></td> </tr> <tr> <td>Full Name</td> <td><input type="text" name="fullName"></td> </tr> <tr> <td>Password</td> <td><input name="password" type="password" id="password"></td> </tr> <tr> <td>Password (verify)</td> <td><input name="passwordAgain" type="password" id="passwordAgain"></td> </tr> <tr> <td> </td> <td colspan="2"> </td> </tr> <tr> <td>Permissions</td> <td colspan="2"><table border="1"> <tr> <td width="28%" nowrap> <p> <input name="zoneAdmin" type="checkbox" id="zoneAdmin" value="checkbox"> Zone Admin<br> </p></td> <td width="25%" nowrap> <p> <label> <input type="radio" name="zoneAll" value="radio"> All</label> <br> <label> <input type="radio" name="zoneSpecific" value="radio"> Zones --></label> <br> </p></td> <td width="20%" valign="bottom" nowrap> <input name="zoneList" type="text" id="zoneList" size="8"> </td> </tr> <tr> <td nowrap> <input name="podAdmin" type="checkbox" id="podAdmin" value="checkbox"> Pod Admin</td> <td nowrap> <label> <input type="radio" name="podAll" value="radio"> All</label> <br> <label> <input type="radio" name="podSpecific" value="radio"> Pods --></label> </td> <td valign="bottom" nowrap> <input name="podList" type="text" id="podList" size="8"> </td> </tr> <tr> <td nowrap> <input name="nodeAdmin" type="checkbox" id="nodeAdmin" value="checkbox"> Node Admin</td> <td nowrap> <label> <input type="radio" name="nodeAll" value="radio"> All</label> <br> <label> <input type="radio" name="nodeSpecific" value="radio"> Nodes --></label></td> <td valign="bottom" nowrap> <input name="nodeList2" type="text" id="nodeList2" size="8"> </td> </tr> <tr> <td nowrap> </td> <td nowrap> </td> <td nowrap> </td> </tr> </table></td> </tr> <tr> <td> </td> <td colspan="2"> </td> </tr> <tr> <td> </td> <td colspan="2"><input name="addUser2" type="submit" id="addUser23" value="Add User"></td> </tr> </table> <input type="hidden" name="MM_insert" value="addUser"> </form> <p> </p> <p> </p> <p> </p></td> <!-- InstanceEndEditable --> </tr> </table> </body> <!-- InstanceEnd --></html> --- NEW FILE: admin.php --- <?php include_once("include/globals.php"); ?> <?php auth_check("admin"); ?> <?php $currentPage = $HTTP_SERVER_VARS["PHP_SELF"]; $maxRows_admin = 10; $pageNum_admin = 0; if (isset($HTTP_GET_VARS['pageNum_admin'])) { $pageNum_admin = $HTTP_GET_VARS['pageNum_admin']; } $startRow_admin = $pageNum_admin * $maxRows_admin; mysql_select_db($database_meship, $meship); $query_admin = "SELECT * FROM auth"; $query_limit_admin = sprintf("%s LIMIT %d, %d", $query_admin, $startRow_admin, $maxRows_admin); $admin = mysql_query($query_limit_admin, $meship) or die(mysql_error()); $row_admin = mysql_fetch_assoc($admin); if (isset($HTTP_GET_VARS['totalRows_admin'])) { $totalRows_admin = $HTTP_GET_VARS['totalRows_admin']; } else { $all_admin = mysql_query($query_admin); $totalRows_admin = mysql_num_rows($all_admin); } $totalPages_admin = ceil($totalRows_admin/$maxRows_admin)-1; $queryString_admin = ""; if (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) { $params = explode("&", $HTTP_SERVER_VARS['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_admin") == false && stristr($param, "totalRows_admin") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_admin = "&" . implode("&", $newParams); } } $queryString_admin = sprintf("&totalRows_admin=%d%s", $totalRows_admin, $queryString_admin); ?> <html><!-- InstanceBegin template="/Templates/default.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- InstanceEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="css/style.css" rel="stylesheet" type="text/css"> <link rel="SHORTCUT ICON" href="images/mesh-favico.ico"> <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable --> </head> <body> <table width="100%" border="1" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <tr> <td width="203" bgcolor="#FFFFFF"> <div align="center"><img src="images/mesh-small.gif" width="137" height="86"></div></td> <!-- InstanceBeginEditable name="banner" --> <td width="479" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <h1>User Administation</h1></td> <!-- InstanceEndEditable --> </tr> <tr> <td width="203" valign="top" nowrap bordercolor="#0099FF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">Client IP: <?php echo getServerVariable("REMOTE_ADDR"); ?></font></div></td> <td valign="top" nowrap bordercolor="#0099FF" bgcolor="#0099FF"> <div align="right"> <?php if (issetSessionVariable("username")) { ?> <font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">Logged in as <strong><?php echo getSessionVariable("username"); ?></strong> <a href="logout.php">[log out] </a></font> <?php } else { ?> <font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">Logged in as <strong>nobody</strong> <a href="login.php">[log in]</a></font> <?php } ?> </div> </td> </tr> <tr> <td width="203" valign="top" bgcolor="#FFFFFF"> <div align="center"> <table width="80%" border="0" cellpadding="2" cellspacing="2" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="index.php">Home</a></font></div></td> </tr> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="zones.php">Browse</a></font></div></td> </tr> <?php if (issetSessionVariable("username") && isUserInRole(getSessionVariable("username"), "admin")) { ?> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="admin.php">Administration</a></font></div></td> </tr> <?php } ?> <?php if (issetSessionVariable("username")) { ?> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="logout.php">Logout</a></font></div></td> </tr> <?php } else { ?> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="login.php">Log In</a></font></div></td> </tr> <?php } ?> </table> </div></td> <!-- InstanceBeginEditable name="body" --> <td valign="top" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <BR> <table width="100%" border="1"> <tr> <td width="29%">UserId</td> <td width="61%">User Name</td> <td width="5%">Edit</td> <td width="5%">Delete</td> </tr> <?php do { ?> <tr> <td><?php echo $row_admin['userid']; ?></td> <td><?php echo $row_admin['fullName']; ?></td> <td> <form name="editForm" method="get" action="edituser.php"> <input type="hidden" name="authid" value="<?php echo $row_admin['authid']; ?>"> <input name="mode" type="submit" id="mode" value="Edit"> </form></td> <td><form name="deleteForm" method="get" action="deluser.php"> <input type="hidden" name="authid" value="<?php echo $row_admin['authid']; ?>"> <input name="mode" type="submit" id="mode" value="Delete"> </form></td> </tr> <?php } while ($row_admin = mysql_fetch_assoc($admin)); ?> </table><BR> <table width="100%" border="0"> <tr> <td><a href="<?php printf("%s?pageNum_admin=%d%s", $currentPage, max(0, $pageNum_admin - 1), $queryString_admin); ?>">< Previous 10</a></td> <td><div align="right"><a href="<?php printf("%s?pageNum_admin=%d%s", $currentPage, min($totalPages_admin, $pageNum_admin + 1), $queryString_admin); ?>">> Next 10</a></div></td> </tr> </table> <p><a href="adduser.php">Add New User</a></p></td> <!-- InstanceEndEditable --> </tr> </table> </body> <!-- InstanceEnd --></html> <?php mysql_free_result($admin); ?> --- NEW FILE: deluser.php --- <?php require_once('include/globals.php'); ?> <?php if (getServerVariable("REQUEST_METHOD") == "POST" && getRequestVariable("authid") != "") { $deleteSQL = sprintf("DELETE FROM auth WHERE authid = %s", getRequestVariable("authid")); mysql_select_db($database_meship, $meship); mysql_query($deleteSQL, $meship) or die("'" . $deleteSQL . "'" . "-" . mysql_error()); header("Location: http://" . getServerVariable("HTTP_HOST") . dirname(getServerVariable("PHP_SELF")) . "/admin.php"); die; } if (getServerVariable("REQUEST_METHOD") == "GET" && getRequestVariable("authid") != "") { mysql_select_db($database_meship, $meship); $queryShowUser = sprintf("SELECT * FROM auth WHERE authid = %s", getRequestVariable("authid")); $showUser = mysql_query($queryShowUser, $meship) or die(mysql_error()); $rowShowUser = mysql_fetch_assoc($showUser); } ?> <html><!-- InstanceBegin template="/Templates/default.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- InstanceEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="css/style.css" rel="stylesheet" type="text/css"> <link rel="SHORTCUT ICON" href="images/mesh-favico.ico"> <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable --> </head> <body> <table width="100%" border="1" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <tr> <td width="203" bgcolor="#FFFFFF"> <div align="center"><img src="images/mesh-small.gif" width="137" height="86"></div></td> <!-- InstanceBeginEditable name="banner" --> <td width="479" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> </td> <!-- InstanceEndEditable --> </tr> <tr> <td width="203" valign="top" nowrap bordercolor="#0099FF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">Client IP: <?php echo getServerVariable("REMOTE_ADDR"); ?></font></div></td> <td valign="top" nowrap bordercolor="#0099FF" bgcolor="#0099FF"> <div align="right"> <?php if (issetSessionVariable("username")) { ?> <font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">Logged in as <strong><?php echo getSessionVariable("username"); ?></strong> <a href="logout.php">[log out] </a></font> <?php } else { ?> <font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">Logged in as <strong>nobody</strong> <a href="login.php">[log in]</a></font> <?php } ?> </div> </td> </tr> <tr> <td width="203" valign="top" bgcolor="#FFFFFF"> <div align="center"> <table width="80%" border="0" cellpadding="2" cellspacing="2" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="index.php">Home</a></font></div></td> </tr> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="zones.php">Browse</a></font></div></td> </tr> <?php if (issetSessionVariable("username") && isUserInRole(getSessionVariable("username"), "admin")) { ?> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="admin.php">Administration</a></font></div></td> </tr> <?php } ?> <?php if (issetSessionVariable("username")) { ?> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="logout.php">Logout</a></font></div></td> </tr> <?php } else { ?> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="login.php">Log In</a></font></div></td> </tr> <?php } ?> </table> </div></td> <!-- InstanceBeginEditable name="body" --> <td valign="top" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <p> </p> <h2>Delete User</h2> <table border="1"> <tr> <td nowrap>Username</td> <td><?php echo $rowShowUser['userid']; ?></td> </tr> <tr> <td nowrap>Full Name</td> <td><?php echo $rowShowUser['fullName']; ?></td> </tr> </table> <p>Is this the user you wish to delete ?</p> <form name="deleteUser" method="post" action="deluser.php"> <input type="submit" name="Submit" value="Submit"> <input type="hidden" name="authid" value="<?php echo $rowShowUser['authid'] ?>"> </form> <p> </p></td> <!-- InstanceEndEditable --> </tr> </table> </body> <!-- InstanceEnd --></html> <?php mysql_free_result($showUser); ?> --- NEW FILE: edituser.php --- <?php require_once('include/globals.php'); ?> <?php $editFormAction = getServerVariable("PHP_SELF"); if ((isset($HTTP_POST_VARS["MM_update"])) && ($HTTP_POST_VARS["MM_update"] == "editUser")) { $updateSQL = sprintf("UPDATE auth SET fullName='%s', userid='%s' WHERE authid=%s", getRequestVariable("fullName"), getRequestVariable("username"), getRequestVariable("authid")); mysql_select_db($database_meship, $meship); mysql_query($updateSQL, $meship) or die(mysql_error()); header("Location: http://" . getServerVariable("HTTP_HOST") . dirname(getServerVariable("PHP_SELF")) . "/admin.php"); } $colname_userEdit = "1"; if (isset($HTTP_GET_VARS['authid'])) { $colname_userEdit = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['authid'] : addslashes($HTTP_GET_VARS['authid']); } mysql_select_db($database_meship, $meship); $query_userEdit = sprintf("SELECT * FROM auth WHERE authid = %s", $colname_userEdit); $userEdit = mysql_query($query_userEdit, $meship) or die(mysql_error()); $row_userEdit = mysql_fetch_assoc($userEdit); $totalRows_userEdit = mysql_num_rows($userEdit); ?> <?php include_once("include/globals.php"); ?> <html><!-- InstanceBegin template="/Templates/default.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- InstanceEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="css/style.css" rel="stylesheet" type="text/css"> <link rel="SHORTCUT ICON" href="images/mesh-favico.ico"> <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable --> </head> <body> <table width="100%" border="1" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <tr> <td width="203" bgcolor="#FFFFFF"> <div align="center"><img src="images/mesh-small.gif" width="137" height="86"></div></td> <!-- InstanceBeginEditable name="banner" --> <td width="479" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> </td> <!-- InstanceEndEditable --> </tr> <tr> <td width="203" valign="top" nowrap bordercolor="#0099FF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">Client IP: <?php echo getServerVariable("REMOTE_ADDR"); ?></font></div></td> <td valign="top" nowrap bordercolor="#0099FF" bgcolor="#0099FF"> <div align="right"> <?php if (issetSessionVariable("username")) { ?> <font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">Logged in as <strong><?php echo getSessionVariable("username"); ?></strong> <a href="logout.php">[log out] </a></font> <?php } else { ?> <font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">Logged in as <strong>nobody</strong> <a href="login.php">[log in]</a></font> <?php } ?> </div> </td> </tr> <tr> <td width="203" valign="top" bgcolor="#FFFFFF"> <div align="center"> <table width="80%" border="0" cellpadding="2" cellspacing="2" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="index.php">Home</a></font></div></td> </tr> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="zones.php">Browse</a></font></div></td> </tr> <?php if (issetSessionVariable("username") && isUserInRole(getSessionVariable("username"), "admin")) { ?> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="admin.php">Administration</a></font></div></td> </tr> <?php } ?> <?php if (issetSessionVariable("username")) { ?> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="logout.php">Logout</a></font></div></td> </tr> <?php } else { ?> <tr> <td nowrap bordercolor="#FFFFFF" bgcolor="#0099FF"> <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><a href="login.php">Log In</a></font></div></td> </tr> <?php } ?> </table> </div></td> <!-- InstanceBeginEditable name="body" --> <td valign="top" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <p> </p> <form action="<?php echo $editFormAction; ?>" method="POST" name="editUser" id="editUser"> <h2>Edit User</h2> <table width="214" height="102" border="1"> <tr> <td nowrap>Username</td> <td> <input value="<?php echo $row_userEdit['userid']; ?>" name="username" type="text" id="username"></td> </tr> <tr> <td nowrap>Full Name</td> <td> <input value="<?php echo $row_userEdit['fullName']; ?>" name="fullName" type="text" id="fullName"></td> </tr> <tr> <td nowrap>Node ID</td> <td> <input name="nodeId" type="text" id="nodeId" size="4"> <font size="-1"> (optional)</font></td> </tr> <tr> <td nowrap>Member ID</td> <td> <input name="memberId" type="text" id="memberId" size="4"> <font size="-1"> (optional)</font> </td> </tr> </table> <p> <input type="hidden" name="authid" value="<?php echo $row_userEdit['authid']; ?>"> <input type="submit" name="Submit" value="Submit"> </p> <input type="hidden" name="MM_update" value="editUser"> </form> <br> <p><br> </p> </td> <!-- InstanceEndEditable --> </tr> </table> </body> <!-- InstanceEnd --></html> <?php mysql_free_result($userEdit); ?> --- NEW FILE: logout.php --- <?php include_once("include/globals.php") ?> <?php unsetSessionVariable("username"); header("Location: http://" . getServerVariable("HTTP_HOST") . dirname(getServerVariable("PHP_SELF")) . "/index.php"); ?> |
From: <le...@pr...> - 2004-09-20 13:37:33
|
Update of /cvsroot/meshdb/src/geo/make-hgt-qt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3783 Added Files: BSDmakefile GNUmakefile Makefile.common main.c Log Message: something quick to convert .hgt files to quadtree alt files --- NEW FILE: BSDmakefile --- .include "Makefile.common" .include <bsd.prog.mk> --- NEW FILE: GNUmakefile --- include Makefile.common include ../mk/GNUmakefile.prog --- NEW FILE: Makefile.common --- PROG= make-hgt-qt SRCS= main.c NOMAN= DEBUG= -ggdb -O2 -Wall LDADD= ${LDADD_GEO} DPADD= ${LIBGEO} #default: ${PROG} # #install: # -${INSTALL} -m ${NONBINMODE} alt.data alt.desc ${LIBDIR}/ # # this requires the AUSLIG SG56 DEM data - it costs about AUD$110. #alt: # ./make-alt-qt /cdrom/SG56_DEM/sg56.grd \ # alt.data alt.desc --- NEW FILE: main.c --- /* * Convert altitude data from SRTM 3deg .HGT files into a quadtree file. * * Assumes the filename is in the form SnnnEnnn.hgt, and consists * of a 1201x1201 square of network-endian 16-bit signed integers indicating * height above sea level in metres, and arranged positive east, and * then positive north. * * David Leonard, 2004. Public domain. */ #include <stdio.h> #include <string.h> #include <errno.h> #include <fcntl.h> #include <err.h> #include <sys/types.h> #include <sys/mman.h> #include <unistd.h> #include "compat/compat.h" #include "qt.h" int main(argc, argv) int argc; char *argv[]; { FILE *f, *desc; int qtfd; unsigned long w, h, i; int16_t nodata; float v, xll, yll, csz; int first; off_t mark; char *infile; char *qtdata; char *qtdesc; int qtw, qth; int x, y; struct qt *qt; int progress; int n; char *s, SN[2], EW[2]; int sndeg, ewdeg; if (argc != 4) { fprintf(stderr, "usage: %s infile qt.data qt.desc\n", argv[0]); exit(1); } infile = argv[1]; qtdata = argv[2]; qtdesc = argv[3]; s = strrchr(infile, '/'); s = s == NULL ? infile : s + 1; if (sscanf(s, "%1[SN]%u%1[EW]%u.", SN, &sndeg, EW, &ewdeg) != 4) errx(1, "%s: not in the format '*/[SN]num[EW]num.hgt'", s); xll = (*EW == 'E') ? ewdeg : -ewdeg; yll = (*SN == 'N') ? sndeg : -sndeg; w = 1201; h = 1201; csz = 1./1200; nodata = -32768; if ((f = fopen(infile, "r")) == NULL) err(1, "%s", infile); fprintf(stderr, "xll = %f, yll = %f\n", xll, yll); fprintf(stderr, "w x h = %lu x %lu\nnodata = %d\n", w, h, nodata); if ((qtfd = open(qtdata, O_TRUNC|O_CREAT|O_RDWR, 0666)) == -1) err(1, "%s", qtdata); if ((desc = fopen(qtdesc, "w")) == NULL) err(1, "%s", qtdesc); /* Find powers of 2 to hold the data set */ qtw = qth = 1; while (qtw < w) qtw <<= 1; while (qth < h) qth <<= 1; fprintf(desc, "width %d\nheight %d\nelement_size %d\nfilename %s\n", qtw, qth, sizeof (float), qtdata); fprintf(desc, "xll %f\nyll %f\ncellsz %f\n", xll + csz/2, yll + csz/2, csz); fflush(desc); fprintf(stderr, "mapping %lu bytes\n", qtw * qth * sizeof (float)); if (ftruncate(qtfd, qtw * qth * sizeof (float)) == -1) err(1, "%s: %lu bytes", qtdata, qtw * qth * sizeof (float)); close(qtfd); fclose(desc); /* Now, re-open the file with writing */ qt = qtopen(qtdesc, 1, NULL); fprintf(stderr, "filling with NaN\n"); v = 0.0/0.0; /* NaN */ for (x = 0; x < qtw * qth; x++) ((float *)qt->data)[x] = v; /* Fill in the quadtree */ fprintf(stderr, "filling in quadtree: "); progress = 0; for (y = 0; y < h; y++) { if (y * 100 / h >= progress) { fprintf(stderr, "%d%% ", progress); progress = 10 + y * 100 / h; } for (x = 0; x < w; x++) { int16_t a,b; float *fp; fread(&a, sizeof a, 1, f); b = ntohs(a); fp = qtgetpoint_byindex(qt, x, y); if (b != nodata) *fp = b; } } fprintf(stderr, "\nsync\n"); fclose(f); qtfree(qt); exit(0); } |
From: <le...@pr...> - 2004-09-20 13:15:12
|
Update of /cvsroot/meshdb/src/geo/make-hgt-qt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31246/make-hgt-qt Log Message: Directory /cvsroot/meshdb/src/geo/make-hgt-qt added to the repository |
From: <il...@pr...> - 2004-09-18 06:08:20
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18425 Modified Files: submit.php Log Message: Fixed bug that was blowing out northings. Oops. Index: submit.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/submit.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- submit.php 18 Sep 2004 05:05:56 -0000 1.13 +++ submit.php 18 Sep 2004 06:08:11 -0000 1.14 @@ -264,7 +264,7 @@ $physloc["e"] * $factor < $max_e) $physloc["e"] *= $factor; if ($physloc["n"] * $factor > $min_n && - $physloc["n"] * $factor > $max_n) + $physloc["n"] * $factor < $max_n) $physloc["n"] *= $factor; } } |
From: <il...@pr...> - 2004-09-18 05:06:09
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6496 Modified Files: submit.php Log Message: Some gross hacking in the name of pragmatism: try to pick up common mistakes that people make when entering coordinates (such as entering them in curvilinear form rather than UTM or vice versa, or missing some digits from the end of the UTM coordinates, or getting the signs on curvilinear coordinates wrong) and fix them up for them automatically. Index: submit.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/submit.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- submit.php 18 Sep 2004 05:02:50 -0000 1.12 +++ submit.php 18 Sep 2004 05:05:56 -0000 1.13 @@ -227,10 +227,48 @@ else if ($admin["nodename"] == "") die("nodename cannot be empty"); + /* The limits of what we deem to be sensible coordinates (a + * few hundred kilometres in each direction from Brisbane). */ + $min_e = 200000; + $max_e = 700000; + $min_n = 6700000; + $max_n = 7200000; + $min_lon = 25; /* absolute values, just to keep it easy */ + $max_lon = 30; + $min_lat = 150; + $max_lat = 155; + if ($PREF["wantgps"] && isset($physloc["lat"])) { + if ($physloc["lat"] > $min_n && $physloc["lat"] < $max_n + && $physloc["lon"] > $min_e && $physloc["lon"] < $max_e) { + /* Looks like UTM entered as curvilinear. */ + $physloc["e"] = $physloc["lon"]; + $physloc["n"] = $physloc["lat"]; + } else { + /* We don't have any better guesses for what it might + * be, so we'll just trust them. */ list($physloc["e"], $physloc["n"]) = - cvteastnorth($physloc["lat"], $physloc["lon"]); - } + cvteastnorth($physloc["lat"], $physloc["lon"]); + } + } else if (isset($physloc["e"]) && isset($physloc["n"])) { + if (abs($physloc["n"]) > $min_lon && abs($physloc["n"]) < $max_lon + && abs($physloc["e"]) > $min_lat && abs($physloc["e"]) < $max_lat) { + /* Looks like curvilinear entered as UTM. */ + list($physloc["e"], $physloc["n"]) = + cvteastnorth(-abs($physloc["n"]), abs($physloc["e"])); + } else { + for ($factor = 10; $factor <= 100; $factor *= 10) { + /* Check whether there's a digit or three missing + * from the eastings and/or northings. */ + if ($physloc["e"] * $factor > $min_e && + $physloc["e"] * $factor < $max_e) + $physloc["e"] *= $factor; + if ($physloc["n"] * $factor > $min_n && + $physloc["n"] * $factor > $max_n) + $physloc["n"] *= $factor; + } + } + } function addchange($name, $old, $new, &$changes) { |
From: <il...@pr...> - 2004-09-18 05:02:59
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6130 Modified Files: submit.php Log Message: Send mails to the admin on node creation as well as updates and deletions. Index: submit.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/submit.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- submit.php 2 Aug 2004 12:39:24 -0000 1.11 +++ submit.php 18 Sep 2004 05:02:50 -0000 1.12 @@ -40,7 +40,8 @@ $who .= " [" . $_SERVER["REMOTE_HOST"] . "]"; /* Take note of whether the remote host matches the last update. */ - if ($notify_info["updatedip"] != $_SERVER["REMOTE_ADDR"]) + if (isset($notify_info["updatedip"]) + && $notify_info["updatedip"] != $_SERVER["REMOTE_ADDR"]) $ipchangedstring = "\nLast updated from different address: ". $notify_info["updatedip"]."\n"; else @@ -186,6 +187,8 @@ if ($operation == "replace" || $operation == "delete") $notify_info = notify_lookup($db, $nodeid); + else + $notify_info = array(); if ($operation == "insert" || $operation == "replace") { if (!isset($nodeid)) @@ -415,8 +418,10 @@ or die(mysql_error($db)); } - if ($operation == "replace") - notify($notify_info, "updated", $nodeid, $changes); + notify($notify_info, + $operation == "insert" ? "created" : "updated", + $nodeid, + $changes); $result = mysql_query("COMMIT") or die(mysql_error($db)); |