ultimix

- Main Page
- Data Structures
- Files
- Examples

- Data Structures
- Data Structure Index
- Data Fields

Public Member Functions | Data Fields
sape_common_api_1_0_0 Class Reference

## Public Member Functions
| __construct ()
| connect ()
| login ($Login, $PasswordHash)

## Data Fields
| $Client = false
| $SapeUtilities = false
| $Security = false

## Detailed Description

Class provides integration with the Sape system.

Author
  Dodonov A.A.

Definition at line 26 of file sape_common_api.php.

## Constructor & Destructor Documentation

__construct | ( |  | ) |

Constructor.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 56 of file sape_common_api.php.

{
try
{
$this->SapeUtilities = get_package( 'sape::sape_utilities' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

## Member Function Documentation

connect | ( |  | ) |

Connection to the server.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 83 of file sape_common_api.php.

{
try
{
$this->Client = get_package_object( 'xml::xml_rpc' , 'last' , __FILE__ );
$this->Client = $this->Client->get_xml_rpc_client( 'api.sape.ru' , '/xmlrpc/' );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

login | ( |  | $Login,
|  |  | $PasswordHash
| ) |  |

Authentication.

Parameters

  $Login | - Sape login.
  $PasswordHash | - md5 hash of the password.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 119 of file sape_common_api.php.

{
try
{
$Login = $this->Security->get( $Login , 'string' );
$PasswordHash = $this->Security->get( $PasswordHash , 'string' );
$Parameters = array(
new xmlrpcval( $Login , 'string' ) , new xmlrpcval( $PasswordHash , 'string' ) ,
new xmlrpcval( true , 'boolean' )
);
$Response = $this->SapeUtilities->call_method(
$this->Client , 'sape.login' , $Parameters , 'Can\'t login to Sape'
);
$Cookies = $Response->cookies();
$this->Client->setcookie( 'SAPE' , $Cookies[ 'SAPE' ][ 'value' ] , $Cookies[ 'SAPE' ][ 'path' ] );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

## Field Documentation

$Client = false

Cached packages.

Author
  Dodonov A.A.

Definition at line 38 of file sape_common_api.php.

$SapeUtilities = false

Definition at line 39 of file sape_common_api.php.

$Security = false

Definition at line 40 of file sape_common_api.php.

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

- packages/sape/packages/sape_common_api/sape_common_api.php