31 require_once
'Auth/Container.php';
35 require_once
'PEAR.php';
97 if (!$saprfc_loaded) {
99 .
'SAPRFC extension not loaded!');
101 if (empty($options[
'R3NAME']) && empty($options[
'ASHOST'])) {
104 $this->options = array_merge($this->options, $options);
121 $connection_options[
'USER'] = $username;
122 $connection_options[
'PASSWD'] = $password;
123 $rfc = saprfc_open($connection_options);
125 $message =
"Couldn't connect to the SAP system.";
127 if ($error[
'message']) {
128 $message .=
': ' . $error[
'message'];
133 if (!empty($this->options[
'GETSSO2'])) {
135 if ($ticket = @saprfc_get_ticket($rfc)) {
136 $this->options[
'MYSAPSSO2'] = $ticket;
137 unset($this->options[
'GETSSO2']);
138 $this->_auth_obj->setAuthData(
'sap', $this->options);
162 $sap_error = saprfc_error();
166 $err = explode(
"n", $sap_error);
167 foreach ($err AS $line) {
168 $item = split(
':', $line);
169 $error[strtolower(trim($item[0]))] = trim($item[1]);
171 $error[
'all'] = $sap_error;
getError()
Retrieves the last error from the SAP connection and returns it as an array.
loadExtension($ext)
OS independant PHP extension load.
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
fetchData($username, $password)
Performs username and password check.
Auth_Container_SAP($options)
Class constructor.
& 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...
log($message, $level=AUTH_LOG_DEBUG)
Log a message to the Auth log.