42 parent::__construct(
$config, $reserved);
44 assert(
'is_array($config)');
56 $this->regex =
$config[
'regex'];
60 foreach (
$config as $attribute => $values) {
61 if (is_string($values))
62 $values =
array($values);
63 if (!is_array($values))
64 throw new Exception(
'Filter Authorize: Attribute values is neither string nor array: ' . var_export($attribute, TRUE));
65 foreach ($values as $value){
66 if(!is_string($value)) {
67 throw new Exception(
'Filter Authorize: Each value should be a string for attribute: ' . var_export($attribute, TRUE) .
' value: ' . var_export($value, TRUE) .
' Config is: ' . var_export(
$config, TRUE));
70 $this->valid_attribute_values[$attribute] = $values;
82 assert(
'is_array($request)');
83 assert(
'array_key_exists("Attributes", $request)');
87 foreach ($this->valid_attribute_values as
$name => $patterns) {
89 foreach ($patterns as $pattern){
91 if (!is_array($values))
92 $values =
array($values);
93 foreach ($values as $value){
95 $matched = preg_match($pattern, $value);
97 $matched = ($value == $pattern);
100 $authorize = ($this->deny ? FALSE : TRUE);
128 'authorize:Authorize');
130 'authorize/authorize_403.php');
if(!array_key_exists('StateId', $_REQUEST)) $id
static redirectTrustedURL($url, $parameters=array())
This function redirects to the specified URL without performing any security checks.
$valid_attribute_values
Array of valid users.
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
process(&$request)
Apply filter to validate attributes.
Create styles array
The data for the language used.
__construct($config, $reserved)
Initialize this filter.
unauthorized(&$request)
When the process logic determines that the user is not authorized for this service, then forward the user to an 403 unauthorized page.
static saveState(&$state, $stage, $rawId=false)
Save the state.