X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=maps%2Fphp%2FMAPS.php;h=589e74d53f34b53510a19f162445841a1ea88ba3;hb=983213261f42cfb514586f4a72f5f06bcf025409;hp=0def4ba6066246853738e4cd86b145c22574d820;hpb=c0e00f11bf9b54692b2ee00e2488b7b08cb94026;p=clearscm.git
diff --git a/maps/php/MAPS.php b/maps/php/MAPS.php
index 0def4ba..589e74d 100755
--- a/maps/php/MAPS.php
+++ b/maps/php/MAPS.php
@@ -50,13 +50,21 @@ function DBError($msg, $statement) {
function OpenDB() {
global $db;
- $db = mysqli_connect("localhost", "maps", "spam")
+ $db = mysqli_connect("127.0.0.1", "maps", "spam")
or DBError("OpenDB: Unable to connect to database server", "Connect");
mysqli_select_db($db, "MAPS")
or DBError("OpenDB: Unable to select MAPS database", "adefaria_maps");
} // OpenDB
+function CloseDB() {
+ global $db;
+
+ if (isset ($db)) {
+ mysqli_close($db);
+ } // if
+} // CloseDB
+
function SetContext($new_userid) {
global $userid;
@@ -66,7 +74,7 @@ function SetContext($new_userid) {
function Encrypt($password, $userid) {
global $db;
- $statement = "select encode(\"$password\",\"$userid\")";
+ $statement = "select hex(aes_encrypt(\"$password\",\"$userid\"))";
$result = mysqli_query($db, $statement)
or DBError("Encrypt: Unable to execute statement", $statement);
@@ -102,6 +110,7 @@ function Login($userid, $password) {
// Check if user exists
$dbpassword = UserExists($userid);
+ print "dbpassword = $dbpassword
";
// Return -1 if user doesn't exist
if ($dbpassword == -1) {
@@ -212,7 +221,7 @@ function displayquickstats() {
// Start quickstats
print "
as of $current_time
"; $processed = $dates[$today]["processed"]; @@ -307,7 +316,8 @@ function NavigationBar($userid) { if (!isset ($userid) || $userid == "") { print <<