Adds join link for site-schemed pages. (Communities using S2 pages will 
still see the old-style/nonhelpful error messages.)

        Patch by denise. 

diffs (36 lines):

diff -r 17691223abbd -r 3040b4b921c5 bin/upgrading/en.dat
--- a/bin/upgrading/en.dat      Sun Jul 05 10:47:29 2009 +0000
+++ b/bin/upgrading/en.dat      Sun Jul 05 11:01:43 2009 +0000
@@ -3459,6 +3459,10 @@ talk.error.nosuchjournal=No such journal
 
 talk.error.notauthorised=You are not authorized to view this protected entry.
 
+talk.error.notauthorised.comm.open=This protected entry is viewable by 
community members only. Would you like to <a [[aopts]]>join the community</a>?
+
+talk.error.notauthorised.comm.closed=This protected entry is viewable by 
community members only. Membership to this community is closed.
+
 talk.error.purged=This journal has been deleted and purged.
 
 talk.error.readonly_journal=This journal is read-only. You cannot comment in 
it.
diff -r 17691223abbd -r 3040b4b921c5 cgi-bin/talklib.pl
--- a/cgi-bin/talklib.pl        Sun Jul 05 10:47:29 2009 +0000
+++ b/cgi-bin/talklib.pl        Sun Jul 05 11:01:43 2009 +0000
@@ -293,8 +293,17 @@ sub check_viewable
     };
 
     unless (LJ::can_view($remote, $item)) {
+        my $journal = LJ::load_userid( $item->{ownerid} );
+        my $journalname = $journal->username;
+
         if (defined $remote) {
-            return $err->(BML::ml('talk.error.notauthorised'));
+            if ( $journal->is_community && ! $journal->is_closed_membership && 
$remote ) {
+                return $err->( BML::ml( 'talk.error.notauthorised.comm.open', 
{ aopts => "href='$LJ::SITEROOT/community/join.bml?comm=$journalname'" } ) );
+            } elsif ( $journal->is_community && $journal->is_closed_membership 
) {
+                return $err->( BML::ml( 'talk.error.notauthorised.comm.closed' 
) );
+            } else {
+                return $err->( BML::ml( 'talk.error.notauthorised' ) );
+            }
         } else {
             my $r = BML::get_request();
             my $host = $r->headers_in->{Host};
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to