ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilExternalAuthUserAttributeMapping Class Reference

Class ilExternalAuthUserAttributeMapping. More...

+ Inheritance diagram for ilExternalAuthUserAttributeMapping:
+ Collaboration diagram for ilExternalAuthUserAttributeMapping:

Public Member Functions

 __construct ($authMode, $authSourceId=0)
 ilExternalAuthUserAttributeMapping constructor. More...
 
 getAuthSourceId ()
 
 setAuthSourceId ($authSourceId)
 
 getAuthMode ()
 
 setAuthMode ($authMode)
 
 getEmptyRule ()
 
 offsetExists ($offset)
 {} More...
 
 offsetGet ($offset)
 {} More...
 
 offsetSet ($offset, $value)
 {} More...
 
 offsetUnset ($offset)
 {} More...
 
 count ()
 
 current ()
 
 next ()
 {} More...
 
 key ()
 {} More...
 
 valid ()
 {} More...
 
 rewind ()
 
 save ()
 
 delete ()
 

Protected Member Functions

 read ()
 

Protected Attributes

 $db
 
 $authMode = ''
 
 $authSourceId
 
 $mapping = array()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilExternalAuthUserAttributeMapping::__construct (   $authMode,
  $authSourceId = 0 
)

ilExternalAuthUserAttributeMapping constructor.

Parameters
string$authMode
int$authSourceId

Definition at line 37 of file class.ilExternalAuthUserAttributeMapping.php.

References $authMode, $authSourceId, $GLOBALS, read(), setAuthMode(), and setAuthSourceId().

38  {
39  assert(is_string($authMode));
40  assert(is_numeric($authSourceId));
41 
42  $this->db = $GLOBALS['DIC']->database();
43 
44  $this->setAuthMode($authMode);
46 
47  $this->read();
48  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
+ Here is the call graph for this function:

Member Function Documentation

◆ count()

ilExternalAuthUserAttributeMapping::count ( )
Returns
int

Definition at line 129 of file class.ilExternalAuthUserAttributeMapping.php.

130  {
131  return count($this->mapping);
132  }

◆ current()

ilExternalAuthUserAttributeMapping::current ( )
Returns
ilExternalAuthUserAttributeMappingRule

Definition at line 137 of file class.ilExternalAuthUserAttributeMapping.php.

Referenced by valid().

138  {
139  return current($this->mapping);
140  }
+ Here is the caller graph for this function:

◆ delete()

ilExternalAuthUserAttributeMapping::delete ( )

Definition at line 217 of file class.ilExternalAuthUserAttributeMapping.php.

References array, getAuthMode(), and getAuthSourceId().

218  {
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'),
223  array($this->getAuthMode(), $this->getAuthSourceId())
224  );
225  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getAuthMode()

ilExternalAuthUserAttributeMapping::getAuthMode ( )
Returns
string

Definition at line 69 of file class.ilExternalAuthUserAttributeMapping.php.

References $authMode.

Referenced by delete(), read(), and save().

+ Here is the caller graph for this function:

◆ getAuthSourceId()

ilExternalAuthUserAttributeMapping::getAuthSourceId ( )
Returns
int

Definition at line 53 of file class.ilExternalAuthUserAttributeMapping.php.

References $authSourceId.

Referenced by delete(), read(), and save().

+ Here is the caller graph for this function:

◆ getEmptyRule()

ilExternalAuthUserAttributeMapping::getEmptyRule ( )
Returns
ilExternalAuthUserAttributeMappingRule

Definition at line 85 of file class.ilExternalAuthUserAttributeMapping.php.

Referenced by read().

86  {
88  }
+ Here is the caller graph for this function:

◆ key()

ilExternalAuthUserAttributeMapping::key ( )

{}

Definition at line 153 of file class.ilExternalAuthUserAttributeMapping.php.

154  {
155  return key($this->mapping);
156  }

◆ next()

ilExternalAuthUserAttributeMapping::next ( )

{}

Definition at line 145 of file class.ilExternalAuthUserAttributeMapping.php.

146  {
147  next($this->mapping);
148  }

◆ offsetExists()

ilExternalAuthUserAttributeMapping::offsetExists (   $offset)

{}

Definition at line 93 of file class.ilExternalAuthUserAttributeMapping.php.

Referenced by offsetGet().

94  {
95  return isset($this->mapping[$offset]);
96  }
+ Here is the caller graph for this function:

◆ offsetGet()

ilExternalAuthUserAttributeMapping::offsetGet (   $offset)

{}

Definition at line 101 of file class.ilExternalAuthUserAttributeMapping.php.

References offsetExists().

102  {
103  return $this->offsetExists($offset) ? $this->mapping[$offset] : null;
104  }
+ Here is the call graph for this function:

◆ offsetSet()

ilExternalAuthUserAttributeMapping::offsetSet (   $offset,
  $value 
)

{}

Definition at line 109 of file class.ilExternalAuthUserAttributeMapping.php.

110  {
111  if (is_null($offset)) {
112  $this->mapping[] = $value;
113  } else {
114  $this->mapping[$offset] = $value;
115  }
116  }

◆ offsetUnset()

ilExternalAuthUserAttributeMapping::offsetUnset (   $offset)

{}

Definition at line 121 of file class.ilExternalAuthUserAttributeMapping.php.

122  {
123  unset($this->mapping[$offset]);
124  }

◆ read()

ilExternalAuthUserAttributeMapping::read ( )
protected

Definition at line 174 of file class.ilExternalAuthUserAttributeMapping.php.

References $res, $row, $rule, array, getAuthMode(), getAuthSourceId(), and getEmptyRule().

Referenced by __construct().

175  {
176  $this->mapping = array();
177 
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'),
181  array($this->getAuthMode(), $this->getAuthSourceId())
182  );
183  while ($row = $this->db->fetchAssoc($res)) {
184  $rule = $this->getEmptyRule();
185  $rule->setAttribute($row['attribute']);
186  $rule->setExternalAttribute($row['ext_attribute']);
187  $rule->updateAutomatically((bool) $row['update_automatically']);
188 
189  $this->mapping[$rule->getAttribute()] = $rule;
190  }
191  }
foreach($_POST as $key=> $value) $res
$rule
Definition: showstats.php:43
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rewind()

