X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=maps%2Fphp%2FMAPS.php;h=49d7ca4d837b710a62f5949baa8cb6108632a21f;hb=f3d5e3943a860e3a511b45b22a34cee704a5e9b3;hp=9b94c17d2bee80634233584fe3c2e34d3862ca98;hpb=7c4d6f10dcee2d2be4a4d9595c6f9722024f3b34;p=clearscm.git diff --git a/maps/php/MAPS.php b/maps/php/MAPS.php index 9b94c17..49d7ca4 100755 --- a/maps/php/MAPS.php +++ b/maps/php/MAPS.php @@ -50,7 +50,7 @@ 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") @@ -74,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); @@ -219,9 +219,9 @@ function displayquickstats() { $current_time = date("g:i:s a"); // Start quickstats - print "
"; - print "

Today's Activity

"; - print "

as of $current_time

"; + print "
"; + print "

Today's Activity

"; + print "

as of $current_time

"; $processed = $dates[$today]["processed"]; $returned = $dates[$today]["returned"]; @@ -239,58 +239,60 @@ function displayquickstats() { $nulllist_pct = $processed == 0 ? 0 : number_format ($nulllist / $processed * 100, 1, ".", ""); - $returned_link = $returned == 0 ? 0 : - "$returned"; - $whitelist_link = $whitelist == 0 ? 0 : - "$whitelist"; - $blacklist_link = $blacklist == 0 ? 0 : - "$blacklist"; - $registered_link = $registered == 0 ? 0 : - "$registered"; - $mailloop_link = $mailloop == 0 ? 0 : - "$mailloop"; - $nulllist_link = $nulllist == 0 ? 0 : - "$nulllist"; + $returned_link = $returned == 0 ? '' : + ""; + $whitelist_link = $whitelist == 0 ? '' : + ""; + $blacklist_link = $blacklist == 0 ? '' : + ""; + $registered_link = $registered == 0 ? '' : + ""; + $mailloop_link = $mailloop == 0 ? '' : + "\""; + $nulllist_link = $nulllist == 0 ? '' : + ""; print << - + - - + + + + + + - - + - - + - - + - - + - - - -
ProcessedProcessed $processed n/a
Returned$returned_link + ${nulllist_link}Nulllist$nulllist$nulllist_pct%
${returned_link}Returned$returned $returned_pct%
Whitelist$whitelist_link + ${whitelist_link}Whitelist$whitelist $whitelist_pct%
Blacklist$blacklist_link + ${blacklist_link}Blacklist$blacklist $blacklist_pct%
Registered$registered_link + ${registered_link}Registered$registered n/a
Mailloop$mailloop_link + ${mailloop_link}Mailloop$mailloop n/a
Nulllist$nulllist_link - $nulllist_pct%
+
EOT; } // displayquickstats @@ -315,7 +317,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 <<
@@ -352,8 +359,6 @@ END; END; - displayquickstats(); - print << +

END; } // if @@ -400,9 +406,9 @@ function DisplayList($type, $next, $lines) { or DBError("DisplayList: Unable to execute query: ", $statement); for ($i = 0; $i < $lines; $i++) { - $row = mysqli_fetch_array ($result); + $row = mysqli_fetch_array($result); - if (!isset ($row ["sequence"])) { + if (!isset ($row["sequence"])) { break; } // if @@ -411,6 +417,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 @@ -427,13 +434,13 @@ function DisplayList($type, $next, $lines) { $rightclass = ($i == $lines || $sequence == $total || $sequence == $last) ? "tablebottomright" : "tablerightdata"; - print "" . $sequence . ""; - print "\n"; + print "" . $sequence . "\n"; print "" . $username . ""; print "@"; print "$domain"; print "" . $hit_count . ""; print "" . $last_hit . ""; + print "" . $retention . ""; print "" . $comments . ""; print ""; } // for @@ -471,11 +478,11 @@ function ListDomains($top = 10) { $result = mysqli_query($db, $statement) or DBError("ListDomains: Unable to execute query: ", $statement); + print "
"; print << - Mark - Ranking +   Domain Returns @@ -483,22 +490,20 @@ END; // Get results for ($i = 0; $i < $top; $i++) { - $row = mysqli_fetch_array ($result); + $row = mysqli_fetch_array($result); $domain = $row["domain"]; $nbr = $row["nbr"]; print ""; $ranking = $i + 1; if ($i < $top - 1) { - print "\n"; - print "" . $ranking . ""; - print "$domain"; + print "" . $ranking . "\n"; + print "$domain"; print ""; print "$nbr"; } else { - print "\n"; - print "" . $ranking . ""; - print "$domain"; + print "" . $ranking . "\n"; + print "$domain"; print ""; print "$nbr"; } // if @@ -511,6 +516,7 @@ END; + END; } // ListDomains