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-21 11:08 pm

[dw-free] Disallow messaging an unvalidated user

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

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

Disallow PMs to unvalidated accounts.

Patch by [community profile] isabeau.

Files modified:
  • bin/upgrading/en.dat
  • htdocs/inbox/compose.bml
--------------------------------------------------------------------------------
diff -r 580fdd809f33 -r bcb29b989800 bin/upgrading/en.dat
--- a/bin/upgrading/en.dat	Sat Mar 21 23:06:32 2009 +0000
+++ b/bin/upgrading/en.dat	Sat Mar 21 23:08:06 2009 +0000
@@ -1333,6 +1333,8 @@ error.message.expunged=This message cann
 error.message.expunged=This message cannot be sent to [[ljuser]] because the journal has been deleted.
 
 error.message.individual=Message can only be sent to individual users, not [[ljuser]].
+
+error.message.unvalidated=This message cannot be sent to [[ljuser]] because the recipient's email address has not been validated.
 
 error.nobutton=No button pressed?
 
diff -r 580fdd809f33 -r bcb29b989800 htdocs/inbox/compose.bml
--- a/htdocs/inbox/compose.bml	Sat Mar 21 23:06:32 2009 +0000
+++ b/htdocs/inbox/compose.bml	Sat Mar 21 23:08:06 2009 +0000
@@ -82,6 +82,12 @@ body<=
                 # Can only send to other individual users
                 unless ($tou->is_person || $tou->is_identity || $tou->is_renamed) {
                     push @errors, BML::ml('error.message.individual', { 'ljuser' => $tou->ljuser_display });
+                    next;
+                }
+
+                # Can't send to unvalidated users
+                unless ($tou->is_validated) {
+                    push @errors, BML::ml('error.message.unvalidated', { 'ljuser' => $tou->ljuser_display });
                     next;
                 }
 
--------------------------------------------------------------------------------