X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=maps%2Fphp%2FMAPS.php;h=589e74d53f34b53510a19f162445841a1ea88ba3;hb=24352d115ade3e1f4916df9c0102b1edb804f0c6;hp=0def4ba6066246853738e4cd86b145c22574d820;hpb=0b6a970eed78ff888a9a7130d84f304861b6d341;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 "
"; - print "

Today's Activity

"; + print "

Today's Activity

"; print "

as of $current_time

"; $processed = $dates[$today]["processed"]; @@ -307,7 +316,8 @@ function NavigationBar($userid) { if (!isset ($userid) || $userid == "") { print <<Welcome to MAPS
+

MAPS 2.0

+
Welcome to MAPS
+

MAPS 2.0

+
Welcome $Userid
END; + + displayquickstats(); + print <<
@@ -344,8 +358,6 @@ END; END; - displayquickstats(); - print << +

END; } // if @@ -403,6 +416,7 @@ function DisplayList($type, $next, $lines) { $domain = $row["domain"] == "" ? " " : $row["domain"]; $hit_count = $row["hit_count"] == "" ? " " : $row["hit_count"]; $last_hit = $row["last_hit"] == "" ? " " : $row["last_hit"]; + $retention = $row["retention"] == "" ? " " : $row["retention"]; $comments = $row["comment"] == "" ? " " : $row["comment"]; // Remove time from last hit @@ -426,6 +440,7 @@ function DisplayList($type, $next, $lines) { print "$domain"; print "" . $hit_count . ""; print "" . $last_hit . ""; + print "" . $retention . ""; print "" . $comments . ""; print ""; } // for @@ -484,13 +499,13 @@ END; if ($i < $top - 1) { print "\n"; print "" . $ranking . ""; - print "$domain"; + print "$domain"; print ""; print "$nbr"; } else { print "\n"; print "" . $ranking . ""; - print "$domain"; + print "$domain"; print ""; print "$nbr"; } // if @@ -524,9 +539,11 @@ function Space() { strlen($row["subject"]) + strlen($row["timestamp"]) + strlen($row["data"]); - $space = $space + $msg_space; + $space += $msg_space; } // while + mysqli_free_result($result); + return $space; } // Space ?>