summaryrefslogtreecommitdiff
path: root/plugins/UserFlag
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-12-28 11:02:44 -0800
committerEvan Prodromou <evan@status.net>2009-12-28 11:02:44 -0800
commitd9efeb6ac3810ef2ed7da6a274c3fc5ef1cfd5d7 (patch)
tree9cf9ac9ce08d8a53a291bddda7bcf776a8300d1f /plugins/UserFlag
parent6d3e6b42849ad14b15cb4c41c4f8baac45e58df0 (diff)
optionally flag a profile for review when blocked
Diffstat (limited to 'plugins/UserFlag')
-rw-r--r--plugins/UserFlag/UserFlagPlugin.php21
1 files changed, 21 insertions, 0 deletions
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;
+ }
}