From: Tim Starling Date: Sun, 9 May 2004 06:20:46 +0000 (+0000) Subject: proper handling of users with no contributions X-Git-Tag: 1.3.0beta1~114 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=e5b273261a388eb01805c61301772ec9d909c740;p=lhc%2Fweb%2Fwiklou.git proper handling of users with no contributions --- diff --git a/includes/SpecialBoardvote.php b/includes/SpecialBoardvote.php index 2984bd515e..8a523774cf 100644 --- a/includes/SpecialBoardvote.php +++ b/includes/SpecialBoardvote.php @@ -185,7 +185,6 @@ class BoardVoteForm { $record = "Contributing: $contributing (" .$wgContributingCandidates[$contributing] . ")\n" . "Volunteer: $volunteer (" . $wgVolunteerCandidates[$volunteer] . ")\n" . - "User: {$this->mUserKey}\n" . "Salt: $salt\n"; # Get file names $input = tempnam( "/tmp", "gpg_" ); @@ -232,8 +231,13 @@ class BoardVoteForm { wfFreeResult( $res ); # If the user has stacks of contributions, don't check old as well - $signup = wfTimestamp2Unix( $cur->t ); $now = time(); + if ( is_null( $cur->t ) ) { + $signup = $now; + } else { + $signup = wfTimestamp2Unix( $cur->t ); + } + $days = ($now - $signup) / 86400; if ( $cur->n > 400 && $days > 180 ) { $this->mUserDays = 0x7fffffff; @@ -247,7 +251,9 @@ class BoardVoteForm { $old = wfFetchObject( $res ); wfFreeResult( $res ); - $signup = min( wfTimestamp2Unix( $old->t ), $signup ); + if ( !is_null( $old->t ) ) { + $signup = min( wfTimestamp2Unix( $old->t ), $signup ); + } $this->mUserDays = (int)(($now - $signup) / 86400); $this->mUserEdits = $cur->n + $old->n; }