46         $this->db = $DIC->database();
    47         $this->rule_id = $a_rule_id;
    53         $this->rule_id = $a_id;
    63         $this->role_id = $a_id;
    71     public function setName(
string $a_name): void
    73         $this->attribute_name = $a_name;
    81     public function setValue(
string $a_value): void
    83         $this->attribute_value = $a_value;
    93         $this->plugin_active = $a_status;
   103         $this->add_on_update = $a_status;
   113         $this->remove_on_update = $a_status;
   123         $this->plugin_id = $a_id;
   145             return self::ERR_MISSING_ROLE;
   149                 return self::ERR_MISSING_NAME;
   152                 return self::ERR_MISSING_VALUE;
   155             return self::ERR_MISSING_PLUGIN_ID;
   161     public function delete(): 
bool   163         $query = 
'DELETE FROM ' . self::TABLE_NAME . 
' ' . 
'WHERE rule_id = ' . $this->db->quote(
   167         $this->db->manipulate($query);
   172     public function add(): bool
   174         $next_id = $this->db->nextId(self::TABLE_NAME);
   175         $query = 
'INSERT INTO ' . self::TABLE_NAME . 
' (rule_id,role_id,name,value,plugin,plugin_id,add_on_update,remove_on_update ) ' . 
'VALUES( '   176             . $this->db->quote($next_id, 
'integer') . 
', ' . $this->db->quote($this->
getRoleId(), 
'integer') . 
', '   177             . $this->db->quote($this->
getName(), 
'text') . 
', ' . $this->db->quote($this->
getValue(), 
'text') . 
', '   178             . $this->db->quote((
int) $this->
isPluginActive(), 
'integer') . 
', ' . $this->db->quote(
   184         $this->db->manipulate($query);
   185         $this->
setRuleId($this->db->getLastInsertId());
   192         $query = 
'UPDATE ' . self::TABLE_NAME . 
' ' . 
'SET role_id = ' . $this->db->quote(
   196             . $this->db->quote($this->
getName(), 
'text') . 
', ' . 
'value = ' . $this->db->quote(
   199             ) . 
', ' . 
'plugin = '   200             . $this->db->quote((
int) $this->
isPluginActive(), 
'integer') . 
', ' . 
'plugin_id = '   201             . $this->db->quote($this->
getPluginId() ?? 
'0', 
'integer') . 
', ' . 
'add_on_update = '   202             . $this->db->quote((
int) $this->
isAddOnUpdateEnabled(), 
'integer') . 
', ' . 
'remove_on_update = '   204             . 
'WHERE rule_id = ' . $this->db->quote($this->
getRuleId(), 
'integer');
   205         $this->db->manipulate($query);
   219         if (!isset($a_data[$this->
getName()])) {
   222         $values = $a_data[$this->
getName()];
   223         if (is_array($values)) {
   224             return in_array($this->
getValue(), $values);
   235         $pattern = str_replace(
'*', 
'.*?', $a_str1);
   237         return (
bool) preg_match(
"/" . $pattern . 
"/us", $a_str2);
   246         if (!isset($a_data[$this->
getName()])) {
   250         $values = $a_data[$this->
getName()];
   251         if (is_array($values)) {
   252             return in_array($this->
getValue(), $values);
   255         $pattern = str_replace(
'*', 
'.*?', $this->
getValue());
   257         return (
bool) preg_match(
'/^' . $pattern . 
'$/us', $values);
   266         $query = 
'SELECT * FROM ' . self::TABLE_NAME . 
' ' . 
'WHERE rule_id = ' . $this->db->quote(
   270         $res = $this->db->query($query);
   273             $this->
setName((
string) $row->name);
   274             $this->
setValue((
string) $row->value);
 
wildcardCompare(string $a_str1, string $a_str2)
 
static callPlugin(string $a_plugin_id, array $a_user_data)
 
enableRemoveOnUpdate(bool $a_status)
 
isRemoveOnUpdateEnabled()
 
__construct(int $a_rule_id=0)
 
enablePlugin(bool $a_status)
 
setPluginId(?string $a_id)
 
setValue(string $a_value)
 
const ERR_MISSING_PLUGIN_ID
 
enableAddOnUpdate(bool $a_status)
 
Shibboleth role assignment rule.