• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Can't Seem to get User Criteria Working...

Jaxel

Well-known member
#1
I'm trying to set up a user criteria setting for my Discord Integration. Currently I have it set to show a NOTICE:

1.png

Unfortunately, it doesn't seem to work... Don't know why.

Code:
<?php

class EWRdiscord_Listener_Criteria
{
    public static function userMatchesCriteria($rule, array $data, array $user, &$returnValue)
    {
        switch ($rule)
        {
            case 'discord':
                if (empty($user['externalAuth']['discord']))
                {
                    $returnValue = false;
                }
                break;
        }
    }
}
 

Jaxel

Well-known member
#2
Nevermind, figured it out. The return must be the OPPOSITE of the criteria helper. The criteria helper returns falses, the listener has to return trues.