wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r17358: LJSUP-6772.

Committer: gprochaev
LJSUP-6772.

U   trunk/bin/upgrading/en.dat
U   trunk/cgi-bin/LJ/Event/CommunityJoinReject.pm
U   trunk/cgi-bin/communitylib.pl
U   trunk/htdocs/community/pending.bml
U   trunk/htdocs/reject.bml
Modified: trunk/bin/upgrading/en.dat
===================================================================
--- trunk/bin/upgrading/en.dat	2010-09-13 07:03:34 UTC (rev 17357)
+++ trunk/bin/upgrading/en.dat	2010-09-13 07:33:56 UTC (rev 17358)
@@ -1516,24 +1516,14 @@
 
 esn.comm_join_reject.email_text|staleness=1
 esn.comm_join_reject.email_text<<
-Dear [[user]],
-
-Your request to join the "[[community]]" community has been declined.
-
-Replies to this email are not sent to the community's maintainer(s). If you would 
-like to discuss the reasons for your request's rejection, you will need to contact 
-a maintainer directly.
-
-Regards,
+Dear [[username]],<br> 
+<br>
+Your request to join the [[community]] community has been declined by the maintainer(s) of the community for the following reason: [[reason]]. <br/>
+<br/>
+Replies to this email are not sent to the community's maintainer(s). If you would like to discuss the reasons your membership request was rejected, you will need to contact a maintainer directly. Maintainers are listed on the community's Profile page. <br/>
+<br/>
+Regards, </br>
 [[sitename]] Team
-<p align="left" style="font-size: 10px;"><a href="[[siteroot]]">LiveJournal Inc 2007 All Rights Reserved.</a></p>
-<p align="left">
-<a href="[[siteroot]]/support/faq.bml">FAQs</a> |
-<a href="http://news.livejournal.com">[[sitenameshort]] News</a> |
-<a href="[[siteroot]]/site/search.bml">Explore [[sitenameshort]]</a> |
-<a href="[[siteroot]]/shop/">Gift Shop</a> |
-<a href="[[siteroot]]/legal">Site Policies</a>
-</p>
 
 .
 
@@ -1544,14 +1534,6 @@
 
 Regards,
 [[sitename]] Team
-<p align="left" style="font-size: 10px;"><a href="[[siteroot]]">LiveJournal Inc 2007 All Rights Reserved.</a></p>
-<p align="left">
-<a href="[[siteroot]]/support/faq.bml">FAQs</a> |
-<a href="http://news.livejournal.com">[[sitenameshort]] News</a> |
-<a href="[[siteroot]]/site/search.bml">Explore [[sitenameshort]]</a> |
-<a href="[[siteroot]]/shop/">Gift Shop</a> |
-<a href="[[siteroot]]/legal">Site Policies</a>
-</p>
 
 .
 

