Committer: ailyin
LJSUP-8849 (get rid of 'my if'-like constructs in cgi-bin)U trunk/cgi-bin/LJ/Sponsored/User.pm U trunk/cgi-bin/LJ/Widget/Shop/View/Userpics.pm U trunk/cgi-bin/ljcom.pl
Modified: trunk/cgi-bin/LJ/Sponsored/User.pm =================================================================== --- trunk/cgi-bin/LJ/Sponsored/User.pm 2011-05-19 04:27:34 UTC (rev 10524) +++ trunk/cgi-bin/LJ/Sponsored/User.pm 2011-05-19 07:45:47 UTC (rev 10525) @@ -471,7 +471,9 @@ my ($subject, $body, $u, $force_send_to_not_validated) = @_; $u ||= $self->ljuser; - my $email = $u->email_raw + + my $email = undef; + $email = $u->email_raw if $u->is_validated || $force_send_to_not_validated; if ($email) { Modified: trunk/cgi-bin/LJ/Widget/Shop/View/Userpics.pm =================================================================== --- trunk/cgi-bin/LJ/Widget/Shop/View/Userpics.pm 2011-05-19 04:27:34 UTC (rev 10524) +++ trunk/cgi-bin/LJ/Widget/Shop/View/Userpics.pm 2011-05-19 07:45:47 UTC (rev 10525) @@ -99,8 +99,10 @@ my $remote = LJ::get_remote(); my $gift = (LJ::Request->get_param('gift') && LJ::Request->get_param('giftto')) || 0; - my $recipient = LJ::load_user(LJ::Request->get_param('giftto')) if $gift; + my $recipient = undef; + $recipient = LJ::load_user(LJ::Request->get_param('giftto')) if $gift; + my %res = (); if ($remote) { my $lines = $self->prepare_lines_for_user ($remote); Modified: trunk/cgi-bin/ljcom.pl =================================================================== --- trunk/cgi-bin/ljcom.pl 2011-05-19 04:27:34 UTC (rev 10524) +++ trunk/cgi-bin/ljcom.pl 2011-05-19 07:45:47 UTC (rev 10525) @@ -1876,54 +1876,6 @@ return undef; }); -# args: $u -# extra status information for subscriptions -LJ::register_hook('sub_status_extra', sub { - my $u = shift; - return '' if $u->in_class('paid'); - - my $paid_max = LJ::get_cap('paid', 'subscriptions'); - - my $better = $u->in_class('plus') ? 'Paid' : 'Plus'; - - my $ret = ''; - - my $sub_count = grep { $_->active && $_->enabled } $u->find_subscriptions(method => 'Inbox'); - my $sub_max = $u->get_cap('subscriptions'); - my $event_plural = $sub_count == 1 ? 'event' : 'events'; - - # link to manage settings (if not at manage settings) - my $managelink = qq { | Manage subscriptions in the <a href="$LJ::SITEROOT/manage/subscriptions/index.bml"> - Manage Settings</a> page<br/> - } unless BML::get_uri() =~ m!/manage/subscriptions/index.bml!i; - - my $getmore; - - if (! $u->in_class('plus')) { - # basic - $getmore .= qq { - <div>Get more features by upgrading to a $better Account. - <a href="$LJ::SITEROOT/manage/payments/">Learn more...</a></div> - }; - } else { - # plus - $getmore .= qq { - <div>Get more notices by upgrading to a $better Account. - <a href="$LJ::SITEROOT/manage/payments/">Learn more...</a></div> - }; - } - - my $subscribedto = $u->in_class('plus') ? '' : "You are subscribed to $sub_count $event_plural ($sub_max available) $managelink"; - - return qq { - <div id="SubscriptionInfo"> - $subscribedto - $getmore - </div> - }; -}); - - LJ::register_hook('ad_layout_blurb', sub { my $u = shift; my $ret = "";