Committer: ailyin
LJSUP-13914 (Suspend identity account with sysbanned email)U trunk/cgi-bin/LJ/Identity/Facebook.pm U trunk/cgi-bin/LJ/Identity/MailRU.pm
Modified: trunk/cgi-bin/LJ/Identity/Facebook.pm =================================================================== --- trunk/cgi-bin/LJ/Identity/Facebook.pm 2012-12-04 08:42:41 UTC (rev 12987) +++ trunk/cgi-bin/LJ/Identity/Facebook.pm 2012-12-04 10:42:31 UTC (rev 12988) @@ -153,10 +153,17 @@ } # email - $u->set_email($userdata->{'email'}); + my $email = $userdata->{'email'}; + $u->set_email($email); + # we don't care, set it as validated as well: LJ::update_user($u, { 'status' => 'A' }); + # but ensure that if that email matches a sysban, the account gets + # suspended as appropriate + LJ::run_hook( 'post_email_change', + { 'user' => $u, 'newemail' => $email, 'suspend' => 1 } ); + # website $u->set_prop('url' => $userdata->{'website'}); Modified: trunk/cgi-bin/LJ/Identity/MailRU.pm =================================================================== --- trunk/cgi-bin/LJ/Identity/MailRU.pm 2012-12-04 08:42:41 UTC (rev 12987) +++ trunk/cgi-bin/LJ/Identity/MailRU.pm 2012-12-04 10:42:31 UTC (rev 12988) @@ -108,8 +108,14 @@ status => 'A', # we don't care, set it as validated as well }); - $u->set_email($userdata->{'email'}); + my $email = $userdata->{'email'}; + $u->set_email($email); + # ensure that if that email matches a sysban, the account gets + # suspended as appropriate + LJ::run_hook( 'post_email_change', + { 'user' => $u, 'newemail' => $email, 'suspend' => 1 } ); + # userpic $res = $ua->get($userdata->{'pic'}); my $upicdata = eval { $res->content };