4require_once
'Services/Authentication/classes/External/UserAttributeMapping/class.ilExternalAuthUserAttributeMappingRule.php';
42 $this->db =
$GLOBALS[
'DIC']->database();
95 return isset($this->mapping[$offset]);
103 return $this->
offsetExists($offset) ? $this->mapping[$offset] :
null;
111 if (is_null($offset)) {
112 $this->mapping[] = $value;
114 $this->mapping[$offset] = $value;
123 unset($this->mapping[$offset]);
131 return count($this->mapping);
139 return current($this->mapping);
147 next($this->mapping);
155 return key($this->mapping);
163 return current($this->mapping);
168 reset($this->mapping);
176 $this->mapping = array();
178 $res = $this->db->queryF(
179 'SELECT * FROM auth_ext_attr_mapping WHERE auth_mode = %s AND auth_src_id = %s',
180 array(
'text',
'integer'),
183 while ($row = $this->db->fetchAssoc(
$res)) {
185 $rule->setAttribute($row[
'attribute']);
186 $rule->setExternalAttribute($row[
'ext_attribute']);
187 $rule->updateAutomatically((
bool) $row[
'update_automatically']);
189 $this->mapping[$rule->getAttribute()] = $rule;
198 foreach ($this->mapping as $rule) {
200 'auth_ext_attr_mapping',
202 'auth_mode' => array(
'text', $this->
getAuthMode()),
204 'attribute' => array(
'text', $rule->getAttribute())
207 'ext_attribute' => array(
'text', $rule->getExternalAttribute()),
208 'update_automatically' => array(
'integer', (
int) $rule->isAutomaticallyUpdated())
217 public function delete()
219 $this->mapping = array();
220 $this->db->manipulateF(
221 'DELETE FROM auth_ext_attr_mapping WHERE auth_mode = %s AND auth_src_id = %s',
222 array(
'text',
'integer'),
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
Class ilExternalAuthUserAttributeMappingRule.
Class ilExternalAuthUserAttributeMapping.
setAuthSourceId($authSourceId)
__construct($authMode, $authSourceId=0)
ilExternalAuthUserAttributeMapping constructor.
offsetSet($offset, $value)
{}
foreach($_POST as $key=> $value) $res