We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit d9efeb6a authored by Evan Prodromou's avatar Evan Prodromou

optionally flag a profile for review when blocked

parent 6d3e6b42
......@@ -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;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment