OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
MongoUserFunctions Namespace Reference

Functions

bool authenticateUser (std::string username, std::string password, std::string databaseUrl, mongocxx::client &adminClient)
 
bool registerUser (std::string username, std::string password, mongocxx::client &adminClient, std::string oldSettingsCollectionName="")
 
std::string generateUserSettingsCollectionName (mongocxx::client &adminClient)
 
User getUserDataThroughUsername (const std::string &username, mongocxx::client &adminClient)
 
User getUserDataThroughId (std::string userId, mongocxx::client &adminClient)
 
std::vector< UsergetAllUsers (mongocxx::client &adminClient)
 
size_t getAllUserCount (mongocxx::client &adminClient)
 
bool removeUser (User &userToBeDeleted, mongocxx::client &adminClient)
 
bool updateUserUsernameById (std::string userId, std::string newUsername, mongocxx::client &adminClient)
 
bool updateUserUsernameByName (std::string oldUsername, std::string newUsername, mongocxx::client &adminClient)
 
bool changeUserPassword (std::string username, std::string newPassword, mongocxx::client &adminClient)
 
bool updateUsername (std::string oldUsername, std::string newUsername, mongocxx::client &adminClient)
 
std::string userToJson (User &user)
 
std::string usersToJson (std::vector< User > &users)
 
std::string hashPassword (const std::string &password)
 
bool doesUserExist (const std::string &userName, mongocxx::client &adminClient)
 
void createTmpUser (std::string userName, std::string userPWD, User &_loggedInUser, mongocxx::client &adminClient, ot::JsonDocument &json)
 
void removeTmpUser (std::string userName, mongocxx::client &adminClient)
 

Function Documentation

◆ authenticateUser()

bool MongoUserFunctions::authenticateUser ( std::string username,
std::string password,
std::string databaseUrl,
mongocxx::client & adminClient )

◆ changeUserPassword()

bool MongoUserFunctions::changeUserPassword ( std::string username,
std::string newPassword,
mongocxx::client & adminClient )

◆ createTmpUser()

void MongoUserFunctions::createTmpUser ( std::string userName,
std::string userPWD,
User & _loggedInUser,
mongocxx::client & adminClient,
ot::JsonDocument & json )

◆ doesUserExist()

bool MongoUserFunctions::doesUserExist ( const std::string & userName,
mongocxx::client & adminClient )

◆ generateUserSettingsCollectionName()

std::string MongoUserFunctions::generateUserSettingsCollectionName ( mongocxx::client & adminClient)

◆ getAllUserCount()

size_t MongoUserFunctions::getAllUserCount ( mongocxx::client & adminClient)

◆ getAllUsers()

std::vector< User > MongoUserFunctions::getAllUsers ( mongocxx::client & adminClient)

◆ getUserDataThroughId()

User MongoUserFunctions::getUserDataThroughId ( std::string userId,
mongocxx::client & adminClient )

◆ getUserDataThroughUsername()

User MongoUserFunctions::getUserDataThroughUsername ( const std::string & username,
mongocxx::client & adminClient )

◆ hashPassword()

std::string MongoUserFunctions::hashPassword ( const std::string & password)

◆ registerUser()

bool MongoUserFunctions::registerUser ( std::string username,
std::string password,
mongocxx::client & adminClient,
std::string oldSettingsCollectionName = "" )

◆ removeTmpUser()

void MongoUserFunctions::removeTmpUser ( std::string userName,
mongocxx::client & adminClient )

◆ removeUser()

bool MongoUserFunctions::removeUser ( User & userToBeDeleted,
mongocxx::client & adminClient )

◆ updateUsername()

bool MongoUserFunctions::updateUsername ( std::string oldUsername,
std::string newUsername,
mongocxx::client & adminClient )

◆ updateUserUsernameById()

bool MongoUserFunctions::updateUserUsernameById ( std::string userId,
std::string newUsername,
mongocxx::client & adminClient )

◆ updateUserUsernameByName()

bool MongoUserFunctions::updateUserUsernameByName ( std::string oldUsername,
std::string newUsername,
mongocxx::client & adminClient )

◆ usersToJson()

std::string MongoUserFunctions::usersToJson ( std::vector< User > & users)

◆ userToJson()

std::string MongoUserFunctions::userToJson ( User & user)