ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Abstract.php
Go to the documentation of this file.
1 <?php
2 
42 {
43 
48  private $_proxyTicket;
49 
60  public function setProxyTicket($proxyTicket)
61  {
62  if (empty($proxyTicket)) {
64  'Trying to initialize with an empty proxy ticket.'
65  );
66  }
67  if (!empty($this->_proxyTicket)) {
69  'Already initialized, cannot change the proxy ticket.'
70  );
71  }
72  $this->_proxyTicket = $proxyTicket;
73  }
74 
82  protected function getProxyTicket()
83  {
84  if (empty($this->_proxyTicket)) {
86  'No proxy ticket yet. Call $this->initializeProxyTicket() to aquire the proxy ticket.'
87  );
88  }
89 
90  return $this->_proxyTicket;
91  }
92 
96  private $_casClient;
97 
111  public function setCasClient(CAS_Client $casClient)
112  {
113  if (!empty($this->_proxyTicket)) {
114  throw new CAS_OutOfSequenceException(
115  'Already initialized, cannot change the CAS_Client.'
116  );
117  }
118 
119  $this->_casClient = $casClient;
120  }
121 
132  protected function initializeProxyTicket()
133  {
134  if (!empty($this->_proxyTicket)) {
135  throw new CAS_OutOfSequenceException(
136  'Already initialized, cannot initialize again.'
137  );
138  }
139  // Allow usage of a particular CAS_Client for unit testing.
140  if (empty($this->_casClient)) {
142  } else {
143  $this->_casClient->initializeProxiedService($this);
144  }
145  }
146 }
$_proxyTicket
The proxy ticket that can be used when making service requests.
Definition: Abstract.php:48
setCasClient(CAS_Client $casClient)
Use a particular CAS_Client->initializeProxiedService() rather than the static phpCAS::initializeProx...
Definition: Abstract.php:111
initializeProxyTicket()
Fetch our proxy ticket.
Definition: Abstract.php:132
This class implements common methods for ProxiedService implementations included with phpCAS...
Definition: Abstract.php:41
This interface defines methods that allow proxy-authenticated service handlers to interact with phpCA...
setProxyTicket($proxyTicket)
Register a proxy ticket with the Proxy that it can use when making requests.
Definition: Abstract.php:60
This class defines Exceptions that should be thrown when the sequence of operations is invalid...
Exception that denotes invalid arguments were passed.
static initializeProxiedService(CAS_ProxiedService $proxiedService)
Initialize a proxied-service handler with the proxy-ticket it should use.
Definition: CAS.php:915
getProxyTicket()
Answer the proxy ticket to be used when making requests.
Definition: Abstract.php:82
The CAS_Client class is a client interface that provides CAS authentication to PHP applications...
Definition: Client.php:51