[dw-free] Some pages erroring out if you try to access them when logged out
[commit: http://hg.dwscoalition.org/dw-free/rev/acc72c6b6b65]
http://bugs.dwscoalition.org/show_bug.cgi?id=2134
Fix some errors when you view certain pages while logged out.
Patch by
afuna.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=2134
Fix some errors when you view certain pages while logged out.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- cgi-bin/DW/Setting/XPostAccounts.pm
- htdocs/login.bml
- htdocs/manage/emailpost.bml
-------------------------------------------------------------------------------- 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/ --------------------------------------------------------------------------------
no subject