コード例 #1
0
 /**
  * @param array $a_data
  *
  * @return bool
  */
 public function doesMatch(array $a_data)
 {
     if ($this->isPluginActive()) {
         return ilShibbolethRoleAssignmentRules::callPlugin($this->getPluginId(), $a_data);
     }
     if (!isset($a_data[$this->getName()])) {
         return false;
     }
     $values = $a_data[$this->getName()];
     if (is_array($values)) {
         return in_array($this->getValue(), $values);
     } else {
         $pattern = str_replace('*', '.*?', $this->getValue());
         return (bool) preg_match('/^' . $pattern . '$/us', $values);
     }
 }
コード例 #2
0
 public function matches($a_data)
 {
     if ($this->isPluginActive()) {
         include_once './Services/AuthShibboleth/classes/class.ilShibbolethRoleAssignmentRules.php';
         return ilShibbolethRoleAssignmentRules::callPlugin($this->getPluginId(), $a_data);
     }
     // No value
     if (!isset($a_data[$this->getName()])) {
         return false;
     }
     $values = $a_data[$this->getName()];
     if (is_array($values)) {
         return in_array($this->getValue(), $values);
     } else {
         return $this->wildcardCompare($this->getValue(), $values);
         #return $this->getValue() == $values;
     }
 }