23 require_once(
'./Services/AuthShibboleth/classes/class.ilShibbolethRoleAssignmentRules.php');
88 $this->rule_id = $a_rule_id;
98 $this->rule_id = $a_id;
116 $this->role_id = $a_id;
134 $this->attribute_name = $a_name;
152 $this->attribute_value = $a_value;
170 $this->plugin_active = $a_status;
188 $this->add_on_update = $a_status;
206 $this->remove_on_update = $a_status;
224 $this->plugin_id = $a_id;
258 return self::ERR_MISSING_ROLE;
262 return self::ERR_MISSING_NAME;
265 return self::ERR_MISSING_VALUE;
270 return self::ERR_MISSING_PLUGIN_ID;
281 public function delete()
283 $query =
'DELETE FROM ' . self::TABLE_NAME .
' ' .
'WHERE rule_id = ' . $this->db->quote($this->
getRuleId(),
'integer');
284 $this->db->manipulate(
$query);
295 $next_id = $this->db->nextId(self::TABLE_NAME);
296 $query =
'INSERT INTO ' . self::TABLE_NAME .
' (rule_id,role_id,name,value,plugin,plugin_id,add_on_update,remove_on_update ) ' .
'VALUES( ' 297 . $this->db->quote($next_id,
'integer') .
', ' . $this->db->quote($this->
getRoleId(),
'integer') .
', ' 298 . $this->db->quote($this->
getName(),
'text') .
', ' . $this->db->quote($this->
getValue(),
'text') .
', ' 299 . $this->db->quote((
int) $this->
isPluginActive(),
'integer') .
', ' . $this->db->quote((
int) $this->
getPluginId(),
'integer') .
', ' 302 $this->db->manipulate(
$query);
303 $this->
setRuleId($this->db->getLastInsertId());
314 $query =
'UPDATE ' . self::TABLE_NAME .
' ' .
'SET role_id = ' . $this->db->quote($this->
getRoleId(),
'integer') .
', ' .
'name = ' 315 . $this->db->quote($this->
getName(),
'text') .
', ' .
'value = ' . $this->db->quote($this->
getValue(),
'text') .
', ' .
'plugin = ' 316 . $this->db->quote((
int) $this->
isPluginActive(),
'integer') .
', ' .
'plugin_id = ' 317 . $this->db->quote((
int) $this->
getPluginId(),
'integer') .
', ' .
'add_on_update = ' 318 . $this->db->quote((
int) $this->
isAddOnUpdateEnabled(),
'integer') .
', ' .
'remove_on_update = ' 320 .
'WHERE rule_id = ' . $this->db->quote($this->
getRuleId(),
'integer');
321 $this->db->manipulate(
$query);
339 if (!isset($a_data[$this->
getName()])) {
360 $pattern = str_replace(
'*',
'.*?', $a_str1);
362 return (
bool) preg_match(
"/" . $pattern .
"/us", $a_str2);
376 if (!isset($a_data[$this->
getName()])) {
383 $pattern = str_replace(
'*',
'.*?', $this->
getValue());
385 return (
bool) preg_match(
'/^' . $pattern .
'$/us',
$values);
398 $query =
'SELECT * FROM ' . self::TABLE_NAME .
' ' .
'WHERE rule_id = ' . $this->db->quote($this->
getRuleId(),
'integer');
static callPlugin($a_plugin_id, $a_user_data)
__construct($a_rule_id=0)
isRemoveOnUpdateEnabled()
wildcardCompare($a_str1, $a_str2)
foreach($_POST as $key=> $value) $res
enableRemoveOnUpdate($a_status)
enableAddOnUpdate($a_status)
const ERR_MISSING_PLUGIN_ID
Shibboleth role assignment rule.