fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-11-01 02:13 pm

[dw-free] prevent entry deletion from memorial accounts

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

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

Block memorial accounts from logging in through the site, and from any
activity requiring authentication in the protocol, as a security measure.

Patch by [personal profile] fu.

Files modified:
  • bin/upgrading/en.dat
  • cgi-bin/ljprotocol.pl
  • htdocs/login.bml
--------------------------------------------------------------------------------
diff -r 5ef2e7002a9e -r a7cc201be96d bin/upgrading/en.dat
--- a/bin/upgrading/en.dat	Mon Nov 01 21:25:28 2010 +0800
+++ b/bin/upgrading/en.dat	Mon Nov 01 22:13:33 2010 +0800
@@ -1224,6 +1224,8 @@ error.malformeduser=Malformed username.
 error.malformeduser=Malformed username.
 
 error.mediauploadsdisabled=Media modifications are temporarily disabled at this time.  Some or all of the features on this page are currently down.
+
+error.memorial.text=This journal is a memorial account. You cannot log in, post new entries, or edit existing ones.
 
 error.message.canreceive=This message cannot be sent to [[ljuser]] because the recipient has enabled the privacy options for their messages.
 
diff -r 5ef2e7002a9e -r a7cc201be96d cgi-bin/ljprotocol.pl
--- a/cgi-bin/ljprotocol.pl	Mon Nov 01 21:25:28 2010 +0800
+++ b/cgi-bin/ljprotocol.pl	Mon Nov 01 22:13:33 2010 +0800
@@ -3191,6 +3191,7 @@ sub authenticate
 
     return fail( $err, 100 ) unless $u;
     return fail( $err, 100 ) if $u->is_expunged;
+    return fail( $err, 309 ) if $u->is_memorial;    # memorial users can't do anything
     return fail( $err, 505 ) unless $u->{clusterid};
 
     my $r = DW::Request->get;
diff -r 5ef2e7002a9e -r a7cc201be96d htdocs/login.bml
--- a/htdocs/login.bml	Mon Nov 01 21:25:28 2010 +0800
+++ b/htdocs/login.bml	Mon Nov 01 22:13:33 2010 +0800
@@ -281,6 +281,7 @@ _c?>
                     unless $u;
             } else {
                 push @errors, [ purged_user => "$ML{'error.purged.text'}" ] if $u->is_expunged;
+                push @errors, [ memorial_user => $ML{'error.memorial.text'} ] if $u->is_memorial;
                 push @errors, [ community_disabled_login => "$ML{'error.nocommlogin'}" ]
                     if $u->is_community && ! LJ::is_enabled('community-logins');
             }
--------------------------------------------------------------------------------