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


PHP Auth_OpenID_Association::getExpiresIn方法代码示例

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


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

示例1: getAssociation

 /**
  * Get an association
  * 
  * @param string $server_url The identity server endpoint
  * @param string $handle     The association handle
  * @return Auth_OpenID_Association
  */
 public function getAssociation($server_url, $handle = null)
 {
     $assocs = $this->getAssociations($server_url, $handle);
     if (!$assocs || count($assocs) == 0) {
         return null;
     } else {
         $associations = array();
         foreach ($assocs as $object) {
             $assoc = new Auth_OpenID_Association($object->handle, base64_decode($object->secret), $object->issued, $object->lifetime, $object->assoc_type);
             if ($assoc->getExpiresIn() == 0) {
                 $this->removeAssociation($server_url, $assoc->handle);
             } else {
                 $associations[] = array($assoc->issued, $assoc);
             }
         }
         if ($associations) {
             $issued = array();
             $assocs = array();
             foreach ($associations as $key => $assoc) {
                 $issued[$key] = $assoc[0];
                 $assocs[$key] = $assoc[1];
             }
             array_multisort($issued, SORT_DESC, $assocs, SORT_DESC, $associations);
             // return the most recently issued one.
             list($issued, $assoc) = $associations[0];
             return $assoc;
         } else {
             return null;
         }
     }
 }
开发者ID:lorea,项目名称:Hydra-dev,代码行数:38,代码来源:OpenID_ElggStore.php

示例2: getAssociation

 function getAssociation($server_url, $handle = null)
 {
     if (isset($handle)) {
         $meta_array = array('server_url' => $server_url, 'handle' => $handle);
         $assocs = elgg_get_entities_from_metadata(array('metadata_name_value_pairs' => $meta_array, 'types' => 'object', 'subtypes' => 'openid_client::association', 'metadata_name_value_pairs_operator' => 'and'));
     } else {
         $assocs = elgg_get_entities_from_metadata(array('metadata_names' => 'server_url', 'metadata_values' => $server_url, 'types' => 'object', 'subtypes' => 'openid_client::association', 'metadata_case_sensitive' => FALSE));
     }
     if (!$assocs || count($assocs) == 0) {
         return null;
     } else {
         $associations = array();
         foreach ($assocs as $assoc_row) {
             $assoc = new Auth_OpenID_Association($assoc_row->handle, base64_decode($assoc_row->secret), $assoc_row->issued, $assoc_row->lifetime, $assoc_row->assoc_type);
             if ($assoc->getExpiresIn() == 0) {
                 OpenIDServer_ElggStore::removeAssociation($server_url, $assoc->handle);
             } else {
                 $associations[] = array($assoc->issued, $assoc);
             }
         }
         if ($associations) {
             $issued = array();
             $assocs = array();
             foreach ($associations as $key => $assoc) {
                 $issued[$key] = $assoc[0];
                 $assocs[$key] = $assoc[1];
             }
             array_multisort($issued, SORT_DESC, $assocs, SORT_DESC, $associations);
             // return the most recently issued one.
             list($issued, $assoc) = $associations[0];
             return $assoc;
         } else {
             return null;
         }
     }
 }
开发者ID:lorea,项目名称:Hydra-dev,代码行数:36,代码来源:openid_server_include.php

示例3: getAssociation

 function getAssociation($server_url, $handle = null)
 {
     if ($handle !== null) {
         $assoc = $this->_get_assoc($server_url, $handle);
         $assocs = array();
         if ($assoc) {
             $assocs[] = $assoc;
         }
     } else {
         $assocs = $this->_get_assocs($server_url);
     }
     if (!$assocs || count($assocs) == 0) {
         return null;
     } else {
         $associations = array();
         foreach ($assocs as $assoc_row) {
             $assoc = new Auth_OpenID_Association($assoc_row['handle'], $assoc_row['secret'], $assoc_row['issued'], $assoc_row['lifetime'], $assoc_row['assoc_type']);
             $assoc->secret = $this->blobDecode($assoc->secret);
             if ($assoc->getExpiresIn() == 0) {
                 $this->removeAssociation($server_url, $assoc->handle);
             } else {
                 $associations[] = array($assoc->issued, $assoc);
             }
         }
         if ($associations) {
             $issued = array();
             $assocs = array();
             foreach ($associations as $key => $assoc) {
                 $issued[$key] = $assoc[0];
                 $assocs[$key] = $assoc[1];
             }
             array_multisort($issued, SORT_DESC, $assocs, SORT_DESC, $associations);
             // return the most recently issued one.
             list($issued, $assoc) = $associations[0];
             return $assoc;
         } else {
             return null;
         }
     }
 }
开发者ID:Mr-Robota,项目名称:TYPO3.CMS,代码行数:40,代码来源:SQLStore.php

示例4: time

 function test_expiredAssoc()
 {
     // Store an expired association for the server with the handle
     // that is in the query
     $issued = time() - 10;
     $lifetime = 0;
     $handle = 'handle';
     $assoc = new Auth_OpenID_Association($handle, 'secret', $issued, $lifetime, 'HMAC-SHA1');
     $this->assertTrue($assoc->getExpiresIn() <= 0);
     $this->store->storeAssociation($this->server_url, $assoc);
     $query = array('openid.return_to' => $this->return_to, 'openid.identity' => $this->server_id, 'openid.sig' => 'bogus', 'openid.signed' => 'identity,return_to', 'openid.assoc_handle' => $handle);
     $message = Auth_OpenID_Message::fromPostArgs($query);
     $this->consumer->disableReturnToChecking();
     $info = $this->_doIdRes($message, $this->endpoint, null);
     $this->assertEquals('failure', $info->status);
     $this->assertTrue(strpos($info->message, 'expired') !== false);
 }
开发者ID:umbecr,项目名称:camilaframework,代码行数:17,代码来源:Consumer.php

示例5: time

 function test_expiredAssoc()
 {
     // Store an expired association for the server with the handle
     // that is in the query
     $issued = time() - 10;
     $lifetime = 0;
     $handle = 'handle';
     $assoc = new Auth_OpenID_Association($handle, 'secret', $issued, $lifetime, 'HMAC-SHA1');
     $this->assertTrue($assoc->getExpiresIn() <= 0);
     $this->store->storeAssociation($this->server_url, $assoc);
     $query = array('openid.return_to' => $this->return_to, 'openid.identity' => $this->server_id, 'openid.assoc_handle' => $handle);
     $info = $this->_doIdRes($query);
     $this->assertEquals('failure', $info->status);
     $this->assertEquals($this->consumer_id, $info->identity_url);
     $this->assertTrue(strpos($info->message, 'expired') !== false);
 }
开发者ID:aprilchild,项目名称:aprilchild,代码行数:16,代码来源:Consumer.php


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