26 lines
831 B
PHP
26 lines
831 B
PHP
|
<?php
|
||
|
require_once('ripcord_client.php');
|
||
|
|
||
|
class ClassXMLRPC {
|
||
|
public function __construct($url, $database, $user, $password){
|
||
|
$this->_url = $url;
|
||
|
$this->_database = $database;
|
||
|
$this->_user = $user;
|
||
|
$this->_password = $password;
|
||
|
|
||
|
$this->_common = ripcord::client($this->_url."xmlrpc/2/common");
|
||
|
$this->_uid = $this->_common->authenticate($this->_database, $this->_user, $this->_password, array());
|
||
|
$this->_models = ripcord::client($this->_url."xmlrpc/2/object");
|
||
|
}
|
||
|
|
||
|
public function __destruct(){}
|
||
|
|
||
|
public function execute($model, $method, $args, $kwargs){
|
||
|
return $this->_models->execute_kw($this->_database, $this->_uid, $this->_password, $model, $method, $args, $kwargs);
|
||
|
}
|
||
|
|
||
|
public function get_user_id(){
|
||
|
return $this->_uid;
|
||
|
}
|
||
|
}
|