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 Windows2008LoginManager.Windows2008LoginManager(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.

passive_is_logged_in()

This method is very similar to isLoggedIn() but will not disturb the system (e.g., by moving the mouse) so can safely be called while another thread could be operating the system. This does, however, mean that there is a higher chance of false negative as we cannot be sure that the mouse is not obscuring part of the pattern we are looking for.

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 happen successfully