From d9efeb6ac3810ef2ed7da6a274c3fc5ef1cfd5d7 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 28 Dec 2009 11:02:44 -0800 Subject: optionally flag a profile for review when blocked --- plugins/UserFlag/UserFlagPlugin.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'plugins/UserFlag') diff --git a/plugins/UserFlag/UserFlagPlugin.php b/plugins/UserFlag/UserFlagPlugin.php index 21af506a9..0fca5f9cf 100644 --- a/plugins/UserFlag/UserFlagPlugin.php +++ b/plugins/UserFlag/UserFlagPlugin.php @@ -46,6 +46,8 @@ class UserFlagPlugin extends Plugin const REVIEWFLAGS = 'UserFlagPlugin::reviewflags'; const CLEARFLAGS = 'UserFlagPlugin::clearflags'; + public $flagOnBlock = true; + /** * Hook for ensuring our tables are created * @@ -235,4 +237,23 @@ class UserFlagPlugin extends Plugin return true; // unchanged! } + + /** + * Optionally flag profile when a block happens + * + * We optionally add a flag when a profile has been blocked + * + * @param User $user User doing the block + * @param Profile $profile Profile being blocked + * + * @return boolean hook result + */ + + function onEndBlockProfile($user, $profile) + { + if ($this->flagOnBlock) { + User_flag_profile::create($user->id, $profile->id); + } + return true; + } } -- cgit v1.2.3-54-g00ecf