Public Types
Tonido::Data::ProfileManager Class Reference

Manages Tonido User Profiles. More...

List of all members.

Public Types

typedef boost::shared_ptr
< ProfileManager
SharedPtr

Public Member Functions

Ctors & Dtors
 ProfileManager (void)
 Ctor.
 ~ProfileManager (void)
 Dtor.
Profile Management
PeerID getPeerID ()
 Gets the currently active PeerID.
std::string getDisplayName ()
 Gets the currently active Profile's Display Name.
std::string getDomain ()
 Gets the default domain used for profile creation.
bool isProfileLoggedIn ()
 Gets whether the profile is logged in.
std::string getProfile ()
 Returns the currently logged in profile.
std::string getProfileRootDir ()
 Returns the currently logged in profile's root dir.
std::string getProfileUserDataDir ()
 Returns the currently logged in profile's user data dir.
void setProfileUserDataDir (const std::string &a_userDataDir)
 Sets the currently logged in profile's user data dir.
bool isDefaultProfileUserDataDir ()
 Is Default UserData Directory.
std::string getLogDir ()
 Returns the log data dir.
bool getSecurityToken (const std::string &a_seed, std::string &a_token)
 Creates a security key that is based on the user's password.
std::string getDateTimeFormat ()
 Returns the date time format for the logged in profile.
std::string getProfileEmail ()
 Returns the Email for the logged in profile.
int getNumProfiles ()
 Get the number of profiles.
std::string getDateFormat ()
 Gets the Profile Date Format.
bool isHTTPS ()
 Returns whether HTTPS is enabled.
int getHTTPPort ()
 Returns the HTTP Port.
int getUDPPort ()
 Returns the UDP Port.
bool getHTTPProxyEnabled ()
 Returns whether HTTP Proxy is enabled.
std::string getHTTPProxyHost ()
 Returns the HTTP Proxy Host.
int getHTTPProxyPort ()
 Returns the HTTP Proxy Port.
std::string getAppRoot ()
 Gets the application's APPROOT directory.
std::string getErrorLogRoot ()
 Gets the application's ErrorLog ROOT directory.
bool allowRemoteAdmin ()
 Gets whether Remote Administration is allowed.
std::string allowedWebServerAccess ()
 Gets the level of Web Server access.
bool allowNetwork ()
 Gets whether the Tonido Network communication is enabled or not.
bool allowConnectionsFromAllIPs ()
 Gets whether Tonido access is allowed from all IP networks.
void showUIOnLaunch (bool a_show)
 Sets whether to show the UI on launch.
void showNotifications (bool a_show)
 Sets whether to show notifications.
bool needsUserAttention ()
 Whether user needs to do some action or not.
bool showUIOnLaunch ()
 Whether to show the UI on launch.
bool showNotifications ()
 Whether to show notifications.
std::string generateURLAuth (const std::string &a_user)
 of using cookies or HTTP BASIC AUTH. Note only some calls support this
bool isURLAuthOK (const std::string &a_user, const std::string &a_seed, const std::string &a_hash)
 Checks if the URL Auth supplied is OK.
void setTonidoSyncDir (const std::string &a_dir)
 Sets the Tonido Sync Directory.
std::string getTonidoSyncDir ()
 Gets the Tonido Sync Directory.
Internal Use Only
Misc::ConfigDbgetConfigDB ()
 Gets the configuration DB associated with this profile.
std::string getProfileList (const std::string &a_appRoot, bool a_isRemote)
 Gets the list of actual profiles in the machine as XML.
bool createProfile (Profile &a_profile, const std::string &a_appRoot, std::string &a_reason, bool a_recover=false)
 Creates a new profile.
bool updateProfile (Profile &a_profile, std::string &a_reason)
 Updates information for a profile.
bool getProfileData (Profile &a_profile)
 Gets the currently logged in profile information.
bool authenticateProfile (const std::string &a_profileName, std::string &a_password, const std::string &a_appRoot)
 authenticateProfile
bool deleteProfile (const std::string &a_profileName, std::string &a_password, const std::string &a_appRoot)
 deleteProfile
bool authenticateCurrentProfile (const std::string &a_profileName, const std::string &a_password)
 Verifies if the password associated with the current profile is valid.
bool verifySecretQnAns (const std::string &a_qn, const std::string &a_ans, const std::string &a_password)
 Verifies if the secret ans associated with the current profile is valid.
bool loginProfile (const std::string &a_appRoot)
 Logs in last logged in profile into system.
bool loginProfile (const std::string &a_profileName, std::string &a_password, const std::string &a_appRoot, bool a_autoLogin, std::string &a_reason)
 Logs in a specific profile, given the password.
