The Authentication and Preferences API

Last updated on
30 April 2025

The Authentication and Preferences API handles the user authentication and user preferences as stored on the OpenERP server.

OpenERPProxy::request

send non-privilege plain request to OpenERP Server

Parameters

string $module - OpenERP module name
string $action - action to perform
array $args - arguments for the action

Return

mixed - result returned from OpenERP, according to the request

Example

$proxy = OpenERPProxy::getProxy();
$uid = $proxy->request('common', 'login', array($db, $usr, $pwd));
...

OpenERPProxy::userRequest

send a privileges request to OpenERP server, automatically authenticate the user if required.

Parameters

string $module - OpenERP module name
string $action - action to perform
array $args - arguments for the action

Return

mixed - result returned from OpenERP, according to the request

$proxy = OpenERPProxy::getProxy();
$r = $proxy->userRequest('common', 'timezone_get'));
...

OpenERPProxy::login()

Login to OpenERP with the account information supplied by Drupal and get the operation context.

Parameters

- none -

Return

mixed - FALSE on error, or user id as an integer on success

$proxy = OpenERPProxy::getProxy();
$proxy->login();

OpenERPProxy::execute

Perform the OpenERP's 'execute' action on an OpenERP object.

Parameters

string $object - OpenERP object name
string $action - action to perform using the object
array $args - arguments
bool $context - also append the user's context to the end of argument list

Return

mixed - results as return by OpenERP.

Example

$proxy = OpenERPProxy::getProxy();
$r = $proxy->execute('res.users', 'context_get');
...
return $proxy->execute($model, 'create', array((object)$data));

-- this document is still under progress, details is being added. Sorry for any inconvenience you may have --

Help improve this page

Page status: Not set

You can: