ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
AllowedList.php
Go to the documentation of this file.
1 <?php
2 
44 {
45  private $_chains = array();
46 
52  public function isProxyingAllowed()
53  {
54  return (count($this->_chains) > 0);
55  }
56 
64  public function allowProxyChain(CAS_ProxyChain_Interface $chain)
65  {
66  $this->_chains[] = $chain;
67  }
68 
76  public function isProxyListAllowed(array $proxies)
77  {
79  if (empty($proxies)) {
80  phpCAS::trace("No proxies were found in the response");
81  phpCAS::traceEnd(true);
82  return true;
83  } elseif (!$this->isProxyingAllowed()) {
84  phpCAS::trace("Proxies are not allowed");
85  phpCAS::traceEnd(false);
86  return false;
87  } else {
88  $res = $this->contains($proxies);
90  return $res;
91  }
92  }
93 
102  public function contains(array $list)
103  {
105  $count = 0;
106  foreach ($this->_chains as $chain) {
107  phpCAS::trace("Checking chain " . $count++);
108  if ($chain->matches($list)) {
109  phpCAS::traceEnd(true);
110  return true;
111  }
112  }
113  phpCAS::trace("No proxy chain matches.");
114  phpCAS::traceEnd(false);
115  return false;
116  }
117 }
ProxyChain is a container for storing chains of valid proxies that can be used to validate proxied re...
Definition: AllowedList.php:43
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
An interface for classes that define a list of allowed proxies in front of the current application...
Definition: Interface.php:41
isProxyingAllowed()
Check whether proxies are allowed by configuration.
Definition: AllowedList.php:52
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static trace($str)
This method is used to log something in debug mode.
Definition: CAS.php:599
foreach($_POST as $key=> $value) $res
isProxyListAllowed(array $proxies)
Check if the proxies found in the response match the allowed proxies.
Definition: AllowedList.php:76
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
allowProxyChain(CAS_ProxyChain_Interface $chain)
Add a chain of proxies to the list of possible chains.
Definition: AllowedList.php:64
contains(array $list)
Validate the proxies from the proxy ticket validation against the chains that were definded...