bool logoutProfile ()
 Logs out the currently logged in user.
void saveProfile (bool a_doSave)
 Saves the profile information used for relogin.
bool updatePassword (const std::string &a_oldpassword, const std::string &a_newpassword)
 Updates the password.
std::string getProfileImagePath (const std::string &a_appRoot)
 Returns the path to the profile image.
std::string checkID (const std::string &a_profileName)
 Checks if a given profile name is available for profile creation.
void checkURL (const std::string &a_syncToken)
 Checks if the URL is accessible.
void processPeerConnect (const PeerID &a_peer)
 Handles Peer Connection Event.
void setDomain (const std::string &a_domain)
 Sets the default domain used for profile creation.
bool secretQnAnsSet ()
 Verifies if the secret qn ans associated with the current profile is valid.
bool resetPassword (std::string &a_resetpassword)
 Resets the password.
int resetProfile (const std::string &a_profileName, const std::string &a_emailAddress, std::string &a_reason)
 Reset Profile.
void sendProfileInfo ()

Detailed Description

Manages Tonido User Profiles.


Constructor & Destructor Documentation

Tonido::Data::ProfileManager::ProfileManager ( void  )

Ctor.

details if needed ...

Tonido::Data::ProfileManager::~ProfileManager ( void  )

Dtor.

details if needed ...


Member Function Documentation

bool Tonido::Data::ProfileManager::allowConnectionsFromAllIPs ( )

Gets whether Tonido access is allowed from all IP networks.

Returns:
true if Tonido access is allowed, false otherwise
std::string Tonido::Data::ProfileManager::allowedWebServerAccess ( )

Gets the level of Web Server access.

Returns:
the level of Web Server access. "none" means it is not enabled
bool Tonido::Data::ProfileManager::allowNetwork ( )

Gets whether the Tonido Network communication is enabled or not.

Returns:
true if the Tonido Network communication is enabled, false otherwise
bool Tonido::Data::ProfileManager::allowRemoteAdmin ( )

Gets whether Remote Administration is allowed.

Returns:
true if Remote Administration is allowed, false otherwise
bool Tonido::Data::ProfileManager::authenticateCurrentProfile ( const std::string &  a_profileName,
const std::string &  a_password 
)

Verifies if the password associated with the current profile is valid.

Parameters:
[in]a_profileNamename of the profile
[in]a_passwordpassword to check with this profile
Returns:
true if profile was authenticated successfully, false otherwise
bool Tonido::Data::ProfileManager::authenticateProfile ( const std::string &  a_profileName,
std::string &  a_password,
const std::string &  a_appRoot 
)

authenticateProfile

Verifies if the password associated with the profile is valid

Parameters:
[in]a_profileNamename of the profile
[in]a_passwordpassword to check with this profile
[in]a_appRootapplication's APPROOT directory
Returns:
true if profile was authenticated successfully, false otherwise
std::string Tonido::Data::ProfileManager::checkID ( const std::string &  a_profileName)

Checks if a given profile name is available for profile creation.

Parameters:
[in]a_profileNameprofile name
Returns:
status in XML
void Tonido::Data::ProfileManager::checkURL ( const std::string &  a_syncToken)

Checks if the URL is accessible.

Parameters:
[in]a_syncTokenrequest token
Returns:
status in XML
bool Tonido::Data::ProfileManager::createProfile ( Profile a_profile,
const std::string &  a_appRoot,
std::string &  a_reason,
bool  a_recover = false 
)

Creates a new profile.

Parameters:
[out]a_profileprofile to create
[in]a_appRootapplication's APPROOT directory
[out]a_reasonoutput optional error string
Returns:
true if profile was created successfully, false otherwise
bool Tonido::Data::ProfileManager::deleteProfile ( const std::string &  a_profileName,
std::string &  a_password,
const std::string &  a_appRoot 
)

deleteProfile

Verifies if the password associated with the profile is valid

Parameters:
[in]a_profileNamename of the profile
[in]a_passwordpassword to check with this profile
Returns:
true if profile was authenticated successfully, false otherwise
std::string Tonido::Data::ProfileManager::generateURLAuth ( const std::string &  a_user)

of using cookies or HTTP BASIC AUTH. Note only some calls support this

Generates a Token that can be used to authenticate call via GET instead

Returns:
the string to use in the GET URL
std::string Tonido::Data::ProfileManager::getAppRoot ( )

Gets the application's APPROOT directory.

Returns:
the application's APPROOT directory
Misc::ConfigDb* Tonido::Data::ProfileManager::getConfigDB ( )

Gets the configuration DB associated with this profile.

Returns:
configuration DB of the profile
std::string Tonido::Data::ProfileManager::getDateFormat ( )

Gets the Profile Date Format.

Returns:
date format of the profile
std::string Tonido::Data::ProfileManager::getDateTimeFormat ( )

Returns the date time format for the logged in profile.

Returns:
date time format
std::string Tonido::Data::ProfileManager::getDisplayName ( )

Gets the currently active Profile's Display Name.

Returns:
active profile name
std::string Tonido::Data::ProfileManager::getDomain ( )

Gets the default domain used for profile creation.

Returns:
default doname name
std::string Tonido::Data::ProfileManager::getErrorLogRoot ( )

Gets the application's ErrorLog ROOT directory.

Returns:
the application's ErrorLog ROOT directory
int Tonido::Data::ProfileManager::getHTTPPort ( )

Returns the HTTP Port.

Returns:
the HTTP port
bool Tonido::Data::ProfileManager::getHTTPProxyEnabled ( )

Returns whether HTTP Proxy is enabled.

Returns:
true if HTTP proxy is enabled, false otherwise
std::string Tonido::Data::ProfileManager::getHTTPProxyHost ( )

Returns the HTTP Proxy Host.

Returns:
the HTTP proxy host name
int Tonido::Data::ProfileManager::getHTTPProxyPort ( )

Returns the HTTP Proxy Port.

Returns:
the HTTP proxy port
std::string Tonido::Data::ProfileManager::getLogDir ( )

Returns the log data dir.

Returns:
log data directory
int Tonido::Data::ProfileManager::getNumProfiles ( )

Get the number of profiles.

Returns:
number of profiles
PeerID Tonido::Data::ProfileManager::getPeerID ( )

Gets the currently active PeerID.

Returns:
active peer id
std::string Tonido::Data::ProfileManager::getProfile ( )

Returns the currently logged in profile.

If no user is currently logged in, an empty string will be returned.

Returns:
logged in profile name
bool Tonido::Data::ProfileManager::getProfileData ( Profile a_profile)

Gets the currently logged in profile information.

Parameters:
[out]a_profileprofile to get information
Returns:
true if profile data was filled in, false otherwise
std::string Tonido::Data::ProfileManager::getProfileEmail ( )

Returns the Email for the logged in profile.

Returns:
email
std::string Tonido::Data::ProfileManager::getProfileImagePath ( const std::string &  a_appRoot)

Returns the path to the profile image.

Parameters:
[in]a_appRootApplication Root Directory
Returns:
the profile image path, empty otherwise
std::string Tonido::Data::ProfileManager::getProfileList ( const std::string &  a_appRoot,
bool  a_isRemote 
)

Gets the list of actual profiles in the machine as XML.

Parameters:
[in]a_appRootapplication's APPROOT directory
[in]a_isRemote???
Returns:
the list of actual profiles
std::string Tonido::Data::ProfileManager::getProfileRootDir ( )

Returns the currently logged in profile's root dir.

If no user is currently logged in, an empty string will be returned.

Returns:
profile's root directory
std::string Tonido::Data::ProfileManager::getProfileUserDataDir ( )

Returns the currently logged in profile's user data dir.

If no user is currently logged in, an empty string will be returned.

Returns:
profile's user data directory
bool Tonido::Data::ProfileManager::getSecurityToken ( const std::string &  a_seed,
std::string &  a_token 
)

Creates a security key that is based on the user's password.

Parameters:
[in]a_inputKeypublic seed for the security token
[out]a_tokengenerated token
Returns:
true if the token was created correctly, false otherwise
std::string Tonido::Data::ProfileManager::getTonidoSyncDir ( )

Gets the Tonido Sync Directory.

Returns:
the sync directory
int Tonido::Data::ProfileManager::getUDPPort ( )

Returns the UDP Port.

Returns:
the UDP port
bool Tonido::Data::ProfileManager::isDefaultProfileUserDataDir ( )

Is Default UserData Directory.

Returns:
true if this is the default user data directory, false otherwise
bool Tonido::Data::ProfileManager::isHTTPS ( )

Returns whether HTTPS is enabled.

Returns:
true if HTTPS is anabled, false otherwise
bool Tonido::Data::ProfileManager::isProfileLoggedIn ( )

Gets whether the profile is logged in.

Returns:
true if profile is logger in, false otherwise
bool Tonido::Data::ProfileManager::isURLAuthOK ( const std::string &  a_user,
const std::string &  a_seed,
const std::string &  a_hash 
)

Checks if the URL Auth supplied is OK.

