ILIAS  release_4-4 Revision
Auth_Container_KADM5 Class Reference
+ Inheritance diagram for Auth_Container_KADM5:
+ Collaboration diagram for Auth_Container_KADM5:

Public Member Functions

 Auth_Container_KADM5 ($options)
 Constructor of the container class. More...
 
 fetchData ($username, $password)
 Try to login to the KADM5 server. More...
 
 _setDefaults ()
 Set some default options. More...
 
 _checkServer ()
 Check if the given server and port are reachable. More...
 
- Public Member Functions inherited from Auth_Container
 Auth_Container ()
 Constructor. More...
 
 fetchData ($username, $password, $isChallengeResponse=false)
 Fetch data from storage container. More...
 
 verifyPassword ($password1, $password2, $cryptType="md5")
 Crypt and verfiy the entered password. More...
 
 supportsChallengeResponse ()
 Returns true if the container supports Challenge Response password authentication. More...
 
 getCryptType ()
 Returns the crypt current crypt type of the container. More...
 
 listUsers ()
 List all users that are available from the storage container. More...
 
 getUser ($username)
 Returns a user assoc array. More...
 
 addUser ($username, $password, $additional=null)
 Add a new user to the storage container. More...
 
 removeUser ($username)
 Remove user from the storage container. More...
 
 changePassword ($username, $password)
 Change password for user in the storage container. More...
 
 log ($message, $level=AUTH_LOG_DEBUG)
 Log a message to the Auth log. More...
 
- Public Member Functions inherited from ilAuthContainerBase
 loginObserver ($a_username, $a_auth)
 Called after successful login. More...
 
 failedLoginObserver ($a_username, $a_auth)
 Called after failed login. More...
 
 checkAuthObserver ($a_username, $a_auth)
 Called after check auth requests. More...
 
 logoutObserver ($a_username, $a_auth)
 Called after logout. More...
 
 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. More...
 

Data Fields

 $options = array()
 
- Data Fields inherited from Auth_Container
 $activeUser = ""
 User that is currently selected from the storage container. More...
 
 $_auth_obj = null
 The Auth object this container is attached to. More...
 

Detailed Description

Definition at line 55 of file KADM5.php.

Member Function Documentation

◆ _checkServer()

Auth_Container_KADM5::_checkServer ( )

Check if the given server and port are reachable.

private

Definition at line 156 of file KADM5.php.

References PEAR_ERROR_DIE, and PEAR\raiseError().

Referenced by Auth_Container_KADM5().

156  {
157  $fp = @fsockopen ($this->options['hostname'], 88, $errno, $errstr, $this->options['timeout']);
158  if (is_resource($fp)) {
159  @fclose($fp);
160  } else {
161  $message = "Error connecting to Kerberos V server "
162  .$this->options['hostname'].":".$this->options['port'];
163  return PEAR::raiseError($message, 41, PEAR_ERROR_DIE);
164  }
165  }
const PEAR_ERROR_DIE
Definition: PEAR.php:34
& raiseError($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
This method is a wrapper that returns an instance of the configured error class with this object's de...
Definition: PEAR.php:524
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _setDefaults()

Auth_Container_KADM5::_setDefaults ( )

Set some default options.

private

Definition at line 141 of file KADM5.php.

Referenced by Auth_Container_KADM5().

141  {
142  $this->options['hostname'] = 'localhost';
143  $this->options['realm'] = NULL;
144  $this->options['timeout'] = 10;
145  $this->options['checkServer'] = false;
146  }
+ Here is the caller graph for this function:

◆ Auth_Container_KADM5()

Auth_Container_KADM5::Auth_Container_KADM5 (   $options)

Constructor of the container class.

$options can have these keys: 'hostname' The hostname of the kerberos server 'realm' The Kerberos V realm 'timeout' The timeout for checking the server 'checkServer' Set to true to check if the server is running when constructing the object

Parameters
$optionsassociative array
Returns
object Returns an error object if something went wrong

Definition at line 81 of file KADM5.php.

References _checkServer(), _setDefaults(), PEAR_ERROR_DIE, and PEAR\raiseError().

81  {
82  if (!extension_loaded('kadm5')) {
83  return PEAR::raiseError("Cannot use Kerberos V authentication, KADM5 extension not loaded!", 41, PEAR_ERROR_DIE);
84  }
85 
86  $this->_setDefaults();
87 
88  if (isset($options['hostname'])) {
89  $this->options['hostname'] = $options['hostname'];
90  }
91  if (isset($options['realm'])) {
92  $this->options['realm'] = $options['realm'];
93  }
94  if (isset($options['timeout'])) {
95  $this->options['timeout'] = $options['timeout'];
96  }
97  if (isset($options['checkServer'])) {
98  $this->options['checkServer'] = $options['checkServer'];
99  }
100 
101  if ($this->options['checkServer']) {
102  $this->_checkServer();
103  }
104  }
_setDefaults()
Set some default options.
Definition: KADM5.php:141
const PEAR_ERROR_DIE
Definition: PEAR.php:34
& raiseError($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
This method is a wrapper that returns an instance of the configured error class with this object's de...
Definition: PEAR.php:524
_checkServer()
Check if the given server and port are reachable.
Definition: KADM5.php:156
+ Here is the call graph for this function:

◆ fetchData()

Auth_Container_KADM5::fetchData (   $username,
  $password 
)

Try to login to the KADM5 server.

Parameters
stringUsername
stringPassword
Returns
boolean

Definition at line 116 of file KADM5.php.

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

116  {
117  $this->log('Auth_Container_KADM5::fetchData() called.', AUTH_LOG_DEBUG);
118  if ( ($username == NULL) || ($password == NULL) ) {
119  return false;
120  }
121 
122  $server = $this->options['hostname'];
123  $realm = $this->options['realm'];
124  $check = @kadm5_init_with_password($server, $realm, $username, $password);
125 
126  if ($check == false) {
127  return false;
128  } else {
129  return true;
130  }
131  }
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
Definition: Auth.php:59
$server
log($message, $level=AUTH_LOG_DEBUG)
Log a message to the Auth log.
Definition: Container.php:246
+ Here is the call graph for this function:

Field Documentation

◆ $options

Auth_Container_KADM5::$options = array()

Definition at line 63 of file KADM5.php.


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