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

[livejournal] r19124: LJSUP-8788 (incorrect text message when ...

Committer: ailyin
LJSUP-8788 (incorrect text message when anonymous try to post comments)
U   trunk/cgi-bin/LJ/Talk/Author/User.pm
U   trunk/cgi-bin/LJ/Talk.pm
U   trunk/htdocs/talkpost_do.bml.text
Modified: trunk/cgi-bin/LJ/Talk/Author/User.pm
===================================================================
--- trunk/cgi-bin/LJ/Talk/Author/User.pm	2011-05-25 05:02:57 UTC (rev 19123)
+++ trunk/cgi-bin/LJ/Talk/Author/User.pm	2011-05-25 06:46:40 UTC (rev 19124)
@@ -103,8 +103,18 @@
     }
 
     unless ($form->{'userpost'}) {
-        push @$errret,
-            LJ::Lang::ml("/talkpost_do.bml.error.nousername");
+        my $entry = LJ::Entry->new(
+            $init->{'journalu'},
+            'jitemid' => $init->{'itemid'}
+        );
+
+        if ( $entry && $entry->everyone_can_comment ) {
+            push @$errret,
+                LJ::Lang::ml('/talkpost_do.bml.error.nousername');
+        } else {
+            push @$errret,
+                LJ::Lang::ml('/talkpost_do.bml.error.nousername.noanon');
+        }
         return;
     }
 

Modified: trunk/cgi-bin/LJ/Talk.pm
===================================================================
--- trunk/cgi-bin/LJ/Talk.pm	2011-05-25 05:02:57 UTC (rev 19123)
+++ trunk/cgi-bin/LJ/Talk.pm	2011-05-25 06:46:40 UTC (rev 19124)
@@ -1731,6 +1731,12 @@
 
     my @author_options;
     my $usertype_default = $form->{'usertype'};
+
+    # LJSUP-8788; I admit this is a hack
+    if ( $usertype_default eq 'user' && !$form->{'userpost'} ) {
+        undef $usertype_default;
+    }
+
     foreach my $author_class (LJ::Talk::Author->all) {
         next unless $author_class->enabled;
 

Modified: trunk/htdocs/talkpost_do.bml.text
===================================================================
--- trunk/htdocs/talkpost_do.bml.text	2011-05-25 05:02:57 UTC (rev 19123)
+++ trunk/htdocs/talkpost_do.bml.text	2011-05-25 06:46:40 UTC (rev 19124)
@@ -48,6 +48,8 @@
 
 .error.nousername=You did not enter your LiveJournal username.  You can choose to post as "Anonymous" if you don't have a LiveJournal user account.
 
+.error.nousername.noanon=You did not enter your LiveJournal username.
+
 .error.noverify2=Sorry, you aren't allowed to post comments until your email address has been validated. If you've lost the confirmation email to do this, you can <a [[aopts]]>have it re-sent</a>.
 
 .error.postshared=You can't post as a shared or community account.  Shared accounts represent groups of people, not individual people.

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