UserLogon

class q2_sdk.hq.db.user_logon.ZoneData(group_id=None, zone_id=None)[source]

Bases: object

ZoneData(group_id: int = None, zone_id: int = None)

group_id: int = None
zone_id: int = None
property context_id
property context_type
class q2_sdk.hq.db.user_logon.UserLogonRow(element, row_class=None, rename_fields=None)[source]

Bases: TableRow

UserLogonID: int
UserID: int
LoginName: str
UserPassword: str
UISourceID: int
LastChange: str
LastLogon: str
Status: str
StatusReason: str
LastFailed: str
CreateDate: str
NumInvalidAttempts: int
AutoGenerated: bool
PasswordChangeRequired: bool
PasswordHasNeverChanged: bool
NumInvalidOobAttempts: int
class q2_sdk.hq.db.user_logon.AdminLogonRow(element, row_class=None, rename_fields=None)[source]

Bases: TableRow

AdminUserLogonID: int
AdminUserID: int
LoginName: str
DeletedDate: str
UISourceID: int
LastChange: str
LastLogon: str
Status: str
StatusReason: str
LastFailed: str
CreateDate: str
NumInvalidAttempts: int
GroupID: int
AuthenticationTypeID: int
class q2_sdk.hq.db.user_logon.LogonStatus(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Normal = 'Normal'
New = 'New'
Locked = 'Locked'
Expired = 'Expired'
Disabled = 'Disabled'
InitialPwdExpired = 'InitialPwdExpired'
TacRequired = 'Tac'
ChallengeRequested = 'Cqr'
Token = 'Token'
NewTacNotRequired = 'NewTacNotRequired'
class q2_sdk.hq.db.user_logon.UserLogon(logger, hq_credentials=None, ret_table_obj=None)[source]

Bases: DbObject

Programmatic access to the Q2 database. Not as flexible as a true ORM, but takes the guesswork out of database schemas and ensures safety in the transactions.

Parameters:
  • logger – Reference to calling request’s logger (self.logger in your extension)

  • hq_credentials (Optional[HqCredentials]) – HQ Connectivity Information (Defaults to settings file)

  • ret_table_obj (Optional[bool]) – Flag to return list of LXML elements if False or TableRow objects from DB calls if True (Defaults to settings file)

GET_BY_NAME_KEY = 'LoginName'
NAME = 'UserLogon'
REPRESENTATION_ROW_CLASS

alias of UserLogonRow

add_arguments(parser)[source]

Hook for subclassed DbObjects to add custom arguments.

async get_login_by_name(logon_name, admin=False, include_deleted=False)[source]
Return type:

List[Union[UserLogonRow, AdminLogonRow]]

async get_login_by_id(user_id, admin=False, include_deleted=False, **kwargs)[source]
Return type:

List[Union[UserLogonRow, AdminLogonRow]]

async get_list_of_associated_logons(user_id)[source]
Return type:

list

async get(user_id=None, logon_name=None, serialize_for_cli=False, admin=False, include_deleted=False)[source]
Return type:

List[Union[UserLogonRow, AdminLogonRow]]

async unlock(logon_name)[source]
async reset_password(logon_name, new_password=None, force_change=True)[source]
async generate_password(group_id=None)[source]
async validate_password(new_password, zone_data=None)[source]
async change_endusers_password(logon_name, new_password)[source]
async delete(user_obj, session_obj, login_name=None, user_logonid=None)[source]
async get_login_by_logon_id(user_logonid, admin=False)[source]
Return type:

List[Union[UserLogonRow, AdminLogonRow]]

async get_logons_from_user_id_list(list_of_users, included_deleted=False)[source]
async set_password_status_as_accepted(login_name)[source]

Just making a change to the DB so the user can log in without changing their password.

async get_logons_without_login_since(last_logon_date, serialize_for_cli=False, status_filter=None)[source]
async change_user_logonname(old_logon_name, new_logon_name, serialize_for_cli=False)[source]
async get_active_users_since(active_since_in_days, return_count=100, page_number=1, serialize_for_cli=False)[source]