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[source]

Bases: RepresentationRowBase

UserLogonID: IntElement = 'UserLogonID'
UserID: IntElement = 'UserID'
LoginName: StringElement = 'LoginName'
UserPassword: StringElement = 'UserPassword'
UISourceID: IntElement = 'UISourceID'
LastChange: StringElement = 'LastChange'
LastLogon: StringElement = 'LastLogon'
Status: StringElement = 'Status'
StatusReason: StringElement = 'StatusReason'
LastFailed: StringElement = 'LastFailed'
CreateDate: StringElement = 'CreateDate'
NumInvalidAttempts: IntElement = 'NumInvalidAttempts'
AutoGenerated: BoolElement = 'AutoGenerated'
PasswordChangeRequired: BoolElement = 'PasswordChangeRequired'
PasswordHasNeverChanged: BoolElement = 'PasswordHasNeverChanged'
NumInvalidOobAttempts: IntElement = 'NumInvalidOobAttempts'
class q2_sdk.hq.db.user_logon.AdminLogonRow[source]

Bases: RepresentationRowBase

AdminUserLogonID: IntElement = 'AdminUserLogonID'
AdminUserID: IntElement = 'AdminUserID'
LoginName: StringElement = 'LoginName'
DeletedDate: StringElement = 'DeletedDate'
enum q2_sdk.hq.db.user_logon.LogonStatus(value)[source]

Bases: Enum

Valid values are as follows:

Normal = <LogonStatus.Normal: 'Normal'>
New = <LogonStatus.New: 'New'>
Locked = <LogonStatus.Locked: 'Locked'>
Expired = <LogonStatus.Expired: 'Expired'>
Disabled = <LogonStatus.Disabled: 'Disabled'>
InitialPwdExpired = <LogonStatus.InitialPwdExpired: 'InitialPwdExpired'>
TacRequired = <LogonStatus.TacRequired: 'Tac'>
ChallengeRequested = <LogonStatus.ChallengeRequested: 'Cqr'>
Token = <LogonStatus.Token: 'Token'>
NewTacNotRequired = <LogonStatus.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)[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]