optionally flag a profile for review when blocked
This commit is contained in:
parent
6d3e6b4284
commit
d9efeb6ac3
@ -46,6 +46,8 @@ class UserFlagPlugin extends Plugin
|
|||||||
const REVIEWFLAGS = 'UserFlagPlugin::reviewflags';
|
const REVIEWFLAGS = 'UserFlagPlugin::reviewflags';
|
||||||
const CLEARFLAGS = 'UserFlagPlugin::clearflags';
|
const CLEARFLAGS = 'UserFlagPlugin::clearflags';
|
||||||
|
|
||||||
|
public $flagOnBlock = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook for ensuring our tables are created
|
* Hook for ensuring our tables are created
|
||||||
*
|
*
|
||||||
@ -235,4 +237,23 @@ class UserFlagPlugin extends Plugin
|
|||||||
|
|
||||||
return true; // unchanged!
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user