35 if (self::$instance ===
null) {
60 return $this->amcConfig->getString(
'authsource');
72 $cookieName = $this->amcConfig->getString(
'cookiename',
'AuthMemCookie');
75 "Configuration option 'cookiename' contains an invalid value. This option should be a string."
90 $usernameAttr = $this->amcConfig->getString(
'username',
null);
103 $groupsAttr = $this->amcConfig->getString(
'groups',
null);
117 $memcacheHost = $this->amcConfig->getString(
'memcache.host',
'127.0.0.1');
118 $memcachePort = $this->amcConfig->getInteger(
'memcache.port', 11211);
120 $class = class_exists(
'Memcache') ?
'Memcache' : (class_exists(
'Memcached') ?
'Memcached' : FALSE);
122 throw new Exception(
'Missing Memcached implementation. You must install either the Memcache or Memcached extension.');
128 foreach (explode(
',', $memcacheHost) as $memcacheHost) {
129 $memcache->addServer($memcacheHost, $memcachePort);
An exception for terminatinating execution or to throw for unit testing.
static setCookie($name, $value, $params=null, $throw=true)
Set a cookie.
static logoutHandler()
This function implements the logout handler.
doLogout()
This function logs the user out by deleting the session information from memcache.
static getInstance()
This function is used to retrieve the singleton instance of this class.
__construct()
This function implements the constructor for this class.
getUsernameAttr()
This function retrieves the name of the attribute which contains the username from the configuration.
getGroupsAttr()
This function retrieves the name of the attribute which contains the groups from the configuration.
getMemcache()
This function creates and initializes a Memcache object from our configuration.
getCookieName()
This function retrieves the name of the cookie from the configuration.
getAuthSource()
Retrieve the authentication source that should be used to authenticate the user.
static getConfig($filename='config.php', $configSet='simplesaml')
Load a configuration file from a configuration set.
foreach($authData as $name=> $values) $memcache