当前位置: 首页>>代码示例>>PHP>>正文


PHP SimpleSAML_Auth_ProcessingFilter::__construct方法代码示例

本文整理汇总了PHP中SimpleSAML_Auth_ProcessingFilter::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleSAML_Auth_ProcessingFilter::__construct方法的具体用法?PHP SimpleSAML_Auth_ProcessingFilter::__construct怎么用?PHP SimpleSAML_Auth_ProcessingFilter::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimpleSAML_Auth_ProcessingFilter的用法示例。


在下文中一共展示了SimpleSAML_Auth_ProcessingFilter::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Initialize this filter
  *
  * @param array $config   The configuration information about this filter
  * @param mixed $reserved For future use
  *
  * @throws SimpleSAML_Error_Exception
  * @since Release 1.0.0
  */
 public function __construct($config, $reserved)
 {
     assert('is_array($config)');
     // Call parent constructor
     parent::__construct($config, $reserved);
     // Process config array
     foreach ($config as $name => $value) {
         if (!is_string($name)) {
             throw new SimpleSAML_Error_Exception('Config parameter must be string in janus:AccessBlocker: ' . var_export($name, true));
         }
         // If parameter is `blocked`
         if ($name === 'blocked') {
             if (!is_array($value) && is_string($value)) {
                 $this->_blocked = array($value);
             } else {
                 $this->_blocked = $value;
             }
         } else {
             if ($name === 'allowed') {
                 if (!is_array($value) && is_string($value)) {
                     $this->_allowed = array($value);
                 } else {
                     $this->_allowed = $value;
                 }
             } else {
                 new SimpleSAML_Error_Exception('Invalid config parameter given to janus:AccessBlocker: ' . var_export($name, true));
             }
         }
     }
 }
开发者ID:moffe42,项目名称:accessblocker-ssp,代码行数:39,代码来源:AccessBlocker.php