Returns:
true if auth is ok, false otherwise
bool Tonido::Data::ProfileManager::loginProfile ( const std::string &  a_appRoot)

Logs in last logged in profile into system.

Parameters:
[in]a_appRootapplication's APPROOT directory
Returns:
true if profile was logged in successfully, false otherwise
bool Tonido::Data::ProfileManager::loginProfile ( const std::string &  a_profileName,
std::string &  a_password,
const std::string &  a_appRoot,
bool  a_autoLogin,
std::string &  a_reason 
)

Logs in a specific profile, given the password.

If the log in succeeds, true is returned and the profile is considered as logged in. Otherwise, false is returned.

Parameters:
[in]a_profileNameprofile name to log in
[in]a_passwordpassword
[in]a_appRootapplication's APPROOT directory
[in]a_autoLogintrue if remember this login
[out]a_reasonoutput optional error string
Returns:
true if profile was logged in successfully, false otherwise
bool Tonido::Data::ProfileManager::logoutProfile ( )

Logs out the currently logged in user.

If the specified user was not logged in, it will simply return true as this is not considered an error.

Returns:
true if profile was logged out successfully, false otherwise
bool Tonido::Data::ProfileManager::needsUserAttention ( )

Whether user needs to do some action or not.

Returns:
true if action from user is required, false otherwise
void Tonido::Data::ProfileManager::processPeerConnect ( const PeerID a_peer)

Handles Peer Connection Event.

Parameters:
[in]a_peerpeer id
bool Tonido::Data::ProfileManager::resetPassword ( std::string &  a_resetpassword)

Resets the password.

Returns:
internal use only
int Tonido::Data::ProfileManager::resetProfile ( const std::string &  a_profileName,
const std::string &  a_emailAddress,
std::string &  a_reason 
)

Reset Profile.

Parameters:
[in]a_profileNamename of the profile
[in]emailaddress
Returns:
1 if success, 0 if failed
void Tonido::Data::ProfileManager::saveProfile ( bool  a_doSave)

Saves the profile information used for relogin.

Parameters:
[in]a_doSavetrue if save the profile
bool Tonido::Data::ProfileManager::secretQnAnsSet ( )

Verifies if the secret qn ans associated with the current profile is valid.

Returns:
true if profile has secret qn/ans set
void Tonido::Data::ProfileManager::setDomain ( const std::string &  a_domain)

Sets the default domain used for profile creation.

Parameters:
[in]a_domaindomain name
void Tonido::Data::ProfileManager::setProfileUserDataDir ( const std::string &  a_userDataDir)

Sets the currently logged in profile's user data dir.

Parameters:
[in]a_userDataDiris the profile's user data dir
Returns:
none
void Tonido::Data::ProfileManager::setTonidoSyncDir ( const std::string &  a_dir)

Sets the Tonido Sync Directory.

Returns:
none
void Tonido::Data::ProfileManager::showNotifications ( bool  a_show)

Sets whether to show notifications.

Parameters:
[in]a_showtrue to show notifications, false otherwise
bool Tonido::Data::ProfileManager::showNotifications ( )

Whether to show notifications.

Returns:
true if to show notifications, false otherwise
void Tonido::Data::ProfileManager::showUIOnLaunch ( bool  a_show)

Sets whether to show the UI on launch.

Parameters:
[in]a_showtrue to show the UI on launch, false otherwise
bool Tonido::Data::ProfileManager::showUIOnLaunch ( )

Whether to show the UI on launch.

Returns:
true if to show the UI on launch, false otherwise
bool Tonido::Data::ProfileManager::updatePassword ( const std::string &  a_oldpassword,
const std::string &  a_newpassword 
)

Updates the password.

Parameters:
[in]a_oldpasswordcurrent password
[in]a_newpasswordnew password to set
Returns:
true if password was updated, false otherwise
bool Tonido::Data::ProfileManager::updateProfile ( Profile a_profile,
std::string &  a_reason 
)

Updates information for a profile.

Parameters:
[in,out]a_profileprofile to update
[out]a_reasonoutput optional error string
Returns:
true if profile was updated successfully, false otherwise
bool Tonido::Data::ProfileManager::verifySecretQnAns ( const std::string &  a_qn,
const std::string &  a_ans,
const std::string &  a_password 
)

Verifies if the secret ans associated with the current profile is valid.

Parameters:
[in]a_qnsecret question
[in]a_anssecret answer
[in]a_passwordpassword
Returns:
true if profile was authenticated successfully, false otherwise

Generated on Wed Oct 12 2011 21:46:53. © CodeLathe LLC 2007-2011. All Rights Reserved.