Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/lib/zend/Zend/Service/DeveloperGarden/SecurityTokenServer.php
Go to the documentation of this file.
00001 <?php
00026 require_once 'Zend/Service/DeveloperGarden/SecurityTokenServer/Cache.php';
00027 
00031 require_once 'Zend/Service/DeveloperGarden/Client/ClientAbstract.php';
00032 
00036 require_once 'Zend/Service/DeveloperGarden/Response/SecurityTokenServer/SecurityTokenResponse.php';
00037 
00041 require_once 'Zend/Service/DeveloperGarden/Response/SecurityTokenServer/GetTokensResponse.php';
00042 
00051 class Zend_Service_DeveloperGarden_SecurityTokenServer
00052     extends Zend_Service_DeveloperGarden_Client_ClientAbstract
00053 {
00059     protected $_wsdlFile = 'https://sts.idm.telekom.com/TokenService?wsdl';
00060 
00066     protected $_wsdlFileLocal = 'Wsdl/TokenService.wsdl';
00067 
00074     protected $_classMap = array(
00075         'SecurityTokenResponse' => 'Zend_Service_DeveloperGarden_Response_SecurityTokenServer_SecurityTokenResponse',
00076         'getTokensResponse'     => 'Zend_Service_DeveloperGarden_Response_SecurityTokenServer_GetTokensResponse'
00077     );
00078 
00084     public function getLoginToken()
00085     {
00086         $token = Zend_Service_DeveloperGarden_SecurityTokenServer_Cache::getTokenFromCache(
00087             'securityToken'
00088         );
00089 
00090         if ($token === null
00091             || !$token->isValid()
00092         ) {
00093             $token = $this->getSoapClient()->login('login');
00094             Zend_Service_DeveloperGarden_SecurityTokenServer_Cache::setTokenToCache(
00095                 'securityToken',
00096                 $token
00097             );
00098         }
00099 
00100         return $token;
00101     }
00102 
00108     public function getTokens()
00109     {
00110         $token = Zend_Service_DeveloperGarden_SecurityTokenServer_Cache::getTokenFromCache(
00111             'getTokens'
00112         );
00113 
00114         if ($token === null
00115             || !$token->isValid()
00116         ) {
00117             $token = $this->getSoapClient()->getTokens(array(
00118                 'serviceId' => $this->_serviceAuthId
00119             ));
00120             Zend_Service_DeveloperGarden_SecurityTokenServer_Cache::setTokenToCache(
00121                 'getTokens',
00122                 $token
00123             );
00124         }
00125         return $token;
00126     }
00127 }
 All Data Structures Namespaces Files Functions Variables Enumerations