ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilOpenIdProviders Class Reference

OpenId provider More...

+ Collaboration diagram for ilOpenIdProviders:

Public Member Functions

 getProvider ()
 Get enabled provider.
 getProviderById ($a_provider_id)
 Get provider by id.
 getProviderSelection ()
 get html select options
 getSelectedProvider ()
 Return the default provider, if there is only one.

Static Public Member Functions

static getInstance ()
 Get singleton instance.

Protected Member Functions

 __construct ()
 Singleton constructor.

Private Member Functions

 read ()
 Read providers.

Private Attributes

 $providers = array()

Static Private Attributes

static $instance = null

Detailed Description

OpenId provider

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

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

Constructor & Destructor Documentation

ilOpenIdProviders::__construct ( )
protected

Singleton constructor.

Returns

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

References read().

{
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilOpenIdProviders::getInstance ( )
static

Get singleton instance.

Returns
object ilOpenIdProviders

Definition at line 32 of file class.ilOpenIdProviders.php.

References $instance.

Referenced by ilOpenIdProviderTableGUI\parse(), ilAuthOpenId\parseUsername(), and ilStartUpGUI\showOpenIdLoginForm().

{
if(self::$instance)
{
}
return self::$instance = new ilOpenIdProviders();
}

+ Here is the caller graph for this function:

ilOpenIdProviders::getProvider ( )

Get enabled provider.

Returns

Definition at line 45 of file class.ilOpenIdProviders.php.

References $providers.

Referenced by getProviderById(), getProviderSelection(), and getSelectedProvider().

{
return (array) $this->providers;
}

+ Here is the caller graph for this function:

ilOpenIdProviders::getProviderById (   $a_provider_id)

Get provider by id.

Parameters
object$a_provider_id
Returns
object ilOpenIdProvider
Exceptions
UnexpectedValueException

Definition at line 56 of file class.ilOpenIdProviders.php.

References getProvider().

{
foreach($this->getProvider() as $provider)
{
if($provider->getId() == $a_provider_id)
{
return $provider;
}
}
throw new UnexpectedValueException();
}

+ Here is the call graph for this function:

ilOpenIdProviders::getProviderSelection ( )

get html select options

Returns
array $options

Definition at line 72 of file class.ilOpenIdProviders.php.

References $lng, and getProvider().

{
global $lng;
$options[0] = $lng->txt('select_one');
foreach($this->getProvider() as $provider)
{
$options[$provider->getId()] = $provider->getName();
}
return $options;
}

+ Here is the call graph for this function:

ilOpenIdProviders::getSelectedProvider ( )

Return the default provider, if there is only one.

Otherwise return "0" for –select one –

Returns
int

Definition at line 90 of file class.ilOpenIdProviders.php.

References ilOpenIdSettings\getInstance(), and getProvider().

{
include_once './Services/OpenId/classes/class.ilOpenIdSettings.php';
if(count($this->getProvider()) != 1 or !ilOpenIdSettings::getInstance()->forcedProviderSelection())
{
return 0;
}
foreach($this->getProvider() as $pro)
{
return $pro->getId();
}
return 0;
}

+ Here is the call graph for this function:

ilOpenIdProviders::read ( )
private

Read providers.

Returns

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

References $query, $res, $row, and DB_FETCHMODE_ASSOC.

Referenced by __construct().

{
global $ilDB;
$query = "SELECT provider_id FROM openid_provider ORDER BY name ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_ASSOC))
{
$this->providers[] = new ilOpenIdProvider($row['provider_id']);
}
return true;
}

+ Here is the caller graph for this function:

Field Documentation

ilOpenIdProviders::$instance = null
staticprivate

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

Referenced by getInstance().

ilOpenIdProviders::$providers = array()
private

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

Referenced by getProvider().


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