RSS Feed/News Member::actionBan can cause a server error when a non-moderator touches it

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
24,700
Points
823

Reputation:

If a non-moderator (or guest) attempts to access members/ban, it instead causes a server error.

PHP:

Code:
    public function canBan(&$error = null)
    {
        $visitor = \XF::visitor();

if (!$this->user_id || !$visitor->is_moderator || $this->user_id == $visitor->user_id)
        {
            return false;
        }
...
    public function userBanAddEdit(User $user)
    {
        if (!$user->canBan($error))
        {
            return $this->error($error);
        }
...

Read more

Continue reading...
 
Status
Not open for further replies.
Top