ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilOpenIdSettings Class Reference

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

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.

References read().

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

Referenced by read().

122  {
123  $this->account_migration = $a_status;
124  }
+ 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.

Referenced by read().

103  {
104  $this->creation = $a_status;
105  }
+ 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().

74  {
76  }
+ 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.

Referenced by read().

84  {
85  $this->forced_selection = $a_status;
86  }
+ 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.

References $consumer.

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

◆ getDefaultRole()

ilOpenIdSettings::getDefaultRole ( )

Get default role.

Returns

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

References $default_role.

Referenced by update().

131  {
132  return $this->default_role;
133  }
+ 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.

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

41  {
42  if(self::$instance != null)
43  {
44  return self::$instance;
45  }
46  return self::$instance = new ilOpenIdSettings();
47  }
Stores OpenId related settings
+ 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.

References $ilCtrl.

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

◆ initConsumer()

ilOpenIdSettings::initConsumer ( )

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

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

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

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

Referenced by initConsumer().

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 ...
static getDataDir()
get data directory (outside webspace)
+ 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.

References $account_migration.

Referenced by update().

112  {
113  return (bool) $this->account_migration;
114  }
+ 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.

References $active.

Referenced by update().

55  {
56  return (bool) $this->active;
57  }
+ 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.

References $creation.

Referenced by update().

93  {
94  return (bool) $this->creation;
95  }
+ 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.

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

Referenced by __construct().

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  }
setDefaultRole($a_role)
Set default role.
enableCreation($a_status)
Enable account creation.
setActive($a_status)
Set open id active.
enableAccountMigration($a_status)
Enable account migration.
forceProviderSelection($a_status)
Set force selection status.
+ 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.

Referenced by read().

65  {
66  $this->active = $a_status;
67  }
+ 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.

Referenced by read().

141  {
142  $this->default_role = $a_role;
143  }
+ Here is the caller graph for this function:

◆ update()

ilOpenIdSettings::update ( )

Update settings.

Returns

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

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

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.
forcedProviderSelection()
is provider selection forced
isCreationEnabled()
Is account creation enabled.
getDefaultRole()
Get default role.
isActive()
Is open id auth active.
+ 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.

◆ $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: