mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-03-12 08:02 am

[dw-free] /manage/logins.bml not showing user agents

[commit: http://hg.dwscoalition.org/dw-free/rev/b3abd7b3cb2b]

http://bugs.dwscoalition.org/show_bug.cgi?id=474

Fix loginlog to record useragent, broke in Apache2 conversion.

Patch by [personal profile] afuna.

Files modified:
  • cgi-bin/LJ/User.pm
--------------------------------------------------------------------------------
diff -r c57348be7172 -r b3abd7b3cb2b cgi-bin/LJ/User.pm
--- a/cgi-bin/LJ/User.pm	Thu Mar 12 07:57:58 2009 +0000
+++ b/cgi-bin/LJ/User.pm	Thu Mar 12 08:02:32 2009 +0000
@@ -1024,12 +1024,9 @@ sub record_login {
     $u->do("DELETE FROM loginlog WHERE userid=? AND logintime < ?",
            undef, $u->{userid}, $too_old);
 
-    my ($ip, $ua);
-    eval {
-        my $r  = BML::get_request();
-        $ip = LJ::get_remote_ip();
-        $ua = $r->header_in('User-Agent');
-    };
+    my $r  = DW::Request->get;
+    my $ip = LJ::get_remote_ip();
+    my $ua = $r->header_in('User-Agent');
 
     return $u->do("INSERT INTO loginlog SET userid=?, sessid=?, logintime=UNIX_TIMESTAMP(), ".
                   "ip=?, ua=?", undef, $u->{userid}, $sessid, $ip, $ua);
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org