ssafronova (ssafronova) wrote in changelog,
ssafronova
ssafronova
changelog

[livejournal] r18070: LJSUP-5494: Re-registered first validate...

Committer: ssafronova
LJSUP-5494: Re-registered first validated email cannot remove newer email addresses
U   trunk/cgi-bin/LJ/User.pm
U   trunk/htdocs/tools/emailmanage.bml
Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2011-01-20 11:07:57 UTC (rev 18069)
+++ trunk/cgi-bin/LJ/User.pm	2011-01-20 12:38:54 UTC (rev 18070)
@@ -2569,9 +2569,11 @@
         my @relevant = grep { lc($_->{email}) eq $lc_addr } @$emails;
             # already sorted by MySQL
 
-        my $step;
-        foreach $step (@relevant) {
+        my $written_addr;
+        foreach my $step (@relevant) {
 
+            $written_addr = $step->{email};
+
             next unless $step->{status} eq 'A'; # restoring can be done only by validated addressed
 
             if ($step->{deleted}) {
@@ -2593,8 +2595,8 @@
             $leaving = $step->{changed} unless defined $leaving and defined $step->{changed} and $step->{changed} < $leaving;
         }
 
-        if ($starting and time - $leaving < $LJ::EMAIL_FORGET_AGE) {
-            push @chains, { email => $step->{email}, leaving => $leaving, starting => $starting }; # fix this chain
+        if ($starting and time - $leaving < $LJ::EMAIL_FORGET_AGE or not defined $leaving) {
+            push @chains, { email => $written_addr, leaving => $leaving, starting => $starting }; # fix this chain
                 # we store address with upper case letters possibly,
                 # to make it more comfort for user when he/she reads address
         }

Modified: trunk/htdocs/tools/emailmanage.bml
===================================================================
--- trunk/htdocs/tools/emailmanage.bml	2011-01-20 11:07:57 UTC (rev 18069)
+++ trunk/htdocs/tools/emailmanage.bml	2011-01-20 12:38:54 UTC (rev 18070)
@@ -85,7 +85,7 @@
         my $can_delete_this = $u->can_delete_email($addr);
         $can_delete ||= $can_delete_this;
 
-        my $starting = $GET{debug} ? "<td>$addr->{starting}</td>" : "";
+        my $starting = $GET{debug} ? "<td>started: " . $dump_time->($addr->{starting}) . "</td>" : "";
 
         $ret .= "<tr><td>" . LJ::html_check({ 'type' => 'check', 'name' => "$addr->{email}",
                                               'disabled' => !$can_delete_this } ) . "</td>";

Tags: bml, livejournal, pm, ssafronova
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments