ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilOpenIdSettings Class Reference

@classDescription Stores OpenId related settings More...

+ Collaboration diagram for ilOpenIdSettings:

Public Member Functions

 isActive ()
 Is open id auth active. More...
 
 setActive ($a_status)
 Set open id active. More...
 
 forcedProviderSelection ()
 is provider selection forced More...
 
 forceProviderSelection ($a_status)
 Set force selection status. More...
 
 isCreationEnabled ()
 Is account creation enabled. More...
 
 enableCreation ($a_status)
 Enable account creation. More...
 
 isAccountMigrationEnabled ()
 Is account migration enabled. More...
 
 enableAccountMigration ($a_status)
 Enable account migration. More...
 
 getDefaultRole ()
 Get default role. More...
 
 setDefaultRole ($a_role)
 Set default role. More...
 
 update ()
 Update settings. More...
 
 getConsumer ()
 Get open id consumer. More...
 
 getReturnLocation ()
 Get oid return location. More...
 
 initConsumer ()
 

Static Public Member Functions

static getInstance ()
 Get singleton instance. More...
 

Protected Member Functions

 read ()
 Read settings from db. More...
 
 initTempDir ()
 Init Temp directory. More...
 

Private Member Functions

 __construct ()
 Singleton constructor. More...
 

Private Attributes

 $storage = null
 
 $active = false
 
 $account_migration = false
 
 $default_role = 0
 
 $creation = false
 
 $forced_selection = false
 
 $consumer = null
 

Static Private Attributes

static $instance = null
 

Detailed Description

@classDescription Stores OpenId related settings

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 13 of file class.ilOpenIdSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilOpenIdSettings::__construct ( )
private

Singleton constructor.

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

31 {
32 $this->storage = new ilSetting('auth_openid');
33 $this->read();
34 }
read()
Read settings from db.
ILIAS Setting Class.

References read().

+ Here is the call graph for this function:

Member Function Documentation

◆ enableAccountMigration()

ilOpenIdSettings::enableAccountMigration (   $a_status)

Enable account migration.

Parameters
bool$a_status
Returns

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

122 {
123 $this->account_migration = $a_status;
124 }

Referenced by read().

+ Here is the caller graph for this function:

◆ enableCreation()

ilOpenIdSettings::enableCreation (   $a_status)

Enable account creation.

Parameters
bool$a_status
Returns

Definition at line 102 of file class.ilOpenIdSettings.php.

103 {
104 $this->creation = $a_status;
105 }

Referenced by read().

+ Here is the caller graph for this function:

◆ forcedProviderSelection()

ilOpenIdSettings::forcedProviderSelection ( )

is provider selection forced

Returns

Definition at line 73 of file class.ilOpenIdSettings.php.

References $forced_selection.

Referenced by update().

+ Here is the caller graph for this function:

◆ forceProviderSelection()

ilOpenIdSettings::forceProviderSelection (   $a_status)

Set force selection status.

Parameters
bool$a_status
Returns

Definition at line 83 of file class.ilOpenIdSettings.php.

84 {
85 $this->forced_selection = $a_status;
86 }

Referenced by read().

+ Here is the caller graph for this function:

◆ getConsumer()

ilOpenIdSettings::getConsumer ( )

Get open id consumer.

Returns

Definition at line 175 of file class.ilOpenIdSettings.php.

176 {
177 return $this->consumer;
178 }

References $consumer.

◆ getDefaultRole()

ilOpenIdSettings::getDefaultRole ( )

Get default role.

Returns

Definition at line 130 of file class.ilOpenIdSettings.php.

131 {
132 return $this->default_role;
133 }

References $default_role.

Referenced by update().

+ Here is the caller graph for this function:

◆ getInstance()

static ilOpenIdSettings::getInstance ( )
static

Get singleton instance.

Returns
object ilOpenIdSettings

Definition at line 40 of file class.ilOpenIdSettings.php.

41 {
42 if(self::$instance != null)
43 {
44 return self::$instance;
45 }
46 return self::$instance = new ilOpenIdSettings();
47 }
@classDescription Stores OpenId related settings

References $instance.

Referenced by ilOpenIdSettingsGUI\__construct(), ilOpenIdAttributeToUser\__construct(), ilAuthUtils\_getActiveAuthModes(), ilAuthUtils\_isExternalAccountEnabled(), ilOpenIdProviders\getSelectedProvider(), ilAuthContainerOpenId\initSettings(), ilAuthOpenId\initSettings(), and ilStartUpGUI\showOpenIdLoginForm().

+ Here is the caller graph for this function:

◆ getReturnLocation()

ilOpenIdSettings::getReturnLocation ( )

Get oid return location.

Returns

Definition at line 184 of file class.ilOpenIdSettings.php.

185 {
186 global $ilCtrl;
187
188 $ilCtrl->setTargetScript('ilias.php');
189 $ilCtrl->setParameterByClass('ilstartupgui','oid_check_status',1);
190 $redir = ILIAS_HTTP_PATH.'/';
191 $redir .= $ilCtrl->getLinkTargetByClass('ilstartupgui','showLogin','',false,false);
192 return $redir;
193 }
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl.

◆ initConsumer()

ilOpenIdSettings::initConsumer ( )

Definition at line 208 of file class.ilOpenIdSettings.php.