ilExternalAuthUserAttributeMapping::rewind ( )

Definition at line 166 of file class.ilExternalAuthUserAttributeMapping.php.

167  {
168  reset($this->mapping);
169  }

◆ save()

ilExternalAuthUserAttributeMapping::save ( )

Definition at line 196 of file class.ilExternalAuthUserAttributeMapping.php.

References $rule, array, getAuthMode(), and getAuthSourceId().

197  {
198  foreach ($this->mapping as $rule) {
199  $this->db->replace(
200  'auth_ext_attr_mapping',
201  array(
202  'auth_mode' => array('text', $this->getAuthMode()),
203  'auth_src_id' => array('integer', $this->getAuthSourceId()),
204  'attribute' => array('text', $rule->getAttribute())
205  ),
206  array(
207  'ext_attribute' => array('text', $rule->getExternalAttribute()),
208  'update_automatically' => array('integer', (int) $rule->isAutomaticallyUpdated())
209  )
210  );
211  }
212  }
$rule
Definition: showstats.php:43
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ setAuthMode()

ilExternalAuthUserAttributeMapping::setAuthMode (   $authMode)
Parameters
string$authMode

Definition at line 77 of file class.ilExternalAuthUserAttributeMapping.php.

References $authMode.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setAuthSourceId()

ilExternalAuthUserAttributeMapping::setAuthSourceId (   $authSourceId)
Parameters
int$authSourceId

Definition at line 61 of file class.ilExternalAuthUserAttributeMapping.php.

References $authSourceId.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ valid()

ilExternalAuthUserAttributeMapping::valid ( )

{}

Definition at line 161 of file class.ilExternalAuthUserAttributeMapping.php.

References current().

162  {
163  return current($this->mapping);
164  }
+ Here is the call graph for this function:

Field Documentation

◆ $authMode

ilExternalAuthUserAttributeMapping::$authMode = ''
protected

◆ $authSourceId

ilExternalAuthUserAttributeMapping::$authSourceId
protected

◆ $db

ilExternalAuthUserAttributeMapping::$db
protected

Definition at line 15 of file class.ilExternalAuthUserAttributeMapping.php.

◆ $mapping

ilExternalAuthUserAttributeMapping::$mapping = array()
protected

Definition at line 30 of file class.ilExternalAuthUserAttributeMapping.php.


The documentation for this class was generated from the following file: