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


PHP Authenticator::get_authenticators方法代码示例

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


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

示例1: setUp

 function setUp()
 {
     self::$fixture_file = MODULE_SECUREFILES_PATH . '/tests/SecureFileControllerTest.yml';
     parent::setUp();
     $this->priorAuthenticators = Authenticator::get_authenticators();
     $this->priorDefaultAuthenticator = Authenticator::get_default_authenticator();
     Authenticator::register('MemberAuthenticator');
     Authenticator::set_default_authenticator('MemberAuthenticator');
     if (!file_exists(ASSETS_PATH)) {
         mkdir(ASSETS_PATH);
     }
     /* Create a test folders for each of the fixture references */
     $fileIDs = $this->allFixtureIDs('Folder');
     foreach ($fileIDs as $fileID) {
         $file = DataObject::get_by_id('Folder', $fileID);
         if (!file_exists(BASE_PATH . "/{$file->Filename}")) {
             mkdir(BASE_PATH . "/{$file->Filename}");
         }
     }
     /* Create a test files for each of the fixture references */
     $fileIDs = $this->allFixtureIDs('File');
     foreach ($fileIDs as $fileID) {
         $file = DataObject::get_by_id('File', $fileID);
         $fh = fopen(BASE_PATH . "/{$file->Filename}", "w");
         fwrite($fh, str_repeat('x', 1000));
         fclose($fh);
     }
     // USERS:
     // 1 x ADMIN user
     // 1 x Member with SECUREFILEACCESS
     // 1 x Member with SECURE_FILE_SETTINGS
     // 1 x Member
 }
开发者ID:hamishcampbell,项目名称:silverstripe-securefiles,代码行数:33,代码来源:SecureFileControllerTest.php

示例2: setUp

 function setUp()
 {
     // This test assumes that MemberAuthenticator is present and the default
     $this->priorAuthenticators = Authenticator::get_authenticators();
     $this->priorDefaultAuthenticator = Authenticator::get_default_authenticator();
     Authenticator::register('MemberAuthenticator');
     Authenticator::set_default_authenticator('MemberAuthenticator');
     parent::setUp();
 }
开发者ID:racontemoi,项目名称:shibuichi,代码行数:9,代码来源:SecurityTest.php

示例3: setUp

 function setUp()
 {
     // This test assumes that MemberAuthenticator is present and the default
     $this->priorAuthenticators = Authenticator::get_authenticators();
     $this->priorDefaultAuthenticator = Authenticator::get_default_authenticator();
     Authenticator::register('MemberAuthenticator');
     Authenticator::set_default_authenticator('MemberAuthenticator');
     // And that the unique identified field is 'Email'
     $this->priorUniqueIdentifierField = Member::get_unique_identifier_field();
     Member::set_unique_identifier_field('Email');
     parent::setUp();
 }
开发者ID:eLBirador,项目名称:AllAboutCity,代码行数:12,代码来源:SecurityTest.php

示例4: setUp

 public function setUp()
 {
     // This test assumes that MemberAuthenticator is present and the default
     $this->priorAuthenticators = Authenticator::get_authenticators();
     $this->priorDefaultAuthenticator = Authenticator::get_default_authenticator();
     foreach ($this->priorAuthenticators as $authenticator) {
         Authenticator::unregister($authenticator);
     }
     Authenticator::register('MemberAuthenticator');
     Authenticator::set_default_authenticator('MemberAuthenticator');
     // And that the unique identified field is 'Email'
     $this->priorUniqueIdentifierField = Member::config()->unique_identifier_field;
     $this->priorRememberUsername = Security::config()->remember_username;
     Member::config()->unique_identifier_field = 'Email';
     parent::setUp();
 }
开发者ID:tcaiger,项目名称:mSupplyNZ,代码行数:16,代码来源:SecurityTest.php

示例5: setUp

 function setUp()
 {
     // This test assumes that MemberAuthenticator is present and the default
     $this->priorAuthenticators = Authenticator::get_authenticators();
     $this->priorDefaultAuthenticator = Authenticator::get_default_authenticator();
     //Authenticator::register('MemberAuthenticator');
     Authenticator::register_authenticator('ExternalAuthenticator');
     Authenticator::set_default_authenticator('ExternalAuthenticator');
     //Create the sources in this order. Switching them around would mean that
     //all tests use the fake driver because this always succeeds and auto create
     //is on
     ExternalAuthenticator::createSource('sstripe_unittest', 'SSTRIPE', 'SilverStripe');
     ExternalAuthenticator::createSource('fake_unittest', 'FAKE', 'Fake Source');
     ExternalAuthenticator::setAuthSequential(true);
     ExternalAuthenticator::setAuthSSLock('sstripe_unittest', true);
     ExternalAuthenticator::setAuthSSLock('fake_unittest', false);
     ExternalAuthenticator::setAutoAdd('fake_unittest', 'mygroup');
     ExternalAuthenticator::setDefaultDomain('fake_unittest', 'silverstripe.com');
     ExternalAuthenticator::setAuthDebug(false);
     ExternalAuthenticator::setAuditLogFile(false);
     ExternalAuthenticator::setAuditLogSStripe(true);
     parent::setUp();
 }
开发者ID:hamishcampbell,项目名称:silverstripe-auth-external,代码行数:23,代码来源:ExternalAuthenticatorTest.php

示例6: GetLoginForms

 /**
  * Get the login forms for all available authentication methods
  *
  * @return array Returns an array of available login forms (array of Form
  *               objects).
  *
  * @todo Check how to activate/deactivate authentication methods
  */
 protected function GetLoginForms()
 {
     $forms = array();
     $authenticators = Authenticator::get_authenticators();
     foreach ($authenticators as $authenticator) {
         array_push($forms, call_user_func(array($authenticator, 'get_login_form'), $this));
     }
     return $forms;
 }
开发者ID:ramziammar,项目名称:websites,代码行数:17,代码来源:Security.php

示例7: GetLoginForms

 /**
  * Get the login forms for all available authentication methods
  *
  * @return array Returns an array of available login forms (array of Form
  *               objects).
  *
  * @todo Check how to activate/deactivate authentication methods
  */
 public function GetLoginForms()
 {
     $forms = array();
     $authenticators = Authenticator::get_authenticators();
     foreach ($authenticators as $authenticator) {
         $forms[] = $authenticator::get_login_form($this);
     }
     return $forms;
 }
开发者ID:miamollie,项目名称:echoAerial,代码行数:17,代码来源:Security.php

示例8: enabled

 /**
  * Determine if CMSSecurity is enabled
  *
  * @return bool
  */
 public static function enabled()
 {
     // Disable shortcut
     if (!static::config()->reauth_enabled) {
         return false;
     }
     // Count all cms-supported methods
     $authenticators = Authenticator::get_authenticators();
     foreach ($authenticators as $authenticator) {
         // Supported if at least one authenticator is supported
         if ($authenticator::supports_cms()) {
             return true;
         }
     }
     return false;
 }
开发者ID:aaronleslie,项目名称:aaronunix,代码行数:21,代码来源:CMSSecurity.php


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