Modified: trunk/cgi-bin/LJ/Event/CommunityJoinReject.pm
===================================================================
--- trunk/cgi-bin/LJ/Event/CommunityJoinReject.pm	2010-09-13 07:03:34 UTC (rev 17357)
+++ trunk/cgi-bin/LJ/Event/CommunityJoinReject.pm	2010-09-13 07:33:56 UTC (rev 17358)
@@ -21,6 +21,8 @@
 
 my @_ml_strings_en = (
     'esn.comm_join_reject.email_subject',  # 'Your Request to Join [[community]] community',
+    'esn.comm_join_reject.maint.email_text', # 
+
     'esn.comm_join_reject.alert',          # 'Your request to join [[community]] community has been declined.',
     'esn.comm_join_reject.email_text',      # 'Dear [[user]],
                                             #
@@ -139,11 +141,11 @@
 
     my $mt  = LJ::load_userid($self->{'args'}[0]);
     my $remover = LJ::load_userid($self->{'args'}[1]);
-    my $rej_u = LJ::load_userid($self->{'args'}[2]);
     $cu = LJ::load_userid($self->{'userid'}) unless $cu->is_community;
     my $reason = $self->{'args'}[3];
 
     if ($mt && $mt->can_manage ($cu)) {
+        my $rej_u = LJ::load_userid($self->{'args'}[2]);
         my $lang    = $mt->prop('browselang');
         return LJ::Lang::get_text($lang, 'esn.comm_join_reject.maint.email_text', undef, {
                 user        => $mt->ljuser_display,
@@ -155,16 +157,17 @@
                 siteroot    => $LJ::SITEROOT,
         });
     } else {
+        my $rej_u = LJ::load_userid($self->{'args'}[0]);
         # Precache text lines
         my $lang    = $u->prop('browselang');
-        #LJ::Lang::get_text_multi($lang, undef, \@_ml_strings_en);
+        LJ::Lang::get_text_multi($lang, undef, \@_ml_strings_en);
 
         my $vars = {
-                'user'      => $u->{name},
-                'username'  => $u->{name},
-                'community' => $cu->{user},
-                'sitename'  => $LJ::SITENAME,
-                'siteroot'  => $LJ::SITEROOT,
+                username    => $rej_u ? $rej_u->ljuser_display : '',
+                community   => $cu->ljuser_display,
+                reason      => $reason,
+                sitename    => $LJ::SITENAME,
+                siteroot    => $LJ::SITEROOT,
         };
 
         return LJ::Lang::get_text($lang, 'esn.comm_join_reject.email_text', undef, $vars);

Modified: trunk/cgi-bin/communitylib.pl
===================================================================
--- trunk/cgi-bin/communitylib.pl	2010-09-13 07:03:34 UTC (rev 17357)
+++ trunk/cgi-bin/communitylib.pl	2010-09-13 07:33:56 UTC (rev 17358)
@@ -578,7 +578,8 @@
 ## LJ::reject_pending_member($cid, $id, $remote->{userid}, $POST{'reason'});
 sub reject_pending_member {
     my ($commid, $userid, $maintid, $reason) = @_;
-    $reason = LJ::Lang::ml('/community/pending.bml.reason.default.text') if $reason == 0;
+
+    $reason = LJ::Lang::ml('/community/pending.bml.reason.default.text') if $reason eq '0';
     my $cu = LJ::want_user($commid);
     my $u = LJ::want_user($userid);
     my $mu = LJ::want_user($maintid);
@@ -586,6 +587,7 @@
 
     # step 1, update authactions table
     my $dbh = LJ::get_db_writer();
+
     my $count = $dbh->do("UPDATE authactions SET used = 'Y' WHERE userid = ? AND arg1 = ?",
                          undef, $cu->{userid}, "targetid=$u->{userid}");
     return unless $count;
@@ -600,13 +602,13 @@
     );
 
     # step 2, email the user
-    my %params = (event => 'CommunityJoinReject', journal => $u);
+    my %params = (event => 'CommunityJoinReject', journal => $cu);
     unless ($u->has_subscription(%params)) {
         $u->subscribe(%params, method => 'Email');
     }
 
     # Email to user about rejecting
-    LJ::Event::CommunityJoinReject->new($u, $cu)->fire unless $LJ::DISABLED{esn};
+    LJ::Event::CommunityJoinReject->new($cu, $u, undef, undef, $reason)->fire unless $LJ::DISABLED{esn};
 
     # Email to maints about user rejecting
     my $maintainers = LJ::load_rel_user($commid, 'A');

Modified: trunk/htdocs/community/pending.bml
===================================================================
--- trunk/htdocs/community/pending.bml	2010-09-13 07:03:34 UTC (rev 17357)
+++ trunk/htdocs/community/pending.bml	2010-09-13 07:33:56 UTC (rev 17358)
@@ -139,29 +139,6 @@
                         $rejected++; # for keeping this user in list for later reject
                     }
                 }
-                if ($POST{"reject"} or $POST{"reject_ban"}) {
-                    LJ::send_mail({ 'to' => $us->{$id}->email_raw,
-                                    'from' => $LJ::ACCOUNTS_EMAIL,
-                                    'fromname' => $LJ::SITENAMESHORT,
-                                    'wrap' => 1,
-                                    'charset' => 'utf-8',
-                                    'subject' => LJ::Lang::ml ('pending.mail.reject.subject', { community => $cname }),
-                                    'html'    => ( LJ::Lang::ml ('pending.mail.reject.body', 
-                                                    {
-                                                        community => $c->ljuser_display,
-                                                        username  => $us->{$id}->ljuser_display,
-                                                        reason    => $reason,
-                                                        sitename  => $LJ::SITENAMESHORT,
-                                                    }
-                                                ).
-                                                    LJ::Lang::ml ('esn.footer.html', 
-                                                    {
-                                                        siteroot    => $LJ::SITEROOT,
-                                                    }
-                                                )
-                                                )
-                                           });
-                }
             }
 
             $previous = $POST{'previous'};

Modified: trunk/htdocs/reject.bml
===================================================================
--- trunk/htdocs/reject.bml	2010-09-13 07:03:34 UTC (rev 17357)
+++ trunk/htdocs/reject.bml	2010-09-13 07:33:56 UTC (rev 17358)
@@ -33,7 +33,7 @@
         return LJ::bad_input($ML{'.error.internerr.invalidaction'}) unless $targetid;
 
         return "<?h1 $ML{'Error'} h1?><?p $ML{'.error.rejecting'} p?>"
-            unless LJ::reject_pending_member($aa->{userid}, $targetid, $mnt);
+            unless LJ::reject_pending_member($aa->{userid}, $targetid, $mnt, 0);
 
         # return success
         my $commname = LJ::get_username($aa->{userid});

Tags: bml, dat, livejournal, pl, pm, wisest-owl
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