Advanced Strategic Command
Functions
pwd_dlg.h File Reference
#include "../password.h"
Include dependency graph for pwd_dlg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool enterpassword (Password &pwd, bool firstTime=false, bool cancelAllowed=false, bool defaultAllowed=true, const ASCString &username="")
 

Function Documentation

bool enterpassword ( Password pwd,
bool  firstTime = false,
bool  cancelAllowed = false,
bool  defaultAllowed = true,
const ASCString username = "" 
)

opens a dialog box for entering a password.

Parameters
pwdReference to a password class which may either contain a password or may be empty.
firstTimeIf true, the dialog will ask for a new password. If false and pwd is empty, the function returns immediately true. If pwd contains a password, a dialog pops up that will ask for the password
cancelAllowedIs there a cancel button (which will return false). If there is no cancel button and firsttime is false, there will be a exit button which will throw a NoMapLoaded exception when pressed.
defaultAllowedIf firstTime is also true, there will be default button which copies the CGameoptions::defaultPassword to pwd
Returns
true if password successfully entered. false if the cancel button has been pressed (if available). the current map will be deleted and a NoMapLoaded exception thrown if the exit button has been pressed (if available)

Definition at line 158 of file pwd_dlg.cpp.

References Password::empty(), CGameOptions::getDefaultPassword(), PasswordDialog::getSuccess(), CGameOptions::Instance(), and PasswordDialog::RunModal().

Referenced by authenticateUser(), changePassword(), k_loadmap(), and networksupervisor().