Типа я (zilogic) wrote in changelog,
Типа я
zilogic
changelog

[ljcom] r12902: LJSUP-14092: Suspicious Login Notificati...

Committer: amyshkin
LJSUP-14092: Suspicious Login Notification
U   trunk/bin/upgrading/en_LJ.dat
U   trunk/bin/upgrading/proplists-local.dat
U   trunk/cgi-bin/LJ/Hooks/Login.pm
Modified: trunk/bin/upgrading/en_LJ.dat
===================================================================
--- trunk/bin/upgrading/en_LJ.dat	2012-11-14 13:12:13 UTC (rev 12901)
+++ trunk/bin/upgrading/en_LJ.dat	2012-11-15 11:15:46 UTC (rev 12902)
@@ -19588,3 +19588,15 @@
 http://www.livejournal.com/
 .
 
+suspisious.login.subject=Authorization with a new device
+suspisious.login.body<<
+Предупреждение о том, что кто-то авторизовался с другого устройства.
+
+If you suspect that someone else uses your account, you can check login sessions history, or change you password.
+FAQ #117 "What should I do if someone breaks into my LiveJournal account?"
+
+--
+
+LiveJournal.com Team
+http://www.livejournal.com
+.

Modified: trunk/bin/upgrading/proplists-local.dat
===================================================================
--- trunk/bin/upgrading/proplists-local.dat	2012-11-14 13:12:13 UTC (rev 12901)
+++ trunk/bin/upgrading/proplists-local.dat	2012-11-15 11:15:46 UTC (rev 12902)
@@ -62,6 +62,14 @@
   multihomed: 0
   prettyname: User banned from specified promos
 
+userproplist.check_suspicious:
+  cldversion: 8
+  datatype: char
+  des: Check user for suspicious login
+  indexed: 0
+  multihomed: 0
+  prettyname: Check user for suspicious login
+
 userproplist.check_non_whitelist:
   cldversion: 8
   datatype: char

Modified: trunk/cgi-bin/LJ/Hooks/Login.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/Login.pm	2012-11-14 13:12:13 UTC (rev 12901)
+++ trunk/cgi-bin/LJ/Hooks/Login.pm	2012-11-15 11:15:46 UTC (rev 12902)
@@ -2,6 +2,7 @@
 
 package LJ::LJcom;
 use strict;
+use LJ::CheckLogin;
 
 LJ::register_hook('post_login_news', sub {
     my $opts = shift;
@@ -113,6 +114,19 @@
     $u->set_prop('secret_question_fails', '');
 });
 
+LJ::register_hook("user_login", sub {
+    my $u = shift;
+
+    LJ::load_user_props($u, 'check_suspicious');
+
+    return if $u->prop('check_suspicious') eq 'no';
+
+    if ( LJ::CheckLogin::is_suspicious($u) ) {
+        LJ::CheckLogin::notify( $u ) unless $LJ::DISABLED{'suspicious_login_notify'};
+        LJ::CheckLogin::save_stat( $u ) unless $LJ::DISABLED{'suspicious_login_statistics'};
+    }
+});
+
 LJ::register_hook("may_secret", sub {
     my $u = shift;
 

Tags: amyshkin, dat, ljcom, pm, zilogic
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