This is the API description for dbConnection object (in db.py module): Main functions -------------- __init__ (server, port, socket, db_name, user, password). Init will not call connect (). connect () disconnect () has_errors () Should return 1 if there were database errors during queries. Flag should be cleared on disconnect () / connect (). User/roles ---------- list_rolenames (realm) list_usernames (realm) list_usernames_With_role (realm, role) get_user_data (user, by_id = 0) Parameter user should be a user object. If by_id is unspecified or false, user object must have valid realm and username. If by_id is true, user object must have valid realm and DB Id. This function will fill all other informations of the user object. count_users (realm) count_roles (realm) change_user_password (user, password, ptype) Parameter user must be a valid user object (with valid DB Id). Password is changed - parameter password must contain encoded password (if ptype != 0). change_user_roles (user, roles) change_user_domains (user, domains) change_user_other (user, realname, email) Parameter user must be a valid user object. create_user (username, realm, roles) New record in Users table is created. Password type will be set to VDB_INVALID_PASSWORD_TYPE, so authentication will fail until password is set. del_user (username, realm, mclass = None) Delete user. If mclass is set, specified misc data class is deleted for the user too. create_role (role, realm) delete_role (role, realm) Sessions -------- create_session (session) Creates a record in sessions table based on the session object. get_session (session) Fills the session object with the info from the database. Session object must have valid Id session_set_user_id (session, user_id) Assigns user_id to the session. Tokens ------ create_token (class_id, token_id, token_value, token_timeout, token_life, created_time, accessed_time, realm) Creates a new token. del_token (class_id, token_id, realm) get_token (class_id, token_id, realm) update_token_accessed (class_id, token_id, time, realm) MiscData -------- save_misc_data (obj_class, obj_id, misc_id, misc_tuple) get_misc_data (oclass, oid, mid, check = 0) If check is true, function will return true if specified data exist, otherwise false. del_misc_data (oclass, oid, mid) del_misc_data_class (oclass, oid) Logging ------- log_sql_simple (realm, sid, event) log_sql (realm, sid, event, e_value, e_value2, o_type, o_size, r_addr)