Manages Tonido User Profiles. More...
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::ConfigDb * | getConfigDB () |
| 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 () |
Manages Tonido User Profiles.
| Tonido::Data::ProfileManager::ProfileManager | ( | void | ) |
Ctor.
details if needed ...
| Tonido::Data::ProfileManager::~ProfileManager | ( | void | ) |
Dtor.
details if needed ...
| bool Tonido::Data::ProfileManager::allowConnectionsFromAllIPs | ( | ) |
Gets whether Tonido access is allowed from all IP networks.
| std::string Tonido::Data::ProfileManager::allowedWebServerAccess | ( | ) |
Gets the level of Web Server access.
| bool Tonido::Data::ProfileManager::allowNetwork | ( | ) |
Gets whether the Tonido Network communication is enabled or not.
| bool Tonido::Data::ProfileManager::allowRemoteAdmin | ( | ) |
Gets whether Remote Administration is allowed.
| 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.
| [in] | a_profileName | name of the profile |
| [in] | a_password | password to check with this profile |
| 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
| [in] | a_profileName | name of the profile |
| [in] | a_password | password to check with this profile |
| [in] | a_appRoot | application's APPROOT directory |
| std::string Tonido::Data::ProfileManager::checkID | ( | const std::string & | a_profileName | ) |
Checks if a given profile name is available for profile creation.
| [in] | a_profileName | profile name |
| void Tonido::Data::ProfileManager::checkURL | ( | const std::string & | a_syncToken | ) |
Checks if the URL is accessible.
| [in] | a_syncToken | request token |
| 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.
| [out] | a_profile | profile to create |
| [in] | a_appRoot | application's APPROOT directory |
| [out] | a_reason | output optional error string |
| 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
| [in] | a_profileName | name of the profile |
| [in] | a_password | password to check with this profile |
| 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
| std::string Tonido::Data::ProfileManager::getAppRoot | ( | ) |
Gets the application's APPROOT directory.
| Misc::ConfigDb* Tonido::Data::ProfileManager::getConfigDB | ( | ) |
Gets the configuration DB associated with this profile.
| std::string Tonido::Data::ProfileManager::getDateFormat | ( | ) |
Gets the Profile Date Format.
| std::string Tonido::Data::ProfileManager::getDateTimeFormat | ( | ) |
Returns the date time format for the logged in profile.
| std::string Tonido::Data::ProfileManager::getDisplayName | ( | ) |
Gets the currently active Profile's Display Name.
| std::string Tonido::Data::ProfileManager::getDomain | ( | ) |
Gets the default domain used for profile creation.
| std::string Tonido::Data::ProfileManager::getErrorLogRoot | ( | ) |
Gets the application's ErrorLog ROOT directory.
| int Tonido::Data::ProfileManager::getHTTPPort | ( | ) |
Returns the HTTP Port.
| bool Tonido::Data::ProfileManager::getHTTPProxyEnabled | ( | ) |
Returns whether HTTP Proxy is enabled.
| std::string Tonido::Data::ProfileManager::getHTTPProxyHost | ( | ) |
Returns the HTTP Proxy Host.
| int Tonido::Data::ProfileManager::getHTTPProxyPort | ( | ) |
Returns the HTTP Proxy Port.
| std::string Tonido::Data::ProfileManager::getLogDir | ( | ) |
Returns the log data dir.
| int Tonido::Data::ProfileManager::getNumProfiles | ( | ) |
Get the number of profiles.
| PeerID Tonido::Data::ProfileManager::getPeerID | ( | ) |
Gets the currently active PeerID.
| 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.
| bool Tonido::Data::ProfileManager::getProfileData | ( | Profile & | a_profile | ) |
Gets the currently logged in profile information.
| [out] | a_profile | profile to get information |
| std::string Tonido::Data::ProfileManager::getProfileEmail | ( | ) |
Returns the Email for the logged in profile.
| std::string Tonido::Data::ProfileManager::getProfileImagePath | ( | const std::string & | a_appRoot | ) |
Returns the path to the profile image.
| [in] | a_appRoot | Application Root Directory |
| 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.
| [in] | a_appRoot | application's APPROOT directory |
| [in] | a_isRemote | ??? |
| 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.
| 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.
| 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.
| [in] | a_inputKey | public seed for the security token |
| [out] | a_token | generated token |
| std::string Tonido::Data::ProfileManager::getTonidoSyncDir | ( | ) |
Gets the Tonido Sync Directory.
| int Tonido::Data::ProfileManager::getUDPPort | ( | ) |
Returns the UDP Port.
| bool Tonido::Data::ProfileManager::isDefaultProfileUserDataDir | ( | ) |
Is Default UserData Directory.
| bool Tonido::Data::ProfileManager::isHTTPS | ( | ) |
Returns whether HTTPS is enabled.
| bool Tonido::Data::ProfileManager::isProfileLoggedIn | ( | ) |
Gets whether the profile is logged in.
| 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.
| bool Tonido::Data::ProfileManager::loginProfile | ( | const std::string & | a_appRoot | ) |
Logs in last logged in profile into system.
| [in] | a_appRoot | application's APPROOT directory |
| 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.
| [in] | a_profileName | profile name to log in |
| [in] | a_password | password |
| [in] | a_appRoot | application's APPROOT directory |
| [in] | a_autoLogin | true if remember this login |
| [out] | a_reason | output optional error string |
| 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.
| bool Tonido::Data::ProfileManager::needsUserAttention | ( | ) |
Whether user needs to do some action or not.
| void Tonido::Data::ProfileManager::processPeerConnect | ( | const PeerID & | a_peer | ) |
Handles Peer Connection Event.
| [in] | a_peer | peer id |
| bool Tonido::Data::ProfileManager::resetPassword | ( | std::string & | a_resetpassword | ) |
Resets the password.
| int Tonido::Data::ProfileManager::resetProfile | ( | const std::string & | a_profileName, |
| const std::string & | a_emailAddress, | ||
| std::string & | a_reason | ||
| ) |
Reset Profile.
| [in] | a_profileName | name of the profile |
| [in] | address |
| void Tonido::Data::ProfileManager::saveProfile | ( | bool | a_doSave | ) |
Saves the profile information used for relogin.
| [in] | a_doSave | true if save the profile |
| bool Tonido::Data::ProfileManager::secretQnAnsSet | ( | ) |
Verifies if the secret qn ans associated with the current profile is valid.
| void Tonido::Data::ProfileManager::setDomain | ( | const std::string & | a_domain | ) |
Sets the default domain used for profile creation.
| [in] | a_domain | domain name |
| void Tonido::Data::ProfileManager::setProfileUserDataDir | ( | const std::string & | a_userDataDir | ) |
Sets the currently logged in profile's user data dir.
| [in] | a_userDataDir | is the profile's user data dir |
| void Tonido::Data::ProfileManager::setTonidoSyncDir | ( | const std::string & | a_dir | ) |
Sets the Tonido Sync Directory.
| void Tonido::Data::ProfileManager::showNotifications | ( | bool | a_show | ) |
Sets whether to show notifications.
| [in] | a_show | true to show notifications, false otherwise |
| bool Tonido::Data::ProfileManager::showNotifications | ( | ) |
Whether to show notifications.
| void Tonido::Data::ProfileManager::showUIOnLaunch | ( | bool | a_show | ) |
Sets whether to show the UI on launch.
| [in] | a_show | true to show the UI on launch, false otherwise |
| bool Tonido::Data::ProfileManager::showUIOnLaunch | ( | ) |
Whether to show the UI on launch.
| bool Tonido::Data::ProfileManager::updatePassword | ( | const std::string & | a_oldpassword, |
| const std::string & | a_newpassword | ||
| ) |
Updates the password.
| [in] | a_oldpassword | current password |
| [in] | a_newpassword | new password to set |
| bool Tonido::Data::ProfileManager::updateProfile | ( | Profile & | a_profile, |
| std::string & | a_reason | ||
| ) |
Updates information for a profile.
| [in,out] | a_profile | profile to update |
| [out] | a_reason | output optional error string |
| 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.
| [in] | a_qn | secret question |
| [in] | a_ans | secret answer |
| [in] | a_password | password |