phpCAS version 1.3.6

Abstract.php
Go to the documentation of this file.
1 <?php
2
41 abstract class CAS_ProxiedService_Abstract
42 implements CAS_ProxiedService, CAS_ProxiedService_Testable
43 {
44
49 private $_proxyTicket;
50
61 public function setProxyTicket ($proxyTicket)
62 {
63 if (empty($proxyTicket)) {
64 throw new CAS_InvalidArgumentException(
65 'Trying to initialize with an empty proxy ticket.'
66 );
67 }
68 if (!empty($this->_proxyTicket)) {
69 throw new CAS_OutOfSequenceException(
70 'Already initialized, cannot change the proxy ticket.'
71 );
72 }
73 $this->_proxyTicket = $proxyTicket;
74 }
75
83 protected function getProxyTicket ()
84 {
85 if (empty($this->_proxyTicket)) {
86 throw new CAS_OutOfSequenceException(
87 'No proxy ticket yet. Call $this->initializeProxyTicket() to aquire the proxy ticket.'
88 );
89 }
90
91 return $this->_proxyTicket;
92 }
93
97 private $_casClient;
98
112 public function setCasClient (CAS_Client $casClient)
113 {
114 if (!empty($this->_proxyTicket)) {
115 throw new CAS_OutOfSequenceException(
116 'Already initialized, cannot change the CAS_Client.'
117 );
118 }
119
120 $this->_casClient = $casClient;
121 }
122
133 protected function initializeProxyTicket()
134 {
135 if (!empty($this->_proxyTicket)) {
136 throw new CAS_OutOfSequenceException(
137 'Already initialized, cannot initialize again.'
138 );
139 }
140 // Allow usage of a particular CAS_Client for unit testing.
141 if (empty($this->_casClient)) {
142 phpCAS::initializeProxiedService($this);
143 } else {
144 $this->_casClient->initializeProxiedService($this);
145 }
146 }
147
148 }
149 ?>
CAS_ProxiedService_Abstract\$_proxyTicket
$_proxyTicket
Definition: Abstract.php:49
CAS_ProxiedService_Abstract\setCasClient
setCasClient(CAS_Client $casClient)
Definition: Abstract.php:112
CAS_ProxiedService_Abstract\initializeProxyTicket
initializeProxyTicket()
Definition: Abstract.php:133
CAS_ProxiedService_Abstract
Definition: Abstract.php:41
CAS_ProxiedService
Definition: ProxiedService.php:47
CAS_ProxiedService_Abstract\setProxyTicket
setProxyTicket($proxyTicket)
Definition: Abstract.php:61
CAS_OutOfSequenceException
Definition: OutOfSequenceException.php:44
CAS_InvalidArgumentException
Definition: InvalidArgumentException.php:40
phpCAS\initializeProxiedService
static initializeProxiedService(CAS_ProxiedService $proxiedService)
Definition: CAS.php:891
CAS_ProxiedService_Testable
Definition: Testable.php:56
CAS_ProxiedService_Abstract\getProxyTicket
getProxyTicket()
Definition: Abstract.php:83
CAS_Client
Definition: Client.php:51
CAS_ProxiedService_Abstract\$_casClient
$_casClient
Definition: Abstract.php:97