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

Public Member Functions

 Auth_Container_SAP ($options)
 Class constructor.
 fetchData ($username, $password)
 Performs username and password check.
 getError ()
 Retrieves the last error from the SAP connection and returns it as an array.
- 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

 $options
- 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 54 of file SAP.php.

Member Function Documentation

Auth_Container_SAP::Auth_Container_SAP (   $options)

Class constructor.

Checks that required options are present and that the SAPRFC extension is loaded

Options that can be passed and their defaults:

array(
  'ASHOST' => "",
  'SYSNR'  => "",
  'CLIENT' => "000",
  'GWHOST' =>"",
  'GWSERV' =>"",
  'MSHOST' =>"",
  'R3NAME' =>"",
  'GROUP'  =>"",
  'LANG'   =>"EN",
  'TRACE'  =>"",
  'GETSSO2'=> true
)
Parameters
arrayarray of options.
Returns
void

Definition at line 94 of file SAP.php.

References $options, PEAR\loadExtension(), and PEAR\raiseError().

{
$saprfc_loaded = PEAR::loadExtension('saprfc');
if (!$saprfc_loaded) {
return PEAR::raiseError('Cannot use SAP authentication, '
.'SAPRFC extension not loaded!');
}
if (empty($options['R3NAME']) && empty($options['ASHOST'])) {
return PEAR::raiseError('R3NAME or ASHOST required for authentication');
}
$this->options = array_merge($this->options, $options);
}

+ Here is the call graph for this function:

Auth_Container_SAP::fetchData (   $username,
  $password 
)

Performs username and password check.

Parameters
stringUsername
stringPassword
Returns
boolean TRUE on success (valid user), FALSE otherwise

Definition at line 117 of file SAP.php.

References $error, $options, $password, AUTH_LOG_DEBUG, getError(), Auth_Container\log(), and PEAR\raiseError().

{
$this->log('Auth_Container_SAP::fetchData() called.', AUTH_LOG_DEBUG);
$connection_options = $this->options;
$connection_options['USER'] = $username;
$connection_options['PASSWD'] = $password;
$rfc = saprfc_open($connection_options);
if (!$rfc) {
$message = "Couldn't connect to the SAP system.";
$error = $this->getError();
if ($error['message']) {
$message .= ': ' . $error['message'];
}
PEAR::raiseError($message, null, null, null, @$erorr['all']);
return false;
} else {
if (!empty($this->options['GETSSO2'])) {
$this->log('Attempting to retrieve SSO2 ticket.', AUTH_LOG_DEBUG);
if ($ticket = @saprfc_get_ticket($rfc)) {
$this->options['MYSAPSSO2'] = $ticket;
unset($this->options['GETSSO2']);
$this->_auth_obj->setAuthData('sap', $this->options);
} else {
PEAR::raiseError("SSO ticket retrieval failed");
}
}
@saprfc_close($rfc);
return true;
}
}

+ Here is the call graph for this function:

Auth_Container_SAP::getError ( )

Retrieves the last error from the SAP connection and returns it as an array.

Returns
array Array of error information

Definition at line 158 of file SAP.php.

References $err, and $error.

Referenced by fetchData().

{
$error = array();
$sap_error = saprfc_error();
if (empty($err)) {
return $error;
}
$err = explode("n", $sap_error);
foreach ($err AS $line) {
$item = split(':', $line);
$error[strtolower(trim($item[0]))] = trim($item[1]);
}
$error['all'] = $sap_error;
return $error;
}

+ Here is the caller graph for this function:

Field Documentation

Auth_Container_SAP::$options
Initial value:
array(
'CLIENT' => '000',
'LANG' => 'EN',
'GETSSO2' => true,
)

Definition at line 61 of file SAP.php.

Referenced by Auth_Container_SAP(), and fetchData().


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