PHP 클래스 BanModel, vanilla

부터: 2.0.18
상속: extends Gdn_Model
파일 보기 프로젝트 열기: vanilla/vanilla 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_AllBans * @var array
$instance The singleton instance of this class.

공개 메소드들

메소드 설명
_BeforeGet ( ) Add ban data to all Get requests.
__construct ( ) Defines the related database table name.
allBans ( ) Get and store list of current bans.
applyBan ( array $NewBan = null, array $OldBan = null ) Convert bans to new type.
banWhere ( array $Ban ) : array Ban users that meet conditions given.
checkUser ( $User, Gdn_Validation $Validation = null, boolean $UpdateBlocks = false, &$BansFound = null ) : boolean Add ban data to all Get requests.
delete ( array | integer $where = [], array | true $options = [] ) : boolean Remove a ban.
explodeBans ( integer $banned ) : array Explode a banned bit mask into an array of ban constants.
instance ( ) : BanModel Get the singleton instance of the {@link BanModel} class.
isBanned ( integer $banned, integer $reason ) : boolean Check whether or not a banned value is banned for a given reason.
save ( array $FormPostValues, array $Settings = false ) Save data about ban from form.
saveUser ( array $User, boolean $BannedValue, array | false $Ban = false ) Change ban data on a user (ban or unban them).
setBanned ( integer $banned, boolean $value, integer $reason ) : integer Set the banned mask value for a reason and return the new value.
setCounts ( array &$Data ) Set number of banned users in $Data.

메소드 상세

_BeforeGet() 공개 메소드

Add ban data to all Get requests.
부터: 2.0.18
public _BeforeGet ( )

__construct() 공개 메소드

Defines the related database table name.
public __construct ( )

allBans() 공개 정적인 메소드

Get and store list of current bans.
부터: 2.0.18
public static allBans ( )

applyBan() 공개 메소드

Convert bans to new type.
부터: 2.0.18
public applyBan ( array $NewBan = null, array $OldBan = null )
$NewBan array Data about the new ban.
$OldBan array Data about the old ban.

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

checkUser() 공개 정적인 메소드

Add ban data to all Get requests.
부터: 2.0.18
public static checkUser ( $User, Gdn_Validation $Validation = null, boolean $UpdateBlocks = false, &$BansFound = null ) : boolean
$Validation Gdn_Validation
$UpdateBlocks boolean
리턴 boolean Whether user is banned.

delete() 공개 메소드

Remove a ban.
public delete ( array | integer $where = [], array | true $options = [] ) : boolean
$where array | integer The where clause to delete or an integer value.
$options array | true An array of options to control the delete.
리턴 boolean Returns **true** on success or **false** on failure.

explodeBans() 공개 정적인 메소드

Explode a banned bit mask into an array of ban constants.
public static explodeBans ( integer $banned ) : array
$banned integer The banned bit mask to explode.
리턴 array Returns an array of the set bits.

instance() 공개 정적인 메소드

Get the singleton instance of the {@link BanModel} class.
public static instance ( ) : BanModel
리턴 BanModel Returns the singleton instance of this class.

isBanned() 공개 정적인 메소드

Check whether or not a banned value is banned for a given reason.
public static isBanned ( integer $banned, integer $reason ) : boolean
$banned integer The banned value.
$reason integer The reason for the banning or an empty string to check if banned for any reason. This should be one of the `BanModel::BAN_*` constants.
리턴 boolean Returns true if the value is banned or false otherwise.

save() 공개 메소드

Save data about ban from form.
부터: 2.0.18
public save ( array $FormPostValues, array $Settings = false )
$FormPostValues array
$Settings array

saveUser() 공개 메소드

Change ban data on a user (ban or unban them).
부터: 2.0.18
public saveUser ( array $User, boolean $BannedValue, array | false $Ban = false )
$User array
$BannedValue boolean Whether user is banned.
$Ban array | false An array representing the specific auto-ban.

setBanned() 공개 정적인 메소드

Set the banned mask value for a reason and return the new value.
public static setBanned ( integer $banned, boolean $value, integer $reason ) : integer
$banned integer The current banned value.
$value boolean The new ban value for the given reason.
$reason integer The reason for the banning. This should be one of the `BanModel::BAN_*` constants.
리턴 integer Returns the new banned value.

setCounts() 공개 메소드

Set number of banned users in $Data.
부터: 2.0.18
public setCounts ( array &$Data )
$Data array

프로퍼티 상세

$_AllBans 보호되어 있는 정적으로 프로퍼티

* @var array
protected static $_AllBans

$instance 보호되어 있는 정적으로 프로퍼티

The singleton instance of this class.
protected static $instance