ConsoleUser

Copyright (c) 2010-2023 Skaion Corporarion, www.skaion.com

This project was developed in part by numerous sponsorships from the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints of Governmental purposes notwithstanding any copyright notation thereon.

All content reflects those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of the U.S. Government or Skaion Corporation.

class LoginManager.LoginManager(system, config)

This is the abstract public face of the `Bridge Pattern`_ to provide information about the current login state and to alter that state.

Parameters:

  • system: a <no title> object which connects us to the remote system

  • config: a <no title> object containing all the configuration for this user

can_login()

Try to determine whether or not a user could login if told to do so right now. This is different from isLoggedIn because it will also check for the screen being locked or similar other situations.

It is possible that this method will “disturb” the remote system by moving the mouse or other actions which could interfere with a running ConsoleUser or human at the console.

Return: a value < 0 on error, 0 if a user could login, 1 if there is already a user logged in, 2 if the screen is locked, or 3 if the state cannot be determined (e.g., the Please Wait dialog is showing)

is_logged_in()

Return: True if there is a user currently logged in (though it may not be the same user this <no title> would have logged in

login()

Return: True if the login seems to happen successfully.

logout()

Return: True if the logout seems to happen successfully.

needs_config()

Return: True if it seems like this system needs to be configured

passive_is_logged_in()

Return: True if there is a user currently logged in (though it may not be the same user this <no title> would have logged in

restart()

Return: True if the restart seems to start (get to a shutting down page) successfully

try_config()

Attempt to configure this systems as the ConsoleUser expects it.