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

[livejournal] r17443: LJSUP-6879.

Committer: gprochaev
LJSUP-6879.
U   trunk/htdocs/community/pending.bml
Modified: trunk/htdocs/community/pending.bml
===================================================================
--- trunk/htdocs/community/pending.bml	2010-09-24 06:25:35 UTC (rev 17442)
+++ trunk/htdocs/community/pending.bml	2010-09-24 07:44:55 UTC (rev 17443)
@@ -64,10 +64,14 @@
         my @userids = split(',', $POST{'ids'});
         my @is_selected = grep { defined $POST{"pending_$_"} } @userids;
 
-        $ret .= (($POST{'reject_select'} eq '1' and $POST{'approve'} and scalar @is_selected ) or $POST{'reject_done'} eq '1')
-                ? "<?h1 $ML{'/community/members.bml.success.header'} h1?><?p $ML{'/community/members.bml.success.message'} p?>"
-                : "<?h1 $ML{'/community/members.bml.success_empty.header'} h1?><?p $ML{'/community/members.bml.success_empty.message'} p?>";
+        if (($POST{'reject_select'} eq '1' or $POST{'approve'}) and scalar @is_selected == 0) {
+            $ret .= "<?h1 $ML{'/community/members.bml.success_empty.header'} h1?><?p $ML{'/community/members.bml.success_empty.message'} p?>";
+        }
 
+        if ($POST{'reject_done'} eq '1' or ($POST{'approve'} and scalar @is_selected)) {
+            $ret .= "<?h1 $ML{'/community/members.bml.success.header'} h1?><?p $ML{'/community/members.bml.success.message'} p?>";
+        }
+ 
         if ($POST{'reject_select'} eq '1' and scalar @is_selected) {
             $ret .= '<div class="b-pending">';
 
@@ -94,7 +98,7 @@
                     $added++;
                 }
             }
-            if ($POST{"approve"}) {
+            if ($POST{"approve"} and scalar @is_selected) {
                 $ret .= "<?p " . BML::ml('.success.added', { num => $added }) . " p?>" if $added;
                 $ret .= "<?p " . BML::ml('.success.not_validated', { list => join ",", map { $_->ljuser_display } @not_validated }) . " p?>" if scalar @not_validated;
             } else {
@@ -126,10 +130,7 @@
             
             # hit up each user to find out what to do with them
             foreach my $id (@userids) {
-                if ($POST{"approve"}) {
-                    LJ::approve_pending_member($cid, $id);
-                    $added++;
-                } elsif ($POST{"reject"}) {
+                if ($POST{"reject"}) {
                     LJ::reject_pending_member($cid, $id, $remote->{userid}, $reason);
                     $rejected++;
                 } elsif ($POST{"reject_ban"}) {

Tags: bml, livejournal, 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