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


PHP Gdn_AuthenticationProviderModel::getProviders方法代码示例

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


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

示例1: disconnect

 /**
  *
  *
  * @param string $UserReference
  * @param string $Username
  * @param $Provider
  * @throws Exception
  */
 public function disconnect($UserReference = '', $Username = '', $Provider)
 {
     if (!Gdn::request()->isAuthenticatedPostBack(true)) {
         throw new Exception('Requires POST', 405);
     }
     $this->permission('Garden.SignIn.Allow');
     $this->getUserInfo($UserReference, $Username, '', true);
     // First try and delete the authentication the fast way.
     Gdn::sql()->delete('UserAuthentication', array('UserID' => $this->User->UserID, 'ProviderKey' => $Provider));
     // Delete the profile information.
     Gdn::userModel()->saveAttribute($this->User->UserID, $Provider, null);
     if ($this->deliveryType() == DELIVERY_TYPE_ALL) {
         redirect(userUrl($this->User), '', 'connections');
     } else {
         // Grab all of the providers again.
         $PModel = new Gdn_AuthenticationProviderModel();
         $Providers = $PModel->getProviders();
         $this->setData('_Providers', $Providers);
         $this->setData('Connections', array());
         $this->fireEvent('GetConnections');
         // Send back the connection button.
         $Connection = $this->data("Connections.{$Provider}");
         require_once $this->fetchViewLocation('connection_functions');
         $this->jsonTarget("#Provider_{$Provider} .ActivateSlider", connectButton($Connection), 'ReplaceWith');
         $this->render('Blank', 'Utility', 'Dashboard');
     }
 }
开发者ID:korelstar,项目名称:vanilla,代码行数:35,代码来源:class.profilecontroller.php

示例2: trustedDomains

 /**
  * Get an array of all of the trusted domains in the application.
  *
  * @return array
  */
 function trustedDomains()
 {
     // This domain is safe.
     $trustedDomains = [Gdn::request()->host()];
     $configuredDomains = c('Garden.TrustedDomains', []);
     if (!is_array($configuredDomains)) {
         $configuredDomains = is_string($configuredDomains) ? explode("\n", $configuredDomains) : [];
     }
     $configuredDomains = array_filter($configuredDomains);
     $trustedDomains = array_merge($trustedDomains, $configuredDomains);
     // Build a collection of authentication provider URLs.
     $authProviderModel = new Gdn_AuthenticationProviderModel();
     $providers = $authProviderModel->getProviders();
     $providerUrls = ['PasswordUrl', 'ProfileUrl', 'RegisterUrl', 'SignInUrl', 'SignOutUrl', 'URL'];
     // Iterate through the providers, only grabbing URLs if they're not empty and not already present.
     if (is_array($providers) && count($providers) > 0) {
         foreach ($providers as $key => $record) {
             foreach ($providerUrls as $urlKey) {
                 $providerUrl = $record[$urlKey];
                 if ($providerUrl && ($providerDomain = parse_url($providerUrl, PHP_URL_HOST))) {
                     if (!in_array($providerDomain, $trustedDomains)) {
                         $trustedDomains[] = $providerDomain;
                     }
                 }
             }
         }
     }
     Gdn::pluginManager()->EventArguments['TrustedDomains'] =& $trustedDomains;
     Gdn::pluginManager()->fireAs('EntryController')->fireEvent('BeforeTargetReturn');
     return array_unique($trustedDomains);
 }
开发者ID:vanilla,项目名称:vanilla,代码行数:36,代码来源:functions.general.php


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