Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jakub Dubrovsky
committed
Jul 1, 2012
0 parents
commit 6c75bb9
Showing
523 changed files
with
36,225 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/nbproject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Mapito | ||
|
||
Mapito is opensource project for editing and sharing spatial data. It is map manager, which create new map portal with any WMS layers in a few seconds. | ||
Mapito is made available under a BSD-license. | ||
|
||
|
||
## Getting Mapito | ||
|
||
Mapito is available at https://github.com/jkdubr/Mapito. | ||
|
||
## Requirments | ||
|
||
PHP, MySQL, PostGIS, Geoserver | ||
|
||
## Installing Mapito | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
$layerManager=new LGLayerManager($user); | ||
$layerManager->addLayerFolder($_POST); | ||
|
||
header("Location: ".$_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
$layerManager = new LGLayerManager($user); | ||
$layerManager->removeLayerFolder($_GET["layerFolderId"]); | ||
|
||
header("Location: ".$_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
$user = new LGUser(); | ||
$layerManager=new LGLayerManager($user); | ||
$layerManager->updateLayerFolder($_POST); | ||
|
||
header("Location: ".$_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
$layerManager=new LGLayerManager($user); | ||
$layerManager->addLayerPublicToPlan($_POST['layerId'], $_POST['planId']); | ||
|
||
header("Location: " . $_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
|
||
$layerStyleManager=new LGLayerStyleManager($user); | ||
$layerStyleManager->addStyle($_REQUEST); | ||
|
||
header("Location: " . $_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
|
||
|
||
$layerStyleManager=new LGLayerStyleManager($user); | ||
$layerStyleManager->removeStyle($_REQUEST['layerStyleId']); | ||
|
||
header("Location: " . $_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
|
||
|
||
$layerStyleManager=new LGLayerStyleManager($user); | ||
$layerStyleManager->updateStyle($_REQUEST); | ||
|
||
header("Location: " . $_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
$layerManager=new LGLayerManager($user); | ||
$layerManager->addLayer($_POST); | ||
header("Location: ".$_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
|
||
$layerManager=new LGLayerManager($user); | ||
$layerManager->removeLayer($_GET["layerId"]); | ||
|
||
header("Location: ".$_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
|
||
$layerManager = new LGLayerManager($user); | ||
$layerManager->updateLayer($_POST); | ||
|
||
header("Location: ".$_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
|
||
$layerManager=new LGLayerManager($user); | ||
$layerManager->updateLayersFromPostgis($_GET['planId']); | ||
|
||
header("Location: " . $_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
$user->login($_POST["mail"], $_POST["password"]); | ||
|
||
|
||
header("Location: ".$_SERVER["HTTP_REFERER"]); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
$user->logout(); | ||
header("Location: ../index.php"); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
$layerColManager = new LGLayerColManager($user); | ||
$layerColManager->addCol($_POST["planId"], $_POST["layerId"], $_POST["colName"], $_POST["colType"]); | ||
|
||
|
||
|
||
header("Location: " . $_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
|
||
|
||
$layerColManager = new LGLayerColManager($user); | ||
$layerColManager->removeCol($_POST["planId"], $_POST["layerId"], $_POST["colName"]); | ||
|
||
header("Location: " . $_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
|
||
$plan = new LGPlan($_GET["planId"]); | ||
|
||
|
||
|
||
if ($user->getPrivilegeForPlan($plan->planId) > 1) { | ||
$dbname = 'ligeo_' . $plan->name; | ||
|
||
$pgsql_conn = pg_connect("host=" . $GLOBALS["LGSettings"]->postgis_host . " dbname=" . $dbname . " user=" . $GLOBALS["LGSettings"]->postgis_user . " password=" . $GLOBALS["LGSettings"]->postgis_pass . ""); | ||
if (!$pgsql_conn) { | ||
die("Error in connection: " . pg_last_error()); | ||
} | ||
|
||
|
||
|
||
|
||
|
||
$sql = 'INSERT INTO ' . $_GET["dbtab"] . ' ("group",name,editable_svd,editable_title,hyp_max)' . ' VALUES (\'' . $_GET["group"] . '\', \'ostatni\',1,1,(SELECT hyp_max FROM '. $_GET["dbtab"] . ' WHERE "group" = \'' . $_GET["group"] .'\' GROUP BY hyp_max))'. ' ;'; | ||
|
||
$results = pg_query($pgsql_conn, $sql); | ||
|
||
//vypocitej update | ||
|
||
|
||
pg_close($pgsql_conn); | ||
} | ||
|
||
header("Location: " . $_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
|
||
$plan = new LGPlan($_GET["planId"]); | ||
if ($user->getPrivilegeForPlan($plan->planId) > 1) { | ||
$dbname = 'ligeo_' . $plan->name; | ||
|
||
$pgsql_conn = pg_connect("host=" . $GLOBALS["LGSettings"]->postgis_host . " dbname=" . $dbname . " user=" . $GLOBALS["LGSettings"]->postgis_user . " password=" . $GLOBALS["LGSettings"]->postgis_pass . ""); | ||
if (!$pgsql_conn) { | ||
die("Error in connection: " . pg_last_error()); | ||
} | ||
|
||
$sql = 'delete from ' . secure($_GET["dbtab"]) . ' where gid = ' . (int) $_GET["gid"] . ' ;'; | ||
|
||
$results = pg_query($pgsql_conn, $sql); | ||
|
||
|
||
pg_close($pgsql_conn); | ||
} | ||
|
||
header("Location: " . $_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
|
||
|
||
$plan = new LGPlan($_POST["planId"]); | ||
if ($user->getPrivilegeForPlan($plan->planId) > 1) { | ||
$dbname = 'ligeo_' . $plan->name; | ||
|
||
|
||
$pgsql_conn = pg_connect("host=" . $GLOBALS["LGSettings"]->postgis_host . " dbname=" . $dbname . " user=" . $GLOBALS["LGSettings"]->postgis_user . " password=" . $GLOBALS["LGSettings"]->postgis_pass . ""); | ||
if (!$pgsql_conn) { | ||
die("Error in connection: " . pg_last_error()); | ||
} | ||
|
||
|
||
|
||
$v = mydb_query('select * from layerWPS where layerId =' . $plan->planId . ' '); | ||
$z = $v->fetch_array(); | ||
|
||
$wps = json_encode($z['content']); | ||
|
||
|
||
$results = pg_query($pgsql_conn, 'SELECT * FROM ' . secure($_POST["dbtab"]) . ' LIMIT 1 ;'); | ||
$sqlArray = array(); | ||
for ($gt = 0; $gt < pg_num_fields($results); $gt++) { | ||
if (pg_field_type($results, $gt) == "geometry") { | ||
|
||
} elseif ($_FILES[pg_field_name($results, $gt)]["tmp_name"]) { | ||
@mkdir('../../data/plan/' . $plan->planId . '/'); | ||
$filePath = 'data/plan/' . $plan->planId . '/' . time() . '.' . $_FILES[pg_field_name($results, $gt)]["name"]; | ||
file_put_contents('../../' . $filePath, file_get_contents($_FILES[pg_field_name($results, $gt)]["tmp_name"])); | ||
|
||
$sqlArray[] = '"' . pg_field_name($results, $gt) . '"=\'' . $GLOBALS["LGSettings"]->map_url . $filePath . '\''; | ||
} else { | ||
$sqlArray[] = '"' . pg_field_name($results, $gt) . '"=\'' . secure($_POST[pg_field_name($results, $gt)]) . '\''; | ||
} | ||
} | ||
$sql = 'UPDATE ' . secure($_POST["dbtab"]) . ' SET ' . implode(",", $sqlArray) . ' WHERE gid=' . (int) $_POST["gid"] . ' ;'; | ||
//echo $sql; | ||
$results = pg_query($pgsql_conn, $sql); | ||
|
||
|
||
//vypocitej update | ||
|
||
|
||
pg_close($pgsql_conn); | ||
} | ||
|
||
header("Location: " . $_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
|
||
|
||
$plan = new LGPlan($_POST["planId"]); | ||
if ($user->getPrivilegeForPlan($plan->planId) > 1) { | ||
$dbname = 'ligeo_' . $plan->name; | ||
|
||
|
||
$pgsql_conn = pg_connect("host=" . $GLOBALS["LGSettings"]->postgis_host . " dbname=" . $dbname . " user=" . $GLOBALS["LGSettings"]->postgis_user . " password=" . $GLOBALS["LGSettings"]->postgis_pass . ""); | ||
if (!$pgsql_conn) { | ||
die("Error in connection: " . pg_last_error()); | ||
} | ||
|
||
|
||
|
||
$v = mydb_query('select * from layerWPS where layerId =' . $plan->planId . ' '); | ||
$z = $v->fetch_array(); | ||
|
||
$wps = json_encode($z['content']); | ||
|
||
|
||
$results = pg_query($pgsql_conn, 'SELECT * FROM ' . secure($_POST["dbtab"]) . ' LIMIT 1 ;'); | ||
$sqlArray = array(); | ||
for ($gt = 0; $gt < pg_num_fields($results); $gt++) { | ||
if (pg_field_type($results, $gt) == "geometry") { | ||
|
||
} elseif ($_FILES[pg_field_name($results, $gt)]["tmp_name"]) { | ||
@mkdir('../../data/plan/' . $plan->planId . '/'); | ||
$filePath = 'data/plan/' . $plan->planId . '/' . time() . '.' . $_FILES[pg_field_name($results, $gt)]["name"]; | ||
file_put_contents('../../' . $filePath, file_get_contents($_FILES[pg_field_name($results, $gt)]["tmp_name"])); | ||
|
||
$sqlArray[] = '"' . pg_field_name($results, $gt) . '"=\'' . $GLOBALS["LGSettings"]->map_url . $filePath . '\''; | ||
} elseif (secure($_POST[pg_field_name($results, $gt)]) == "") { | ||
|
||
} else { | ||
$sqlArray[] = '"' . pg_field_name($results, $gt) . '"=\'' . secure($_POST[pg_field_name($results, $gt)]) . '\''; | ||
} | ||
} | ||
$sql = 'UPDATE ' . secure($_POST["dbtab"]) . ' SET ' . implode(",", $sqlArray) . ' WHERE gid=' . (int) $_POST["gid"] . ' ;'; | ||
//echo $sql; | ||
$results = pg_query($pgsql_conn, $sql); | ||
|
||
|
||
//vypocitej update | ||
|
||
|
||
pg_close($pgsql_conn); | ||
} | ||
|
||
header("Location: " . $_SERVER["HTTP_REFERER"]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
require_once '../lib/php/main.lib.php'; | ||
|
||
$user = new LGUser(); | ||
$planManager = new LGPlanManager($user); | ||
$planManager->addPlan($_POST); | ||
|
||
|
||
header("Location: ".$_SERVER["HTTP_REFERER"]); | ||
?> |
Oops, something went wrong.