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

[livejournal] r21106: LJSUP-11154 (Script for deleting inactin...

Committer: ailyin
LJSUP-11154 (Script for deleting inactine accounts shouldn't delete account if it change password)
U   trunk/cgi-bin/LJ/User.pm
Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2012-02-06 11:33:52 UTC (rev 21105)
+++ trunk/cgi-bin/LJ/User.pm	2012-02-06 11:37:20 UTC (rev 21106)
@@ -2321,6 +2321,21 @@
     return $time;
 }
 
+sub last_password_change_time {
+    my ($u) = @_;
+
+    my $dbr = LJ::get_db_reader();
+    my ($time) = $dbr->selectrow_array(
+        'SELECT UNIX_TIMESTAMP(MAX(timechange)) FROM infohistory ' .
+        'WHERE userid=? AND what="password"',
+        undef,
+        $u->userid,
+    );
+
+    $time ||= 0;
+    return $time;
+}
+
 # THIS IS DEPRECATED DO NOT USE
 sub email {
     my ($u, $remote) = @_;

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