Scandal
Well-known member
Hello all!
Well, I have built a bbcode which is showing its contents only to staff members.
Here is some part of the code:
When someone who is belonging to Staff is posting on a thread, then he can see the staff bbcode which is correct because he is the $userinfo.
The issue is that if the thread creator (other user / not Staff) has select to Watch the thread, he can see on the e-mail the content of that staff bbcode which is not normal.
As you understand, during the e-mail prepare and sending, the system is taking into account the $userinfo of the current visitor which is Staff. But the receiver of the e-mail is not belonging to Staff.
How could I get the $userinfo / user_id of the user who is receiving the e-mail so I could make the compare of the userids etc?
Well, I have built a bbcode which is showing its contents only to staff members.
Here is some part of the code:
PHP:
class StaffBBCode
{
public static function render($tagChildren, $tagOption, $tag, array $options, \XF\BbCode\Renderer\AbstractRenderer $renderer)
{
//blah blah
$userinfo = \XF::visitor();
$visible = false;
if ($userinfo->is_admin
OR $userinfo->is_moderator
OR $userinfo->is_staff)
{
$visible = true;
}
return blahblah
}
}
When someone who is belonging to Staff is posting on a thread, then he can see the staff bbcode which is correct because he is the $userinfo.
The issue is that if the thread creator (other user / not Staff) has select to Watch the thread, he can see on the e-mail the content of that staff bbcode which is not normal.
As you understand, during the e-mail prepare and sending, the system is taking into account the $userinfo of the current visitor which is Staff. But the receiver of the e-mail is not belonging to Staff.
How could I get the $userinfo / user_id of the user who is receiving the e-mail so I could make the compare of the userids etc?