BanModel::banWhere PHP Méthode

banWhere() public méthode

Ban users that meet conditions given.
Since: 2.0.18
public banWhere ( array $Ban ) : array
$Ban array Data about the ban. Valid keys are BanType and BanValue. BanValue is what is to be banned. Valid values for BanType are email, ipaddress or name.
Résultat array
    public function banWhere($Ban)
    {
        $Result = array('u.Admin' => 0, 'u.Deleted' => 0);
        $Ban['BanValue'] = str_replace('*', '%', $Ban['BanValue']);
        switch (strtolower($Ban['BanType'])) {
            case 'email':
                $Result['u.Email like'] = $Ban['BanValue'];
                break;
            case 'ipaddress':
                $Result['inet6_ntoa(u.LastIPAddress) like'] = $Ban['BanValue'];
                break;
            case 'name':
                $Result['u.Name like'] = $Ban['BanValue'];
                break;
        }
        return $Result;
    }