ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
Auth_Container_Pear Class Reference
+ Inheritance diagram for Auth_Container_Pear:
+ Collaboration diagram for Auth_Container_Pear:

Public Member Functions

 Auth_Container_Pear ($data=null)
 Constructor.
 fetchData ($username, $password)
 Get user information from pear.php.net.
- Public Member Functions inherited from Auth_Container
 Auth_Container ()
 Constructor.
 fetchData ($username, $password, $isChallengeResponse=false)
 Fetch data from storage container.
 verifyPassword ($password1, $password2, $cryptType="md5")
 Crypt and verfiy the entered password.
 supportsChallengeResponse ()
 Returns true if the container supports Challenge Response password authentication.
 getCryptType ()
 Returns the crypt current crypt type of the container.
 listUsers ()
 List all users that are available from the storage container.
 getUser ($username)
 Returns a user assoc array.
 addUser ($username, $password, $additional=null)
 Add a new user to the storage container.
 removeUser ($username)
 Remove user from the storage container.
 changePassword ($username, $password)
 Change password for user in the storage container.
 log ($message, $level=AUTH_LOG_DEBUG)
 Log a message to the Auth log.
- Public Member Functions inherited from ilAuthContainerBase
 loginObserver ($a_username, $a_auth)
 Called after successful login.
 failedLoginObserver ($a_username, $a_auth)
 Called after failed login.
 checkAuthObserver ($a_username, $a_auth)
 Called after check auth requests.
 logoutObserver ($a_username, $a_auth)
 Called after logout.

Data Fields

 $url = 'https://pear.php.net/rest-login.php/'
 $karma = array()
- Data Fields inherited from Auth_Container
 $activeUser = ""
 User that is currently selected from the storage container.
 $_auth_obj = null
 The Auth object this container is attached to.

Detailed Description

Definition at line 57 of file PEAR.php.

Member Function Documentation

Auth_Container_Pear::Auth_Container_Pear (   $data = null)

Constructor.

Accepts options "url" and "karma", see class docs.

Parameters
array$dataArray of options
Returns
void

Definition at line 89 of file PEAR.php.

References $data, and PEAR\raiseError().

{
if (!is_array($data)) {
PEAR::raiseError('The options for Auth_Container_Pear must be an array');
}
if (isset($data['karma'])) {
if (is_array($data['karma'])) {
$this->karma = $data['karma'];
} else {
$this->karma = array($data['karma']);
}
}
if (isset($data['url'])) {
$this->url = $data['url'];
}
}

+ Here is the call graph for this function:

Auth_Container_Pear::fetchData (   $username,
  $password 
)

Get user information from pear.php.net.

This function uses the given username and password to authenticate against the pear.php.net website

Parameters
stringUsername
stringPassword
Returns
mixed Error object or boolean

Definition at line 120 of file PEAR.php.

References $client, AUTH_LOG_DEBUG, Auth_Container\log(), and PEAR\raiseError().

{
$this->log('Auth_Container_PEAR::fetchData() called.', AUTH_LOG_DEBUG);
$client = new HTTP_Client;
$this->log('Auth_Container_PEAR::fetchData() getting salt.', AUTH_LOG_DEBUG);
$code = $client->get($this->url . '/getsalt');
if ($code != 200) {
return PEAR::raiseError('Bad response to salt request.', $code);
}
$resp = $client->currentResponse();
$salt = $resp['body'];
$this->log('Auth_Container_PEAR::fetchData() calling validate.', AUTH_LOG_DEBUG);
$postOptions = array(
'username' => $username,
'password' => md5($salt . md5($password))
);
if (is_array($this->karma) && count($this->karma) > 0) {
$postOptions['karma'] = implode(',', $this->karma);
}
$code = $client->post($this->url . '/validate', $postOptions);
if ($code != 200) {
return PEAR::raiseError('Bad response to validate request.', $code);
}
$resp = $client->currentResponse();
list($code, $message) = explode(' ', $resp['body'], 1);
if ($code != 8) {
return PEAR::raiseError($message, $code);
}
return true;
}

+ Here is the call graph for this function:

Field Documentation

Auth_Container_Pear::$karma = array()

Definition at line 75 of file PEAR.php.

Auth_Container_Pear::$url = 'https://pear.php.net/rest-login.php/'

Definition at line 66 of file PEAR.php.


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