function UserIDCheck($sValue, &$oStatus)
{
    global $sTable;
    global $postgisObject;
    //$sUserID = addslashes($sValue);
    $sUserID = postgis::toAscii($sValue, NULL, "_");
    $oStatus->bValid = false;
    $oStatus->sErrMsg = "<span class='label label-warning'>User ID '{$sValue}' already exist</span>";
    $sQuery = "SELECT COUNT(*) as count FROM {$sTable} WHERE screenname = '{$sUserID}'";
    $res = $postgisObject->execQuery($sQuery);
    $row = $postgisObject->fetchRow($res);
    //echo($row['count']);
    //die();
    if ($row['count'] > 0) {
        $oStatus->bValid = 0;
        $postgisObject->numRows($res);
    } else {
        $oStatus->bValid = 1;
    }
}
Exemple #2
0
function UserIDCheck($sValue, &$oStatus)
{
    global $sTable;
    global $postgisObject;
    global $sUserID;
    $sUserID = postgis::toAscii($sValue, NULL, "_");
    $sPassword = VDFormat($_POST['Password'], true);
    $sPassword = Settings_viewer::encryptPw($sPassword);
    ings_viewerssword;
    $oStatus->bValid = false;
    $oStatus->sErrMsg = "User ID '{$sValue}' already exist";
    $sQuery = "SELECT COUNT(*) as count FROM {$sTable} WHERE screenname = '{$sUserID}' AND pw='{$sPassword}'";
    $res = $postgisObject->execQuery($sQuery);
    $row = $postgisObject->fetchRow($res);
    //echo($sQuery);
    //die();
    if ($row['count'] > 0) {
        $oStatus->bValid = 1;
        $postgisObject->numRows($res);
    } else {
        $oStatus->bValid = 0;
    }
}
Exemple #3
0
$targetPath = "{$_SERVER["DOCUMENT_ROOT"]}/tmp/";
$fileName = $_SESSION['screen_name'] . "_" . time();
$file = $targetPath . $fileName;
$response['uploaded'] = true;
$SafeFile = $_FILES['shp']['name'];
$SafeFile = str_replace("#", "No.", $SafeFile);
$SafeFile = str_replace("-", "_", $SafeFile);
$SafeFile = str_replace("\$", "Dollar", $SafeFile);
$SafeFile = str_replace("%", "Percent", $SafeFile);
$SafeFile = str_replace("^", "", $SafeFile);
$SafeFile = str_replace("&", "and", $SafeFile);
$SafeFile = str_replace("*", "", $SafeFile);
$SafeFile = str_replace("?", "", $SafeFile);
$SafeFile = str_replace(".shp", "", $SafeFile);
$SafeFile = strtolower($SafeFile);
$SafeFile = postgis::toAscii($SafeFile, array(), "_");
$SafeFile = $postgisschema . "." . $SafeFile;
if (move_uploaded_file($_FILES['shp']['tmp_name'], $file . ".shp")) {
} else {
    $response['uploaded'] = false;
}
if (move_uploaded_file($_FILES['dbf']['tmp_name'], $file . ".dbf")) {
} else {
    $response['uploaded'] = false;
}
if (move_uploaded_file($_FILES['shx']['tmp_name'], $file . ".shx")) {
} else {
    $response['uploaded'] = false;
}
if ($response['uploaded']) {
    $shapeFile = new shapefile($SafeFile, $_REQUEST['srid'], $file, $_REQUEST['pdo']);
include 'libs/functions.php';
include 'inc/user_name_from_uri.php';
include 'model/users.php';
include 'model/databases.php';
include 'model/classes.php';
include 'model/wmslayers.php';
include 'model/settings_viewer.php';
// we need to get pw for http authentication
include 'libs/FirePHPCore/FirePHP.class.php';
include 'libs/FirePHPCore/fb.php';
if ($parts[1] == "store" || $parts[1] == "editor") {
    $db = new databases();
    if (!$parts[2]) {
        die("<script>window.location='/?db=false'</script>");
    }
    if ($db->doesDbExist(postgis::toAscii($parts[2], NULL, "_"))) {
        $postgisdb = $parts[2];
    } else {
        die("<script>window.location='/?db=false'</script>");
    }
    include "inc/oauthcheck.php";
}
?>
<!DOCTYPE html>
<html>
<head>
    <title>MapCentia GeoCloud</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="description"
          content="Analyze and visualize your data. Use a powerful API for adding maps to your own apps."/>
    <meta name="description"
// Start HTML doc
include "html_header.php";
?>
<link rel="stylesheet" href="/css/style.css" type="text/css" media="screen" />
</head>
<body>
<div id="outercontainer">
<div id="innercontainer">
<div id='stylized' class="myform">
<?php 
if (!$_REQUEST['name']) {
    echo "<h1>Need a name!</h1>";
    echo "<p></p>";
} else {
    $name = postgis::toAscii($_REQUEST['name'], NULL, "_");
    $db = new databases();
    $dbObj = $db->createdb($name, $databaseTemplate, "LATIN1");
    // databaseTemplate is set in conf/main.php
    if ($dbObj) {
        echo "<h1>Your geocloud \"{$name}\" was created!</h1>";
        echo "<p>When asked type in \"{$name}\" and use \"1234\" for password. Remember to change it!</p>";
        echo "<button onclick=\"window.location.href='/store/{$name}'\">Take me to my cloud</button>";
    } else {
        echo "<h1>Sorry, something went wrong. Try again</h1>";
    }
}
?>
<div class="spacer"></div>
</div>
</div>
Exemple #6
0
// Check if user is logged in - and redirect if this is not the case
if (!$_SESSION['auth'] || !$_SESSION['screen_name']) {
    die("<script>window.location='/user/login'</script>");
}
include '../header.html';
include '../../conf/main.php';
include '../../libs/functions.php';
include 'model/databases.php';
//print_r($_SESSION);
?>
<!--<p>Hi <?php 
echo $_SESSION['screen_name'];
?>
</p>-->
<?php 
$db = new databases();
if ($db->doesDbExist(postgis::toAscii($_SESSION['screen_name'], NULL, "_"))) {
    echo "<a style='margin-top:40px' href='/store/{$_SESSION['screen_name']}' class='btn btn-large btn-info'>Start MyGeoCloud</a>";
} else {
    echo "<a style='margin-top:40px' href='/createstore' class='btn btn-large btn-info'>Create MyGeoCloud</a>";
    echo "<p>It will take a minute.</p>";
}
?>
</div>
<div class="span4" style="border-left:4px solid #F1F1F1;display: block;height: 250px;margin-top: 0px;padding-left: 40px;padding-top: 40px">
	<h1></h1>
</div>
</div>
</div>
</body>
</html>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>
    <div class="container">
		<div class="row">
			<div class="span4">&nbsp;</div>
			<div class="span4">
				<div class="box">
				<?php 
if (!$_SESSION['screen_name']) {
    echo "<h2>Need a name!</h2>";
    echo "<div class='inner'><a href='/' class='btn btn-danger'>Go back</a></div>";
} else {
    $name = postgis::toAscii($_SESSION['screen_name'], NULL, "_");
    $db = new databases();
    echo "<div class='inner'>";
    $dbObj = $db->createdb($name, $databaseTemplate, "UTF8");
    // databaseTemplate is set in conf/main.php
    echo "</div>";
    if ($dbObj) {
        echo "<h2>Your geocloud \"{$name}\" was created!</h2>";
        echo "<div class='inner'><p> </p>";
        echo "<p><button class='btn btn-warning' onclick=\"window.location.href='/store/{$name}'\">Take me to my cloud</button></p></div>";
    } else {
        echo "<h2>Sorry, something went wrong. Try again</h2>";
        echo "<div class='inner'><a href='/user/signup' class='btn btn-danger'>Go back</a></div>";
    }
}
?>
include 'model/databases.php';
include 'model/classes.php';
include 'model/wmslayers.php';
include 'model/settings_viewer.php';
// we need to get pw for http authentication
include 'libs/FirePHPCore/FirePHP.class.php';
include 'libs/FirePHPCore/fb.php';
$_SESSION['screen_name'] = $parts[2];
if ($parts[1] == "store" || $parts[1] == "editor") {
    $db = new databases();
    if (!$parts[2]) {
        die("<script>window.location='/?db=false'</script>");
    }
    if (!$db->doesDbExist($parts[2])) {
        if ($db->doesDbExist(postgis::toAscii($parts[2], NULL, "_"))) {
            die("<script>window.location='/store/" . postgis::toAscii($parts[2]) . "'</script>");
        } else {
            die("<script>window.location='/?db=false'</script>");
        }
    }
    include "inc/oauthcheck.php";
}
?>
<!DOCTYPE html>
<html >
  <head>
    <title>MyGeoCloud - Online GIS - Store geographical data and make online maps - WFS and WMS</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="description" content="Store geographical data and make online maps" />
	<meta name="keywords" content="GIS, geographical data, maps, web mapping, shape file, GPX, MapInfo, WMS, OGC" />
	<meta name="author" content="Martin Hoegh" />