ILIAS  release_7 Revision v7.30-3-g800a261c036
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().

+ 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 }

References count().

Referenced by count().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ current()

ilExternalAuthUserAttributeMapping::current ( )
Returns
ilExternalAuthUserAttributeMappingRule

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

References current().

Referenced by current(), and valid().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilExternalAuthUserAttributeMapping::delete ( )

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

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 }

References getAuthMode(), and getAuthSourceId().

+ Here is the call graph for this function:

◆ getAuthMode()

ilExternalAuthUserAttributeMapping::getAuthMode ( )
Returns
string

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

70 {
71 return $this->authMode;
72 }

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.

54 {
56 }

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.

86 {
88 }

Referenced by read().

+ 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 }

References key().

Referenced by key().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ next()

ilExternalAuthUserAttributeMapping::next ( )

{}

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

References next().

Referenced by next().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ offsetExists()

ilExternalAuthUserAttributeMapping::offsetExists (   $offset)

{}

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

94 {
95 return isset($this->mapping[$offset]);
96 }

Referenced by offsetGet().

+ Here is the caller graph for this function:

◆ offsetGet()

ilExternalAuthUserAttributeMapping::offsetGet (   $offset)

{}

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

102 {
103 return $this->offsetExists($offset) ? $this->mapping[$offset] : null;
104 }

References offsetExists().

+ 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.

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

References $res, getAuthMode(), getAuthSourceId(), and getEmptyRule().

Referenced by __construct().

+ 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.

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 }

References getAuthMode(), and getAuthSourceId().

+ Here is the call graph for this function:

◆ setAuthMode()

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

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

78 {
79 $this->authMode = $authMode;
80 }

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.

62 {
63 $this->authSourceId = $authSourceId;
64 }

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.

162 {
163 return current($this->mapping);
164 }

References current().

+ 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: