Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r16131: LJSV-889: add some links to userlog.bml

Committer: ailyin
LJSV-889: add some links to userlog.bml

U   trunk/htdocs/admin/console/index.bml
U   trunk/htdocs/admin/userlog.bml
Modified: trunk/htdocs/admin/console/index.bml
===================================================================
--- trunk/htdocs/admin/console/index.bml	2010-01-25 09:28:42 UTC (rev 16130)
+++ trunk/htdocs/admin/console/index.bml	2010-01-25 10:56:22 UTC (rev 16131)
@@ -5,7 +5,7 @@
 
  use strict;
  use LJ::Console;
- use vars qw(%POST %cmd);
+ use vars qw(%POST %GET %cmd);
 
  my ($ret, $sth);
  my $commands = $POST{'commands'};
@@ -42,7 +42,7 @@
      $ret .= "</TR>";
      $ret .= "<TR><TD COLSPAN=2>";
      $ret .= "<P><tt>enter commands:</tt><BR>";
-     $ret .= "<TEXTAREA NAME=commands ROWS=10 COLS=60 WRAP=OFF></TEXTAREA></TD></TR>\n";
+     $ret .= "<TEXTAREA NAME=commands ROWS=10 COLS=60 WRAP=OFF>".LJ::ehtml($GET{'prefill'})."</TEXTAREA></TD></TR>\n";
      $ret .= "<TR><TD COLSPAN=2 ALIGN=RIGHT><INPUT TYPE=SUBMIT VALUE=\"execute\"></P></TD></TR></TABLE></FORM>\n";
      return $ret;
  }

Modified: trunk/htdocs/admin/userlog.bml
===================================================================
--- trunk/htdocs/admin/userlog.bml	2010-01-25 09:28:42 UTC (rev 16130)
+++ trunk/htdocs/admin/userlog.bml	2010-01-25 10:56:22 UTC (rev 16131)
@@ -65,6 +65,15 @@
     $ret .= join('', map { "<th class='logrow'>$_</th>" } ("Date and Time", "Action", "Initiator", "IP Address", "Uniq Cookie"));
     $ret .= "</tr>\n";
 
+    my $format_email = sub {
+        my ($email) = @_;
+
+        my $cmd = LJ::eurl("finduser $email");
+        return qq{
+            <a href="$LJ::SITEROOT/admin/console?prefill=$cmd">$email</a>
+        };
+    };
+
     while (my $row = $sth->fetchrow_hashref) {
         my $extra = {};
         LJ::decode_url_string($row->{extra}, $extra);
@@ -101,7 +110,7 @@
         } elsif ($row->{action} eq 'password_reset') {
             $action = "User reset password via lost password email";
         } elsif ($row->{action} eq 'email_change') {
-            $action = "Email address changed to: $extra->{new}";
+            $action = "Email address changed to: ".$format_email->($extra->{'new'});
         } elsif ($row->{action} eq 'mass_privacy_change') {
             $action = "Entry privacy updated (from $extra->{s_security} to $extra->{e_security})";
             # TODO: parse out e_unixtime and s_unixtime and display?
@@ -109,6 +118,7 @@
             $action = "Deleted userpic #$extra->{picid}";
         } elsif ($row->{action} eq 'pwd_reset_req') {
             my $email = $extra->{email};
+            $email = $format_email->($email);
             my $email_state = {
                 'A' => 'current, validated',
                 'T' => 'current, transitioning',
@@ -134,7 +144,11 @@
         }
 
         my $ip = $row->{ip} || "<em>not recorded</em>";
-        my $uniq = $row->{uniq} || "<em>not recorded</em>";
+        my $uniq = $row->{uniq} ? qq{
+            <a href="$LJ::SITEROOT/admin/uniq.bml?what=$row->{uniq}">
+                $row->{uniq}
+            </a>
+        } : "<em>not recorded</em>";
 
         $ret .= "<tr>" . join('', map { "<td class='logrow'>$_</td>" } ($time, $action, $actor, $ip, $uniq)) . "</tr>\n";
     }

Tags: andy, bml, livejournal
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