Advanced Strategic Command
Classes | Functions
pwd_dlg.cpp File Reference

Dialog for entering and asking for passwords. More...

#include <string>
#include "../paradialog.h"
#include "../gameoptions.h"
#include "../password.h"
Include dependency graph for pwd_dlg.cpp:

Go to the source code of this file.


class  PasswordDialog


bool enterpassword (Password &pwd, bool firstTime, bool cancelAllowed, bool defaultAllowed, const ASCString &username)

Detailed Description

Dialog for entering and asking for passwords.

Definition in file pwd_dlg.cpp.

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.

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