BanModel::banWhere PHP 메소드

banWhere() 공개 메소드

Ban users that meet conditions given.
부터: 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.
리턴 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;
    }