PHP 클래스 SecurityComponent, miniPHP

Long description for file
상속: extends Object
파일 보기 프로젝트 열기: omarelgabry/miniphp

보호된 프로퍼티들

프로퍼티 타입 설명
$config array Default configurations

공개 메소드들

메소드 설명
CsrfToken ( array $config = [] ) : boolean validate CSRF token CSRF token can be passed with submitted forms and links associated with sensitive server-side operations.
form ( array $config ) : boolean validate submitted form - Unknown fields cannot be added to the form.
requireAjax ( array $actions = [] ) Sets the actions that require a Ajax request
requireGet ( array $actions = [] ) Sets the actions that require a GET request
requirePost ( array $actions = [] ) Sets the actions that require a POST request
requireSecure ( array $actions = [] ) Sets the actions that require secured connection(SSL)
startup ( ) Auth startup All security checking are done in this method

비공개 메소드들

메소드 설명
invalidRequest ( string | null $callback = null ) : mixed Handles invalid request with a 400 Bad Request Error If no callback is specified.
requestRequired ( ) : boolean Check & validate from the required HTTP methods, like: Post, Ajax, Get
secureRequired ( ) : boolean Check & validate if secured connection is required.
validateDomain ( ) : boolean Check & validate if request is coming from the same domain; if equals to $this->request->host() HTTP referer tells the domain where the request came from.

메소드 상세

CsrfToken() 공개 메소드

In case of GET request, you need to set 'validateCsrfToken' in $config to true.
public CsrfToken ( array $config = [] ) : boolean
$config array configuration data
리턴 boolean

form() 공개 메소드

- Fields cannot be removed from the form. Use $exclude to exclude anything mightn't be sent with the form, like possible empty arrays, checkboxes, radio buttons, ...etc. By default, the submit field will be excluded.
public form ( array $config ) : boolean
$config array configuration data
리턴 boolean

requireAjax() 공개 메소드

Sets the actions that require a Ajax request
public requireAjax ( array $actions = [] )
$actions array

requireGet() 공개 메소드

Sets the actions that require a GET request
public requireGet ( array $actions = [] )
$actions array

requirePost() 공개 메소드

Sets the actions that require a POST request
public requirePost ( array $actions = [] )
$actions array

requireSecure() 공개 메소드

Sets the actions that require secured connection(SSL)
public requireSecure ( array $actions = [] )
$actions array

startup() 공개 메소드

Auth startup All security checking are done in this method
public startup ( )

프로퍼티 상세

$config 보호되어 있는 프로퍼티

Default configurations
protected array $config
리턴 array