Package bscw :: Package api :: Module ap_create_user
[hide private]

Module ap_create_user

Creates (given) username and allocates given address(es). See create_user() for a description.

API definition:

API = (('uname', 'ASCII string', 1),
       ('passwd', 'ASCII string', 1),
       ('aname_or_id_list', 'array', 1, [('aname_or_id', 'ASCII string', 1)]),
       ('options', 'struct', 0, [('o_attrs', 'array', 0, [('attr', 'ASCII string', 1)])]))

(c) OrbiTeam Software, 2007-2010, www.bscw.de/copyright.html


Version: $Rev: 20668 $

Functions [hide private]
 
param_def()
return the parameter definition
 
return_def()
return the result definition
 
do_it(request, uname, passwd, aname_or_id_list, options={})
see above
dict
create_user(request, uname, passwd, aname_or_id_list, options={})
Creates (given) username and allocates given address(es).
Variables [hide private]
  log_api = logging.getLogger('api')
  __package__ = 'bscw.api'
Function Details [hide private]

create_user(request, uname, passwd, aname_or_id_list, options={})

 

Creates (given) username and allocates given address(es).

Examples:

>>> u_attrs = s.create_user(uname='user1', passwd='secret',
                        aname_or_id_list=['user1@bscw.de', 'user1@web.de'])
>>> u_attrs = s.create_user(uname='user2', passwd='secret',
                        aname_or_id_list=['1234', 'user2@bscw.de'])
>>> u_attrs = s.create_user(uname='user3', passwd='secret',
                        aname_or_id_list=['user3@bscw.de'],
                        options={'o_attrs': ['name', '__id__']})
Parameters:
  • uname (str) - user name to be created
  • passwd (str) - password
  • aname_or_id_list (list) - list of address(es) or ID(s) of address objects to be allocated to the user (first address will become primary address)
  • options (dict) - dictionary with the following key/value parameter(s):
    • o_attrs (list) - list of user attributes to be returned, e.g. ['__id__', 'ctime', 'atime', 'addresses', ...] (see get_attributes() for details)
Returns: dict
  • dictionary of created user object attributes
  • raises fault (10104, 'Bad Parameter')