madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r20271: LJSUP-9307: uselog.bml support 'delete_d...

Committer: sbelyaev
LJSUP-9307: uselog.bml support 'delete_delayed_entry'
U   trunk/cgi-bin/ljprotocol.pl
U   trunk/htdocs/admin/userlog.bml
U   trunk/htdocs/editjournal.bml
Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl	2011-10-11 06:28:49 UTC (rev 20270)
+++ trunk/cgi-bin/ljprotocol.pl	2011-10-11 06:39:30 UTC (rev 20271)
@@ -2636,6 +2636,12 @@
             if ($req->{'event'} !~ /\S/ ) {
                 $entry->delete();
                 $res->{delayedid} = $delayedid;
+                
+                $uowner->log_event('delete_entry', {
+                                            remote => $u,
+                                            actiontarget => $delayedid,
+                                            method => 'protocol', })
+                        unless $flags->{noauth};
                 return $res;
             }
 

Modified: trunk/htdocs/admin/userlog.bml
===================================================================
--- trunk/htdocs/admin/userlog.bml	2011-10-11 06:28:49 UTC (rev 20270)
+++ trunk/htdocs/admin/userlog.bml	2011-10-11 06:39:30 UTC (rev 20271)
@@ -85,6 +85,8 @@
         my $action = "Action undefined for: $row->{action}";
         if ($row->{action} eq 'delete_entry') {
             $action = "Deleted entry $row->{actiontarget} via $extra->{method}";
+        } elsif ($row->{action} eq 'delete_delayed_entry') {
+            $action = "Deleted delayed entry $row->{actiontarget} via $extra->{method}";
         } elsif ($row->{action} eq 'account_create') {
             $action = "Account created";
         } elsif ($row->{action} eq 'ban_set') {

Modified: trunk/htdocs/editjournal.bml
===================================================================
--- trunk/htdocs/editjournal.bml	2011-10-11 06:28:49 UTC (rev 20270)
+++ trunk/htdocs/editjournal.bml	2011-10-11 06:39:30 UTC (rev 20271)
@@ -461,14 +461,19 @@
                 }
 
                 # if the action is to delete it, then let's note that
-                if ( ($POST{'action:delete'} || $POST{'action:deletespam'} ) 
-                                    && $entry_obj->is_delayed ) {
-                    # now log the event created above
-                    ($usejournal ? $usejournal_u : $remote)->log_event('delete_entry', {
-                            remote => $remote,
-                            actiontarget => $ditemid,
-                            method => 'web',
-                        });
+                if ( $POST{'action:delete'} || $POST{'action:deletespam'} ) {
+                    # now log the event created abovei
+                    if ($entry_obj->is_delayed) {
+                        ($usejournal ? $usejournal_u : $remote)->log_event('delete_delayed_entry', {
+                                                                                remote => $remote,
+                                                                                actiontarget => $delayedid,
+                                                                                method => 'web',});
+                    } else {
+                       ($usejournal ? $usejournal_u : $remote)->log_event('delete_entry', {
+                                                                                remote => $remote,
+                                                                                actiontarget => $ditemid,
+                                                                                method => 'web',});
+                    }
                 }
 
                 # do editevent request

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