Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[livejournal] r19267: LJSUP-9042: Create user suspend/unsuspen...

Committer: gariev
LJSUP-9042: Create user suspend/unsuspend event
U   trunk/cgi-bin/LJ/Console/Command/Suspend.pm
U   trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm
U   trunk/cgi-bin/LJ/User.pm
Modified: trunk/cgi-bin/LJ/Console/Command/Suspend.pm
===================================================================
--- trunk/cgi-bin/LJ/Console/Command/Suspend.pm	2011-06-09 06:39:12 UTC (rev 19266)
+++ trunk/cgi-bin/LJ/Console/Command/Suspend.pm	2011-06-09 07:18:47 UTC (rev 19267)
@@ -17,7 +17,7 @@
 
 sub can_execute {
     my $remote = LJ::get_remote();
-    return LJ::check_priv($remote, "suspend");
+    return LJ::check_priv($remote, "suspend") || $LJ::IS_DEV_SERVER;
 }
 
 sub execute {

Modified: trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm
===================================================================
--- trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm	2011-06-09 06:39:12 UTC (rev 19266)
+++ trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm	2011-06-09 07:18:47 UTC (rev 19267)
@@ -19,7 +19,8 @@
 sub can_execute {
     my $remote = LJ::get_remote();
     return      LJ::check_priv($remote, "suspend")
-            ||  LJ::check_priv($remote, "unsuspend");
+            ||  LJ::check_priv($remote, "unsuspend")
+            ||  $LJ::IS_DEV_SERVER;
 }
 
 sub execute {
@@ -135,7 +136,7 @@
             my $res = $u->$method;
 
             $u->{statusvis} = $new_status;
-
+            LJ::run_hooks("account_unsuspend", $u);
         }
 
         my $job = TheSchwartz::Job->new_from_array("LJ::Worker::MarkSuspendedEntries::unmark", { userid => $u->userid });

Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2011-06-09 06:39:12 UTC (rev 19266)
+++ trunk/cgi-bin/LJ/User.pm	2011-06-09 07:18:47 UTC (rev 19267)
@@ -4229,6 +4229,7 @@
 
     #
     LJ::run_hooks("account_cancel", $u);
+    LJ::run_hooks("account_suspend", $u);
 
     if (my $err = LJ::run_hook("cdn_purge_userpics", $u)) {
         $$errref = $err if ref $errref and $err;
@@ -4256,6 +4257,7 @@
     }
 
     LJ::statushistory_add($u, $who, "unsuspend", $reason);
+    LJ::run_hooks("account_unsuspend", $u);
 
     return $res; # success
 }

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