本文整理汇总了C++中UserServer::getNumUserFromId方法的典型用法代码示例。如果您正苦于以下问题:C++ UserServer::getNumUserFromId方法的具体用法?C++ UserServer::getNumUserFromId怎么用?C++ UserServer::getNumUserFromId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserServer
的用法示例。
在下文中一共展示了UserServer::getNumUserFromId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UMSVishnuException
/**
* \brief Function to connect the session
* \param user The object which manipulates user information
* \param host The object which manipulates client machine information
* \param connectOpt The options data structure for connection
* \return raises an exception on error
*/
int
SessionServer::connectSession(UserServer user, MachineClientServer host, UMS_Data::ConnectOptions* connectOpt) {
std::string numUserToconnect;
msession.setAuthenId( user.getData().getUserId() );
if (! user.isAuthenticate()) {
throw UMSVishnuException(ERRCODE_UNKNOWN_USER);
}
if (! connectOpt->getSubstituteUserId().empty()) {
user.checkUserId( connectOpt->getSubstituteUserId());
if (! user.isAdmin()) {
throw UMSVishnuException (ERRCODE_NO_ADMIN);
}
numUserToconnect = user.getNumUserFromId( connectOpt->getSubstituteUserId() );
if (numUserToconnect.empty()) {
throw UMSVishnuException(ERRCODE_UNKNOWN_USER, connectOpt->getSubstituteUserId());
}
msession.setUserId(connectOpt->getSubstituteUserId());
}
//if there is not a numSubstituteUserId
if (numUserToconnect.empty()) {
numUserToconnect = user.getNumUserFromLoginInfo(user.getData().getUserId(), user.getData().getPassword());
msession.setUserId(user.getData().getUserId());
}
generateSessionKey(user.getData().getUserId());
generateSessionId(user.getData().getUserId());
//To solve the connection mode
solveConnectionMode(connectOpt);
host.recordMachineClient();
recordSessionServer(host.getId(), numUserToconnect);
return 0;
}