Skip to content

Commit

Permalink
OTCWebsite: fix last auth warning for nonexistent and grandfathered u…
Browse files Browse the repository at this point in the history
…sers.
  • Loading branch information
Daniel Folkinshteyn committed Mar 27, 2014
1 parent 6bd86e6 commit cc467ae
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions OTCWebsite/viewratingdetail.php
Expand Up @@ -101,6 +101,7 @@ function like($s, $e) {
$lastauthed = $gpgentry['last_authed_at'];
} else {
$keyprint = "";
$lastauthed = "";
}
}
echo '<li><a href="viewgpg.php?nick=' . htmlentities($nick) . '">GPG identity</a> (<a href=" http://nosuchlabs.com/gpgfp/' . $keyprint . '">check GPG key quality</a>)</li>';
Expand All @@ -109,10 +110,17 @@ function like($s, $e) {
</ul>

<?php
$sec_since_auth = time() - $lastauthed;
if ($sec_since_auth > 2592000){ // 30 days
echo '<P><font size="24" color="red">This user has not authenticated for more than ' . intval($sec_since_auth/86400) . ' days. If you are currently talking to someone who claims to be this person, you are probably talking to an impostor and scammer.</font></P>';
}
if ($lastauthed == ""){ //no matches from gpg db
if ($entry['ratingcount'] == 0){ // no such user
$lastauthed = time();
} else {
$lastauthed = 1293858000; //end of 2010
}
}
$sec_since_auth = time() - $lastauthed;
if ($sec_since_auth > 2592000){ // 30 days
echo '<P><font style="font-size:2em; color: red;">This user has not authenticated for more than ' . intval($sec_since_auth/86400) . ' days. If you are currently talking to someone who claims to be this person, you are probably talking to an impostor and scammer.</font></P>';
}
?>

<h3>List of <?php echo $signs[$sign]; ?> ratings <?php echo $types[$type]; ?> <sup>[<a href="<?php jsonlink(); ?>">json</a>]</sup></h3>
Expand Down

0 comments on commit cc467ae

Please sign in to comment.