209 {
210 include_once "Auth/OpenID/Consumer.php";
211 include_once "Auth/OpenID/FileStore.php";
212 include_once 'Auth/OpenID/DumbStore.php';
213
214 if(is_object($this->consumer))
215 {
216 return true;
217 }
218
219 $this->initTempDir();
220 $store = new Auth_OpenID_FileStore(ilUtil::getDataDir().DIRECTORY_SEPARATOR.'tmp');
221 return $this->consumer = new Auth_OpenID_Consumer($store);
222 }
initTempDir()
Init Temp directory.
static getDataDir()
get data directory (outside webspace)

References ilUtil\getDataDir(), and initTempDir().

+ Here is the call graph for this function:

◆ initTempDir()

ilOpenIdSettings::initTempDir ( )
protected

Init Temp directory.

Returns

Definition at line 199 of file class.ilOpenIdSettings.php.

200 {
201 if(!file_exists(ilUtil::getDataDir().DIRECTORY_SEPARATOR.'tmp'))
202 {
203 ilUtil::makeDir(ilUtil::getDataDir().DIRECTORY_SEPARATOR.'tmp');
204 }
205 return true;
206 }
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...

References ilUtil\getDataDir(), and ilUtil\makeDir().

Referenced by initConsumer().

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

◆ isAccountMigrationEnabled()

ilOpenIdSettings::isAccountMigrationEnabled ( )

Is account migration enabled.

Returns

Definition at line 111 of file class.ilOpenIdSettings.php.

112 {
113 return (bool) $this->account_migration;
114 }

References $account_migration.

Referenced by update().

+ Here is the caller graph for this function:

◆ isActive()

ilOpenIdSettings::isActive ( )

Is open id auth active.

Returns

Definition at line 54 of file class.ilOpenIdSettings.php.

55 {
56 return (bool) $this->active;
57 }

References $active.

Referenced by update().

+ Here is the caller graph for this function:

◆ isCreationEnabled()

ilOpenIdSettings::isCreationEnabled ( )

Is account creation enabled.

Returns

Definition at line 92 of file class.ilOpenIdSettings.php.

93 {
94 return (bool) $this->creation;
95 }

References $creation.

Referenced by update().

+ Here is the caller graph for this function:

◆ read()

ilOpenIdSettings::read ( )
protected

Read settings from db.

Returns

Definition at line 149 of file class.ilOpenIdSettings.php.

150 {
151 $this->setActive($this->storage->get('active',false));
152 $this->enableCreation($this->storage->get('creation',false));
153 $this->setDefaultRole($this->storage->get('default_role',0));
154 $this->enableAccountMigration($this->storage->get('account_migration',false));
155 $this->forceProviderSelection($this->storage->get('forced_selection',false));
156 }
setActive($a_status)
Set open id active.
enableCreation($a_status)
Enable account creation.
setDefaultRole($a_role)
Set default role.
enableAccountMigration($a_status)
Enable account migration.
forceProviderSelection($a_status)
Set force selection status.

References enableAccountMigration(), enableCreation(), forceProviderSelection(), setActive(), and setDefaultRole().

Referenced by __construct().

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

◆ setActive()

ilOpenIdSettings::setActive (   $a_status)

Set open id active.

Parameters
bool$a_status
Returns

Definition at line 64 of file class.ilOpenIdSettings.php.

65 {
66 $this->active = $a_status;
67 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setDefaultRole()

ilOpenIdSettings::setDefaultRole (   $a_role)

Set default role.

Parameters
int$a_role
Returns

Definition at line 140 of file class.ilOpenIdSettings.php.

141 {
142 $this->default_role = $a_role;
143 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilOpenIdSettings::update ( )

Update settings.

Returns

Definition at line 162 of file class.ilOpenIdSettings.php.

163 {
164 $this->storage->set('active', (int) $this->isActive());
165 $this->storage->set('creation',(int) $this->isCreationEnabled());
166 $this->storage->set('default_role',(int) $this->getDefaultRole());
167 $this->storage->set('account_migration',(int) $this->isAccountMigrationEnabled());
168 $this->storage->set('forced_selection',(int) $this->forcedProviderSelection());
169 }
isAccountMigrationEnabled()
Is account migration enabled.
getDefaultRole()
Get default role.
isCreationEnabled()
Is account creation enabled.
forcedProviderSelection()
is provider selection forced
isActive()
Is open id auth active.

References forcedProviderSelection(), getDefaultRole(), isAccountMigrationEnabled(), isActive(), and isCreationEnabled().

+ Here is the call graph for this function:

Field Documentation

◆ $account_migration

ilOpenIdSettings::$account_migration = false
private

Definition at line 20 of file class.ilOpenIdSettings.php.

Referenced by isAccountMigrationEnabled().

◆ $active

ilOpenIdSettings::$active = false
private

Definition at line 19 of file class.ilOpenIdSettings.php.

Referenced by isActive().

◆ $consumer

ilOpenIdSettings::$consumer = null
private

Definition at line 25 of file class.ilOpenIdSettings.php.

Referenced by getConsumer().

◆ $creation

ilOpenIdSettings::$creation = false
private

Definition at line 22 of file class.ilOpenIdSettings.php.

Referenced by isCreationEnabled().

◆ $default_role

ilOpenIdSettings::$default_role = 0
private

Definition at line 21 of file class.ilOpenIdSettings.php.

Referenced by getDefaultRole().

◆ $forced_selection

ilOpenIdSettings::$forced_selection = false
private

Definition at line 23 of file class.ilOpenIdSettings.php.

Referenced by forcedProviderSelection().

◆ $instance

ilOpenIdSettings::$instance = null
staticprivate

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

Referenced by getInstance().

◆ $storage

ilOpenIdSettings::$storage = null
private

Definition at line 17 of file class.ilOpenIdSettings.php.


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