示例2: __construct

    /**
     * Initialize the filter.
     *
     * @param array $config  Configuration information about this filter.
     * @param mixed $reserved  For future use
     */
    public function __construct($config, $reserved)
    {
        parent::__construct($config, $reserved);
        assert('is_array($config)');
        if (array_key_exists('enforce_2fa', $config)) {
            $this->enforce_2fa = $config['enforce_2fa'];
            if (!is_bool($this->enforce_2fa)) {
                throw new Exception('Invalid attribute name given to simpletotp::2fa filter:
 enforce_2fa must be a boolean.');
            }
        }
        if (array_key_exists('secret_attr', $config)) {
            $this->secret_attr = $config['secret_attr'];
            if (!is_string($this->secret_attr)) {
                throw new Exception('Invalid attribute name given to simpletotp::2fa filter:
 secret_attr must be a string');
            }
        }
        if (array_key_exists('not_configured_url', $config)) {
            $this->not_configured_url = $config['not_configured_url'];
            if (!is_string($config['not_configured_url'])) {
                throw new Exception('Invalid attribute value given to simpletotp::2fa filter:
 not_configured_url must be a string');
            }
            //validate URL to ensure it's we will be able to redirect to
            $this->not_configured_url = SimpleSAML_Utilities::checkURLAllowed($config['not_configured_url']);
        }
    }
开发者ID:ejyothi,项目名称:SimpleTOTP,代码行数:34,代码来源:2fa.php

示例3: __construct

 /**
  * Initialize this filter.
  * Validate configuration parameters.
  *
  * @param array $config  Configuration information about this filter.
  * @param mixed $reserved  For future use.
  */
 public function __construct($config, $reserved)
 {
     parent::__construct($config, $reserved);
     assert('is_array($config)');
     // Check for the deny option, get it and remove it
     // Must be bool specifically, if not, it might be for a attrib filter below
     if (isset($config['deny']) && is_bool($config['deny'])) {
         $this->deny = $config['deny'];
         unset($config['deny']);
     }
     // Check for the regex option, get it and remove it
     // Must be bool specifically, if not, it might be for a attrib filter below
     if (isset($config['regex']) && is_bool($config['regex'])) {
         $this->regex = $config['regex'];
         unset($config['regex']);
     }
     foreach ($config as $attribute => $values) {
         if (is_string($values)) {
             $values = array($values);
         }
         if (!is_array($values)) {
             throw new Exception('Filter Authorize: Attribute values is neither string nor array: ' . var_export($attribute, TRUE));
         }
         foreach ($values as $value) {
             if (!is_string($value)) {
                 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));
             }
         }
         $this->valid_attribute_values[$attribute] = $values;
     }
 }
开发者ID:palantirnet,项目名称:simplesamlphp,代码行数:38,代码来源:Authorize.php

示例4: __construct

 /**
  * Initialize this filter.
  *
  * @param array $config  Configuration information about this filter.
  * @param mixed $reserved  For future use.
  */
 public function __construct($config, $reserved)
 {
     parent::__construct($config, $reserved);
     assert('is_array($config)');
     foreach ($config as $name => $value) {
         // Is %replace set?
         if (is_int($name)) {
             if ($value == '%replace') {
                 $this->replace = TRUE;
             } else {
                 throw new Exception('Unknown flag : ' . var_export($value, TRUE));
             }
             continue;
         }
         // Unknown flag
         if (!is_string($name)) {
             throw new Exception('Unknown flag : ' . var_export($name, TRUE));
         }
         // Set pattern
         if ($name == 'pattern') {
             $this->pattern = $value;
         }
         // Set replacement
         if ($name == 'replacement') {
             $this->replacement = $value;
         }
         // Set subject
         if ($name == 'subject') {
             $this->subject = $value;
         }
     }
 }
开发者ID:hukumonline,项目名称:yii,代码行数:38,代码来源:AttributeAlter.php

示例5: __construct

 /**
  * Initialize consent filter.
  *
  * This is the constructor for the consent filter. It validates and parses the configuration.
  *
  * @param array $config  Configuration information about this filter.
  * @param mixed $reserved  For future use.
  */
 public function __construct($config, $reserved)
 {
     parent::__construct($config, $reserved);
     assert('is_array($config)');
     $this->includeValues = FALSE;
     if (array_key_exists('includeValues', $config)) {
         $this->includeValues = $config['includeValues'];
     }
     if (array_key_exists('checked', $config)) {
         $this->checked = $config['checked'];
     }
     if (array_key_exists('focus', $config)) {
         $this->focus = $config['focus'];
         if (!in_array($this->focus, array('yes', 'no'), TRUE)) {
             throw new Exception('Invalid value for \'focus\'-parameter to' . ' consent:Consent authentication filter: ' . var_export($this->focus, TRUE));
         }
     } else {
         $this->focus = NULL;
     }
     $this->store = NULL;
     if (array_key_exists('store', $config)) {
         try {
             $this->store = sspmod_consent_Store::parseStoreConfig($config['store']);
         } catch (Exception $e) {
             SimpleSAML_Logger::error('Consent - constructor() : Could not create consent storage: ' . $e->getMessage());
         }
     }
     if (array_key_exists('hiddenAttributes', $config)) {
         $this->hiddenAttributes = $config['hiddenAttributes'];
     } else {
         $this->hiddenAttributes = array();
     }
 }
开发者ID:filonuse,项目名称:fedlab,代码行数:41,代码来源:Consent.php

示例6: __construct

 /**
  * Initialize this filter.
  *
  * @param array $config  Configuration information about this filter.
  * @param mixed $reserved  For future use.
  */
 public function __construct($config, $reserved)
 {
     parent::__construct($config, $reserved);
     assert('is_array($config)');
     /* Validate configuration. */
     foreach ($config as $name => $value) {
         if (is_int($name)) {
             // check if this is an option
             if ($value === '%replace') {
                 $this->replace = true;
             } elseif ($value === '%keep') {
                 $this->keep = true;
             } else {
                 throw new SimpleSAML_Error_Exception('Unknown flag : ' . var_export($value, true));
             }
             continue;
         }
         // Set targetattribute
         if ($name === 'targetattribute') {
             $this->targetattribute = $value;
         }
         // Set sourceattribute
         if ($name === 'sourceattribute') {
             $this->sourceattribute = $value;
         }
         // Set values
         if ($name === 'values') {
             $this->values = $value;
         }
     }
 }
开发者ID:mrvanes,项目名称:simplesamlphp,代码行数:37,代码来源:AttributeValueMap.php

示例7: __construct

 public function __construct($config, $reserved)
 {
     parent::__construct($config, $reserved);
     assert('is_array($config)');
     if (array_key_exists('candidates', $config)) {
         $this->_candidates = $config['candidates'];
         if (!is_array($this->_candidates)) {
             throw new Exception('SmartID authproc configuration error: \'candidates\' should be an array.');
         }
     }
     if (array_key_exists('id_attribute', $config)) {
         $this->_id_attribute = $config['id_attribute'];
         if (!is_string($this->_id_attribute)) {
             throw new Exception('SmartID authproc configuration error: \'id_attribute\' should be a string.');
         }
     }
     if (array_key_exists('add_authority', $config)) {
         $this->_add_authority = $config['add_authority'];
         if (!is_bool($this->_add_authority)) {
             throw new Exception('SmartID authproc configuration error: \'add_authority\' should be a boolean.');
         }
     }
     if (array_key_exists('add_candidate', $config)) {
         $this->_add_candidate = $config['add_candidate'];
         if (!is_bool($this->_add_candidate)) {
             throw new Exception('SmartID authproc configuration error: \'add_candidate\' should be a boolean.');
         }
     }
 }
开发者ID:PitcherAG,项目名称:simplesamlphp,代码行数:29,代码来源:SmartID.php

示例8: __construct

 /**
  * Initialize this filter.
  *
  * @param array $config  Configuration information about this filter.
  * @param mixed $reserved  For future use.
  */
 public function __construct($config, $reserved)
 {
     parent::__construct($config, $reserved);
     assert('is_array($config)');
     if (array_key_exists('warndaysbefore', $config)) {
         $this->warndaysbefore = $config['warndaysbefore'];
         if (!is_string($this->warndaysbefore)) {
             throw new Exception('Invalid value for number of days given to expirycheck::ExpiryDate filter.');
         }
     }
     if (array_key_exists('netid_attr', $config)) {
         $this->netid_attr = $config['netid_attr'];
         if (!is_string($this->netid_attr)) {
             throw new Exception('Invalid attribute name given as eduPersonPrincipalName to expirycheck::ExpiryDate filter.');
         }
     }
     if (array_key_exists('expirydate_attr', $config)) {
         $this->expirydate_attr = $config['expirydate_attr'];
         if (!is_string($this->expirydate_attr)) {
             throw new Exception('Invalid attribute name given as schacExpiryDate to expirycheck::ExpiryDate filter.');
         }
     }
     if (array_key_exists('date_format', $config)) {
         $this->date_format = $config['date_format'];
         if (!is_string($this->date_format)) {
             throw new Exception('Invalid date format given to expirycheck::ExpiryDate filter.');
         }
     }
 }
开发者ID:Stony-Brook-University,项目名称:doitsbu,代码行数:35,代码来源:ExpiryDate.php

示例9: __construct

 /**
  * Initialize this filter.
  *
  * @param array $config  Configuration information about this filter.
  * @param mixed $reserved  For future use.
  */
 public function __construct($config, $reserved)
 {
     parent::__construct($config, $reserved);
     assert('is_array($config)');
     foreach ($config as $name => $values) {
         if (is_int($name)) {
             if ($values === '%replace') {
                 $this->replace = TRUE;
             } else {
                 throw new Exception('Unknown flag: ' . var_export($values, TRUE));
             }
             continue;
         }
         if (!is_string($name)) {
             throw new Exception('Invalid attribute name: ' . var_export($name, TRUE));
         }
         if (!is_array($values)) {
             $values = array($values);
         }
         foreach ($values as $value) {
             if (!is_string($value)) {
                 throw new Exception('Invalid value for attribute ' . $name . ': ' . var_export($values, TRUE));
             }
         }
         $this->attributes[$name] = $values;
     }
 }
开发者ID:joshmdavis,项目名称:simplesamlphp,代码行数:33,代码来源:AttributeAdd.php

示例10: __construct

 /**
  * Initialize this filter.
  *
  * @param array $config  Configuration information about this filter.
  * @param mixed $reserved  For future use.
  * @throws SimpleSAML_Error_Exception In case of invalid configuration.
  */
 public function __construct($config, $reserved)
 {
     parent::__construct($config, $reserved);
     assert('is_array($config)');
     // parse filter configuration
     foreach ($config as $name => $value) {
         if (is_int($name)) {
             // check if this is an option
             if ($value === '%replace') {
                 $this->replace = TRUE;
             } elseif ($value === '%remove') {
                 $this->remove = TRUE;
             } else {
                 throw new SimpleSAML_Error_Exception('Unknown flag : ' . var_export($value, TRUE));
             }
             continue;
         }
         // Set pattern
         if ($name === 'pattern') {
             $this->pattern = $value;
         }
         // Set replacement
         if ($name === 'replacement') {
             $this->replacement = $value;
         }
         // Set subject
         if ($name === 'subject') {
             $this->subject = $value;
         }
         // Set target
         if ($name === 'target') {
             $this->target = $value;
         }
     }
 }
开发者ID:niceforbear,项目名称:simplesamlphp,代码行数:42,代码来源:AttributeAlter.php

示例11: __construct

 /**
  * Initialize this filter, parse configuration
  *
  * @param array $config  Configuration information about this filter.
  * @param mixed $reserved  For future use.
  */
 public function __construct($config, $reserved)
 {
     parent::__construct($config, $reserved);
     assert('is_array($config)');
     $mapFiles = array();
     foreach ($config as $origName => $newName) {
         if (is_int($origName)) {
             if ($newName === '%duplicate') {
                 $this->duplicate = TRUE;
             } else {
                 /* No index given - this is a map file. */
                 $mapFiles[] = $newName;
             }
             continue;
         }
         if (!is_string($origName)) {
             throw new Exception('Invalid attribute name: ' . var_export($origName, TRUE));
         }
         if (!is_string($newName) && !is_array($newName)) {
             throw new Exception('Invalid attribute name: ' . var_export($newName, TRUE));
         }
         $this->map[$origName] = $newName;
     }
     // Load map files after we determine dupilicate or rename
     foreach ($mapFiles as &$file) {
         $this->loadMapFile($file);
     }
 }
开发者ID:shirlei,项目名称:simplesaml,代码行数:34,代码来源:AttributeMap.php

示例12: __construct

 /**
  * Constructor for the processing filter.
  *
  * @param array &$config Configuration for this filter.
  * @param mixed $reserved For future use.
  */
 public function __construct(&$config, $reserved)
 {
     parent::__construct($config, $reserved);
     assert('is_array($config)');
     if (array_key_exists('attributes', $config) && !empty($config['attributes'])) {
         $this->scopedAttributes = $config['attributes'];
     }
 }
开发者ID:simplesamlphp,项目名称:simplesamlphp,代码行数:14,代码来源:FilterScopes.php

示例13: __construct

 /**
  * Initialize this filter, parse configuration
  *
  * @param array $config  Configuration information about this filter.
  * @param mixed $reserved  For future use.
  */
 public function __construct($config, $reserved)
 {
     parent::__construct($config, $reserved);
     assert('is_array($config)');
     $config = SimpleSAML_Configuration::loadFromArray($config, 'ScopeFromAttribute');
     $this->targetAttribute = $config->getString('targetAttribute');
     $this->sourceAttribute = $config->getString('sourceAttribute');
 }
开发者ID:SysBind,项目名称:simplesamlphp,代码行数:14,代码来源:ScopeFromAttribute.php

示例14: __construct

 /**
  * Initialize this filter.
  *
  * @param array $config  Configuration information about this filter.
  * @param mixed $reserved  For future use.
  */
 public function __construct($config, $reserved)
 {
     parent::__construct($config, $reserved);
     assert('is_array($config)');
     if (array_key_exists('attributename', $config)) {
         $this->attributename = $config['attributename'];
     }
 }
开发者ID:tractorcow,项目名称:simplesamlphp,代码行数:14,代码来源:AttributeRealm.php

示例15: __construct

 /**
  * Initialize this filter, parse configuration
  *
  * @param array $config  Configuration information about this filter.
  * @param mixed $reserved  For future use.
  */
 public function __construct($config, $reserved)
 {
     parent::__construct($config, $reserved);
     assert('is_array($config)');
     if (!isset($config['code'])) {
         throw new SimpleSAML_Error_Exception($this->authId . ': Missing required \'code\' option.');
     }
     $this->code = (string) $config['code'];
 }
开发者ID:danielkjfrog,项目名称:docker,代码行数:15,代码来源:PHP.php


注:本文中的SimpleSAML_Auth_ProcessingFilter::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。