← Back to team overview

openerp-expert-framework team mailing list archive

Re: Add user from URL link

 

Am 09.04.2012 07:05, schrieb zaki1029:
Hi Team,

Recently I'm doing some investigation against the process regarding
how to add an user account from outside. It is some kind like SSO
concept but it cannot be impletmented by openid for the sake of some
customization requirement.
Here is my process:
1. System get some parameters regarding user's info like user name and
session from GET (from url) or POST method
2. System will add the user account into the res.users table.

Upon my investigation, we could add a method with type of httprequest
in class web.webclient and use a grammar like
req.session.model('res.users').write(cr, uid, uid, res) to insert the
data.
But since the user has not logged into the system at this stage, we
might not be able to get cr or uid info and carry out this method, how
could we add the user programmatically?

Is there any practice before that could make the scenario work?
Any feedback will be greatly appreciated.

From external, you can use XMLRPC calls, with the user data of a user having the rights to add other users, e.g. admin.

http://doc.openerp.com/v6.0/developer/6_22_XML-RPC_web_services/index.html

Please be aware of security issues here, and use secure XMLRPC or at least local communication only for example.

You may find examples (Create a partner and his address) on the webpage above.
There are also examples on different languages than Python.

Please note: OpenERP is kind of stateless. The login(dbname, username, password) only "converts" the username into a system uid.

Regards,
Marco

begin:vcard
fn:Marco Dieckhoff
n:Dieckhoff;Marco
org:Bremskerl Reibbelagwerke Emmerling GmbH & Co. KG;O IT/Organisation
adr:;;Brakenhof 7;Leeseringen;Niedersachsen;31629;Deutschland
email;internet:marco.dieckhoff@xxxxxxxxxxxx
tel;work:+49 5025 978 120
url:http://www.bremskerl.de
version:2.1
end:vcard


References