[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/lib/zend/Zend/Service/DeveloperGarden/Response/SecurityTokenServer/ -> GetTokensResponse.php (source)

   1  <?php
   2  /**
   3   * Zend Framework
   4   *
   5   * LICENSE
   6   *
   7   * This source file is subject to the new BSD license that is bundled
   8   * with this package in the file LICENSE.txt.
   9   * It is also available through the world-wide-web at this URL:
  10   * http://framework.zend.com/license/new-bsd
  11   * If you did not receive a copy of the license and are unable to
  12   * obtain it through the world-wide-web, please send an email
  13   * to [email protected] so we can send you a copy immediately.
  14   *
  15   * @category   Zend
  16   * @package    Zend_Service
  17   * @subpackage DeveloperGarden
  18   * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  19   * @license    http://framework.zend.com/license/new-bsd     New BSD License
  20   * @version    $Id$
  21   */
  22  
  23  /**
  24   * @see Zend_Service_DeveloperGarden_Response_ResponseAbstract
  25   */
  26  require_once 'Zend/Service/DeveloperGarden/Response/ResponseAbstract.php';
  27  
  28  /**
  29   * @see Zend_Service_DeveloperGarden_Response_SecurityTokenServer_Interface
  30   */
  31  require_once 'Zend/Service/DeveloperGarden/Response/SecurityTokenServer/Interface.php';
  32  
  33  /**
  34   * @category   Zend
  35   * @package    Zend_Service
  36   * @subpackage DeveloperGarden
  37   * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  38   * @author     Marco Kaiser
  39   * @license    http://framework.zend.com/license/new-bsd     New BSD License
  40   */
  41  class Zend_Service_DeveloperGarden_Response_SecurityTokenServer_GetTokensResponse
  42      extends Zend_Service_DeveloperGarden_Response_ResponseAbstract
  43      implements Zend_Service_DeveloperGarden_Response_SecurityTokenServer_Interface
  44  {
  45      /**
  46       * the security token
  47       * @var Zend_Service_DeveloperGarden_Response_SecurityTokenServer_SecurityTokenResponse
  48       */
  49      public $securityToken = null;
  50  
  51      /**
  52       * returns the security token
  53       *
  54       * @return string
  55       */
  56      public function getTokenData()
  57      {
  58          return $this->getSecurityToken();
  59      }
  60  
  61      /**
  62       * returns the security token
  63       *
  64       * @return string
  65       */
  66      public function getSecurityToken()
  67      {
  68          if (!$this->securityToken instanceof Zend_Service_DeveloperGarden_Response_SecurityTokenServer_SecurityTokenResponse) {
  69              require_once 'Zend/Service/DeveloperGarden/Response/SecurityTokenServer/Exception.php';
  70              throw new Zend_Service_DeveloperGarden_Response_SecurityTokenServer_Exception(
  71                  'No valid securityToken found.'
  72              );
  73          }
  74          return $this->securityToken->getTokenData();
  75      }
  76  
  77      /**
  78       * returns true if the stored token data is valid
  79       *
  80       * @return boolean
  81       */
  82      public function isValid()
  83      {
  84          /**
  85           * @todo implement the true token validation check
  86           */
  87          if (isset($this->securityToken)
  88              && !empty($this->securityToken->tokenData)
  89          ) {
  90              return true;
  91          }
  92          return false;
  93      }
  94  }


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1