From: Evan Prodromou Date: Mon, 28 Dec 2009 19:02:44 +0000 (-0800) Subject: optionally flag a profile for review when blocked X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d9efeb6ac3810ef2ed7da6a274c3fc5ef1cfd5d7;p=quix0rs-gnu-social.git optionally flag a profile for review when blocked --- diff --git a/plugins/UserFlag/UserFlagPlugin.php b/plugins/UserFlag/UserFlagPlugin.php index 21af506a99..0fca5f9cf9 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; + } }