QGuiUserAdd Class Reference

List of all members.


Detailed Description

widget for adding new uses to db

Author:
Sergio Di Domizio

Public Member Functions

 QGuiUserAdd (const TGWindow *main, std::string &userName, std::string &password, std::string &realName, QApolloUserLevel &level)
 ctor
virtual ~QGuiUserAdd ()
 dtor
void HandleCancel ()
 slot function triggered when the cancel button is pressed
void HandleOk ()
 slot function triggered when the ok button is pressed
void CloseWindow ()

Private Member Functions

void CreateFrames ()
void MakeConnections ()
Bool_t Authenticate ()
 authenticate user that is going to add a new user
void ResetFields ()

Private Attributes

std::string & fUser
std::string & fPassword
std::string & fRealName
QApolloUserLevelfLevel
QApolloUserLevel fMinLevel
TGTextEntry * fUserEntry
TGTextEntry * fPasswordEntry
TGTextEntry * fPasswordConfirmEntry
TGTextEntry * fRealNameEntry
TGComboBox * fLevelEntry
TGTextButton * fCancelButton
TGTextButton * fOkButton
std::map< int, QApolloUserLevelfAuthIdToLevel

Constructor & Destructor Documentation

QGuiUserAdd::QGuiUserAdd ( const TGWindow *  main,
std::string &  userName,
std::string &  password,
std::string &  realName,
QApolloUserLevel level 
)

ctor

On success userName, password, realName and level are filled with the values provided by the user. On failure (cancel or some field missing) string values are left empty and level is set to InvalidLevel.

References AddUserLevel, Authenticate(), CreateFrames(), fLevel, fMinLevel, fPassword, fRealName, fUser, InvalidLevel, and MakeConnections().


Member Function Documentation

void QGuiUserAdd::CloseWindow (  ) 

close window and emit signal

Referenced by HandleCancel(), and HandleOk().

void QGuiUserAdd::CreateFrames (  )  [private]

create graphical frames

References AddUserLevel, fAuthIdToLevel, fMinLevel, StartStopLevel, and SuperUserLevel.

Referenced by QGuiUserAdd().

void QGuiUserAdd::MakeConnections (  )  [private]

perform signal/slot connections

Referenced by QGuiUserAdd().

Bool_t QGuiUserAdd::Authenticate (  )  [private]

authenticate user that is going to add a new user

Returns:
true unless user press cancel button in authentication window
sets fMinLevel to the level of the authenticated user or to InvalidLevel if authentication fails.

References QAuthManager::Authenticate(), fMinLevel, QAuthManager::GetInstance(), QApolloDb::GetListOfUsers(), ReadLevel, and SuperUserLevel.

Referenced by QGuiUserAdd().

void QGuiUserAdd::ResetFields (  )  [private]

reset all fields to their default values

References fLevel, fPassword, fRealName, fUser, and InvalidLevel.


Member Data Documentation

std::string& QGuiUserAdd::fUser [private]

filled with user name on success

Referenced by HandleOk(), QGuiUserAdd(), and ResetFields().

std::string& QGuiUserAdd::fPassword [private]

filled with password on success

Referenced by HandleOk(), QGuiUserAdd(), and ResetFields().

std::string& QGuiUserAdd::fRealName [private]

filled with real name on success

Referenced by HandleOk(), QGuiUserAdd(), and ResetFields().

filled with user level on success

Referenced by HandleOk(), QGuiUserAdd(), and ResetFields().

authentication level for the user that is going to add a new user

Referenced by Authenticate(), CreateFrames(), and QGuiUserAdd().

utility map to convert from TGComboBox id (key) to corresponding user authentication level

Referenced by CreateFrames(), and HandleOk().


The documentation for this class was generated from the following files:

Generated on Tue Nov 16 10:50:07 2010 for CUORE Software by  doxygen 1.5.6