body<= {'user'}; my $u = LJ::get_authas_user($authas); return LJ::bad_input($ML{'error.invalidauth'}) unless $u; my $firstdate = $dbh->selectrow_array(qq{ SELECT MIN(timechange) FROM infohistory WHERE userid=? AND what='email' AND oldvalue=? }, undef, $u->{'userid'}, $u->{'email'}); my @deleted; if (LJ::did_post() && $u->{'status'} eq 'A') { my $sth = $dbh->prepare("SELECT timechange, oldvalue " . "FROM infohistory WHERE userid=? " . "AND what='email' ORDER BY timechange"); $sth->execute($u->{'userid'}); while (my ($time, $email) = $sth->fetchrow_array) { my $can_del = defined $firstdate && $time gt $firstdate; if ($can_del && $POST{"$email-$time"}) { push @deleted, BML::ml('.log.deleted', { 'email' => $email, 'time' => $time }); $dbh->do("UPDATE infohistory SET what='emaildeleted' WHERE what='email' " . "AND userid=? AND timechange=? AND oldvalue=?", undef, $u->{'userid'}, $time, $email); } } } my $ret; # authas switcher form $ret .= "
\n"; $ret .= LJ::make_authas_select($remote, { 'authas' => $GET{'authas'} }) . "\n"; $ret .= "
\n\n"; # some explanatory text $ret .= "\n"; $ret .= "\n"; $ret .= "\n"; $ret .= "\n"; unless ($u->{'status'} eq "A") { $ret .= "\n"; $ret .= " $u->{'email'} }) . " p?>"; return $ret; } # current address $ret .= "\n"; $ret .= "
"; $ret .= "$u->{'email'}
\n"; # old addresses $ret .= "\n"; $ret .= ""; my $sth = $dbh->prepare("SELECT timechange, oldvalue FROM infohistory " . "WHERE userid=? AND what='email' " . "ORDER BY timechange"); $sth->execute($u->{'userid'}); my $rows; while (my ($time, $email) = $sth->fetchrow_array) { my $can_del = defined $firstdate && $time gt $firstdate; $rows .= "" . LJ::html_check({ 'type' => 'check', 'name' => "$email-$time", 'disabled' => ! $can_del } ) . ""; $rows .= "$email$time\n"; } if ($rows) { my $getextra = $authas ne $remote->{'user'} ? "?authas=$authas" : ''; $ret .= "
"; $ret .= "\n"; $ret .= $rows; $ret .= "
\n"; $ret .= LJ::html_submit(undef, $ML{'.delete_selected'}); $ret .= "
"; } else { $ret .= "
$ML{'.address.old.none'}
\n"; } if (@deleted) { $ret .= "\n"; $ret .= ""; } return $ret; } _code?> <=body page?>