2016-08-19 00:51:35 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\Security;
|
|
|
|
|
2016-09-09 08:43:05 +02:00
|
|
|
use SilverStripe\Control\HTTPRequest;
|
2016-08-19 00:51:35 +02:00
|
|
|
use SilverStripe\Forms\FieldList;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specialized subclass for disabled security tokens - always returns
|
|
|
|
* TRUE for token checks. Use through {@link SecurityToken::disable()}.
|
|
|
|
*/
|
|
|
|
class NullSecurityToken extends SecurityToken
|
|
|
|
{
|
|
|
|
|
2016-11-29 00:31:16 +01:00
|
|
|
/**
|
|
|
|
* @param String
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
public function check($compare)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2016-08-19 00:51:35 +02:00
|
|
|
|
2016-11-29 00:31:16 +01:00
|
|
|
/**
|
|
|
|
* @param HTTPRequest $request
|
|
|
|
* @return Boolean
|
|
|
|
*/
|
|
|
|
public function checkRequest($request)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2016-08-19 00:51:35 +02:00
|
|
|
|
2016-11-29 00:31:16 +01:00
|
|
|
/**
|
|
|
|
* @param FieldList $fieldset
|
|
|
|
* @return false
|
|
|
|
*/
|
|
|
|
public function updateFieldSet(&$fieldset)
|
|
|
|
{
|
|
|
|
// Remove, in case it was added beforehand
|
|
|
|
$fieldset->removeByName($this->getName());
|
2016-08-19 00:51:35 +02:00
|
|
|
|
2016-11-29 00:31:16 +01:00
|
|
|
return false;
|
|
|
|
}
|
2016-08-19 00:51:35 +02:00
|
|
|
|
2016-11-29 00:31:16 +01:00
|
|
|
/**
|
|
|
|
* @param String $url
|
|
|
|
* @return String
|
|
|
|
*/
|
|
|
|
public function addToUrl($url)
|
|
|
|
{
|
|
|
|
return $url;
|
|
|
|
}
|
2016-08-19 00:51:35 +02:00
|
|
|
|
2016-11-29 00:31:16 +01:00
|
|
|
/**
|
|
|
|
* @return String
|
|
|
|
*/
|
|
|
|
public function getValue()
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
2016-08-19 00:51:35 +02:00
|
|
|
|
2016-11-29 00:31:16 +01:00
|
|
|
/**
|
|
|
|
* @param String $val
|
|
|
|
*/
|
|
|
|
public function setValue($val)
|
|
|
|
{
|
|
|
|
// no-op
|
|
|
|
}
|
2016-08-19 00:51:35 +02:00
|
|
|
|
2016-11-29 00:31:16 +01:00
|
|
|
/**
|
|
|
|
* @return String
|
|
|
|
*/
|
|
|
|
public function generate()
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
2016-08-19 00:51:35 +02:00
|
|
|
}
|