NullSecurityToken
class NullSecurityToken extends SecurityToken
Specialized subclass for disabled security tokens - always returns TRUE for token checks. Use through {@link SecurityToken::disable()}.
Traits
Methods
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .
Gets the uninherited value for the given config option
An implementation of the factory method, allows you to create an instance of a class
Creates a class instance by the "singleton" design pattern.
Gets a global token (or creates one if it doesnt exist already).
Globally disable the token (override with {@link NullSecurityToken}) implementation. Note: Does not apply for
Globally enable tokens that have been previously disabled through {@link disable}.
Returns the value of an the global SecurityToken in the current session
No description
No description
No description
No description
You can't disable an existing instance, it will need to be overwritten like this:
$old = SecurityToken::inst(); // isEnabled() returns true
SecurityToken::disable();
$new = SecurityToken::inst(); // isEnabled() returns false
Called by SSViewer to get a list of global variables to expose to the template, the static method to call on this class to get the value for those variables, and the class to use for casting the returned value for use in a template
No description
Details
in Configurable at line 20
static Config_ForClass
config()
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .
....).
in Configurable at line 32
mixed
stat(string $name)
deprecated
deprecated 5.0 Use ->config()->get() instead
Get inherited config value
in Configurable at line 44
mixed
uninherited(string $name)
Gets the uninherited value for the given config option
in Configurable at line 57
$this
set_stat(string $name, mixed $value)
deprecated
deprecated 5.0 Use ->config()->set() instead
Update the config value for a given property
in Injectable at line 26
static Injectable
create(array $args)
An implementation of the factory method, allows you to create an instance of a class
This method will defer class substitution to the Injector API, which can be customised via the Config API to declare substitution classes.
This can be called in one of two ways - either calling via the class directly, or calling on Object and passing the class name as the first parameter. The following are equivalent: $list = DataList::create('SiteTree'); $list = SiteTree::get();
in Injectable at line 43
static Injectable
singleton(string $class = null)
Creates a class instance by the "singleton" design pattern.
It will always return the same instance for this class, which can be used for performance reasons and as a simple way to access instance methods which don't rely on instance data (e.g. the custom SilverStripe static handling).
in SecurityToken at line 68
__construct(string $name = null)
in SecurityToken at line 78
static SecurityToken
inst()
Gets a global token (or creates one if it doesnt exist already).
in SecurityToken at line 91
static
disable()
Globally disable the token (override with {@link NullSecurityToken}) implementation. Note: Does not apply for
in SecurityToken at line 100
static
enable()
Globally enable tokens that have been previously disabled through {@link disable}.
in SecurityToken at line 109
static boolean
is_enabled()
in SecurityToken at line 117
static string
get_default_name()
in SecurityToken at line 126
static int
getSecurityID()
Returns the value of an the global SecurityToken in the current session
in SecurityToken at line 135
setName(string $name)
in SecurityToken at line 145
string
getName()
at line 57
string
getValue()
at line 65
$this
setValue(string $val)
in SecurityToken at line 197
reset()
Reset the token to a new value.
at line 19
boolean
check(string $compare)
at line 28
bool
checkRequest(HTTPRequest $request)
at line 37
HiddenField|false
updateFieldSet(FieldList $fieldset)
at line 49
string
addToUrl(string $url)
in SecurityToken at line 287
boolean
isEnabled()
You can't disable an existing instance, it will need to be overwritten like this:
$old = SecurityToken::inst(); // isEnabled() returns true
SecurityToken::disable();
$new = SecurityToken::inst(); // isEnabled() returns false
in SecurityToken at line 303
static array
get_template_global_variables()
Called by SSViewer to get a list of global variables to expose to the template, the static method to call on this class to get the value for those variables, and the class to use for casting the returned value for use in a template
If the method to call is not included for a particular template variable, a method named the same as the template variable will be called
If the casting class is not specified for a particular template variable, ViewableData::$default_cast is used
The first letter of the template variable is case-insensitive. However the method name is always case sensitive.