X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=maps%2Fphp%2FMAPS.php;h=49d7ca4d837b710a62f5949baa8cb6108632a21f;hb=b02e05b4efd5224a53c762942929b75ae215e237;hp=0def4ba6066246853738e4cd86b145c22574d820;hpb=0b6a970eed78ff888a9a7130d84f304861b6d341;p=clearscm.git diff --git a/maps/php/MAPS.php b/maps/php/MAPS.php index 0def4ba..49d7ca4 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); @@ -211,9 +219,9 @@ function displayquickstats() { $current_time = date("g:i:s a"); // Start quickstats - print "
as of $current_time
"; + print "as of $current_time
"; $processed = $dates[$today]["processed"]; $returned = $dates[$today]["returned"]; @@ -231,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 <<Processed | +Processed | $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% | -