ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
Auth_Container_File Class Reference
+ Inheritance diagram for Auth_Container_File:
+ Collaboration diagram for Auth_Container_File:

Public Member Functions

 Auth_Container_File ($filename)
 Constructor of the container class.
 fetchData ($user, $pass)
 Authenticate an user.
 listUsers ()
 List all available users.
 addUser ($user, $pass, $additional='')
 Add a new user to the storage container.
 removeUser ($user)
 Remove user from the storage container.
 changePassword ($username, $password)
 Change password for user in the storage container.
_load ()
 Load and initialize the File_Passwd object.
 _setDefaults ()
 Set some default options.
 _parseOptions ($array)
 Parse options passed to the container class.
- 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.
 getUser ($username)
 Returns a user assoc array.
 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.
 supportsCaptchaVerification ()
 Returns whether or not the auth container supports the verification of captchas This should be true for those auth methods, which are available in the default login form.

Data Fields

 $pwfile = ''
 $options = 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 58 of file File.php.

Member Function Documentation

& Auth_Container_File::_load ( )

Load and initialize the File_Passwd object.

Returns
object File_Passwd_Cvs|PEAR_Error

Definition at line 257 of file File.php.

References $res, AUTH_LOG_DEBUG, PEAR\isError(), and Auth_Container\log().

Referenced by addUser(), changePassword(), listUsers(), and removeUser().

{
static $pw_obj;
if (!isset($pw_obj)) {
$this->log('Instanciating File_Password object of type '.$this->options['type'], AUTH_LOG_DEBUG);
$pw_obj = File_Passwd::factory($this->options['type']);
if (PEAR::isError($pw_obj)) {
return $pw_obj;
}
$pw_obj->setFile($this->pwfile);
$res = $pw_obj->load();
return $res;
}
}
return $pw_obj;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Auth_Container_File::_parseOptions (   $array)

Parse options passed to the container class.

private

Parameters
array

Definition at line 302 of file File.php.

Referenced by Auth_Container_File().

{
foreach ($array as $key => $value) {
if (isset($this->options[$key])) {
$this->options[$key] = $value;
}
}
}

+ Here is the caller graph for this function:

Auth_Container_File::_setDefaults ( )

Set some default options.

private

Returns
void

Definition at line 288 of file File.php.

Referenced by Auth_Container_File().

{
$this->options['type'] = 'Cvs';
}

+ Here is the caller graph for this function:

Auth_Container_File::addUser (   $user,
  $pass,
  $additional = '' 
)

Add a new user to the storage container.

Parameters
stringusername
stringpassword
mixedAdditional parameters to File_Password_*::addUser()
Returns
boolean

Reimplemented from Auth_Container.

Definition at line 159 of file File.php.

References $additional, $pass, $res, _load(), AUTH_LOG_DEBUG, PEAR\isError(), and Auth_Container\log().

{
$this->log('Auth_Container_File::addUser() called.', AUTH_LOG_DEBUG);
$params = array($user, $pass);
if (is_array($additional)) {
foreach ($additional as $item) {
$params[] = $item;
}
} else {
$params[] = $additional;
}
$pw_obj = &$this->_load();
if (PEAR::isError($pw_obj)) {
return false;
}
$res = call_user_func_array(array(&$pw_obj, 'addUser'), $params);
return false;
}
$res = $pw_obj->save();
return false;
}
return true;
}

+ Here is the call graph for this function:

Auth_Container_File::Auth_Container_File (   $filename)

Constructor of the container class.

Parameters
string$filenamepath to passwd file
Returns
object Auth_Container_File new Auth_Container_File object

Definition at line 86 of file File.php.

References $filename, _parseOptions(), and _setDefaults().

{
$this->_setDefaults();
// Only file is a valid option here
if(is_array($filename)) {
$this->pwfile = $filename['file'];
} else {
$this->pwfile = $filename;
}
}

+ Here is the call graph for this function:

Auth_Container_File::changePassword (   $username,
  $password 
)

Change password for user in the storage container.

Parameters
stringUsername
stringThe new password

Reimplemented from Auth_Container.

Definition at line 228 of file File.php.

References $res, _load(), AUTH_LOG_DEBUG, PEAR\isError(), and Auth_Container\log().

{
$this->log('Auth_Container_File::changePassword() called.', AUTH_LOG_DEBUG);
$pw_obj = &$this->_load();
if (PEAR::isError($pw_obj)) {
return false;
}
$res = $pw_obj->changePasswd($username, $password);
return false;
}
$res = $pw_obj->save();
return false;
}
return true;
}

+ Here is the call graph for this function:

Auth_Container_File::fetchData (   $user,
  $pass 
)

Authenticate an user.

Parameters
stringusername
stringpassword
Returns
mixed boolean|PEAR_Error

Definition at line 108 of file File.php.

References $pass, AUTH_LOG_DEBUG, and Auth_Container\log().

{
$this->log('Auth_Container_File::fetchData() called.', AUTH_LOG_DEBUG);
return File_Passwd::staticAuth($this->options['type'], $this->pwfile, $user, $pass);
}

+ Here is the call graph for this function:

Auth_Container_File::listUsers ( )

List all available users.

Returns
array

Reimplemented from Auth_Container.

Definition at line 122 of file File.php.

References _load(), AUTH_LOG_DEBUG, PEAR\isError(), and Auth_Container\log().

{
$this->log('Auth_Container_File::listUsers() called.', AUTH_LOG_DEBUG);
$pw_obj = &$this->_load();
if (PEAR::isError($pw_obj)) {
return array();
}
$users = $pw_obj->listUser();
if (!is_array($users)) {
return array();
}
foreach ($users as $key => $value) {
$retVal[] = array("username" => $key,
"password" => $value['passwd'],
"cvsuser" => $value['system']);
}
$this->log('Found '.count($retVal).' users.', AUTH_LOG_DEBUG);
return $retVal;
}

+ Here is the call graph for this function:

Auth_Container_File::removeUser (   $user)

Remove user from the storage container.

Parameters
stringUsername
Returns
boolean

Reimplemented from Auth_Container.

Definition at line 198 of file File.php.

References $res, _load(), AUTH_LOG_DEBUG, PEAR\isError(), and Auth_Container\log().

{
$this->log('Auth_Container_File::removeUser() called.', AUTH_LOG_DEBUG);
$pw_obj = &$this->_load();
if (PEAR::isError($pw_obj)) {
return false;
}
$res = $pw_obj->delUser($user);
return false;
}
$res = $pw_obj->save();
return false;
}
return true;
}

+ Here is the call graph for this function:

Field Documentation

Auth_Container_File::$options = array()

Definition at line 75 of file File.php.

Auth_Container_File::$pwfile = ''

Definition at line 68 of file File.php.


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