Fix some errors when you view certain pages while logged out.

        Patch by afuna. 

diffs (35 lines):

diff -r a98b3118e1da -r acc72c6b6b65 cgi-bin/DW/Setting/XPostAccounts.pm
--- a/cgi-bin/DW/Setting/XPostAccounts.pm       Mon Dec 07 04:42:18 2009 +0000
+++ b/cgi-bin/DW/Setting/XPostAccounts.pm       Mon Dec 07 04:57:39 2009 +0000
@@ -33,7 +33,7 @@ sub label {
 # adding new accounts.
 sub option {
     my ($class, $u, $errs, $args, %opts) = @_;
-    my $key = $class->pkgkey;
+    return unless LJ::isu( $u );
 
     # first load up the existing accounts.
     my @accounts = DW::External::Account->get_external_accounts($u);
diff -r a98b3118e1da -r acc72c6b6b65 htdocs/login.bml
--- a/htdocs/login.bml  Mon Dec 07 04:42:18 2009 +0000
+++ b/htdocs/login.bml  Mon Dec 07 04:57:39 2009 +0000
@@ -286,7 +286,7 @@
                     if $u->is_community && ! 
LJ::is_enabled('community-logins');
             }
 
-            if ( $u->is_readonly ) {
+            if ( $u && $u->is_readonly ) {
                 return if $want_fail_redirect->("database_readonly");
 
                 $body = LJ::bad_input("The database is temporarily in 
read-only mode, so creating new login sessions is temporarily down.  Please try 
again later.");
diff -r a98b3118e1da -r acc72c6b6b65 htdocs/manage/emailpost.bml
--- a/htdocs/manage/emailpost.bml       Mon Dec 07 04:42:18 2009 +0000
+++ b/htdocs/manage/emailpost.bml       Mon Dec 07 04:57:39 2009 +0000
@@ -36,6 +36,7 @@ body<=
     return LJ::server_down_html() if $LJ::SERVER_DOWN;
 
     my $u = LJ::get_remote();
+    return "<?needlogin?>" unless $u;
     return $LJ::MSG_READONLY_USER if $u->is_readonly;
     my @props =
       qw/
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to