本文整理汇总了C++中ISecUser::setName方法的典型用法代码示例。如果您正苦于以下问题:C++ ISecUser::setName方法的具体用法?C++ ISecUser::setName怎么用?C++ ISecUser::setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISecUser
的用法示例。
在下文中一共展示了ISecUser::setName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copyTo
virtual void copyTo(ISecUser& destination)
{
destination.setAuthenticateStatus(getAuthenticateStatus());
destination.setName(getName());
destination.setFullName(getFullName());
destination.setFirstName(getFirstName());
destination.setLastName(getLastName());
destination.setEmployeeID(getEmployeeID());
destination.setRealm(getRealm());
destination.setFqdn(getFqdn());
destination.setPeer(getPeer());
destination.credentials().setPassword(credentials().getPassword());
destination.credentials().setSessionToken(credentials().getSessionToken());
destination.credentials().setSignature(credentials().getSignature());
CDateTime exp;
credentials().getPasswordExpiration(exp);
destination.credentials().setPasswordExpiration(exp);
CDateTime tmpTime;
destination.setPasswordExpiration(getPasswordExpiration(tmpTime));
destination.setStatus(getStatus());
CriticalBlock b(crit);
Owned<IPropertyIterator> Itr = m_parameters->getIterator();
ForEach(*Itr)
{
destination.setProperty(Itr->getPropKey(),m_parameters->queryProp(Itr->getPropKey()));
}
// DBGLOG("Copied name %s to %s",getName(),destination.getName());
}
示例2: copyTo
virtual void copyTo(ISecUser& destination)
{
destination.setAuthenticateStatus(getAuthenticateStatus());
destination.setName(getName());
destination.setFullName(getFullName());
destination.setFirstName(getFirstName());
destination.setLastName(getLastName());
destination.setRealm(getRealm());
destination.setFqdn(getFqdn());
destination.setPeer(getPeer());
destination.credentials().setPassword(credentials().getPassword());
CDateTime tmpTime;
destination.setPasswordExpiration(getPasswordExpiration(tmpTime));
destination.setStatus(getStatus());
if(m_parameters.get()==NULL)
return;
CriticalBlock b(crit);
Owned<IPropertyIterator> Itr = m_parameters->getIterator();
Itr->first();
while(Itr->isValid())
{
destination.setProperty(Itr->getPropKey(),m_parameters->queryProp(Itr->getPropKey()));
Itr->next();
}
//addToken is not currently implemented....
// DBGLOG("Copied name %s to %s",getName(),destination.getName());
}
示例3: processHeader
int CSoapService::processHeader(CHeader* header, IEspContext* ctx)
{
int num = header->getNumBlocks();
if(ctx == NULL)
return 0;
int returnValue = 0;
bool authenticated = !ctx->toBeAuthenticated();
for (int i = 0; i < num; i++)
{
IRpcMessage* oneblock = header->getHeaderBlock(i);
if(oneblock == NULL)
continue;
if(strcmp(oneblock->get_name(), "Security") == 0)
{
bool encodeXML = oneblock->getEncodeXml();
oneblock->setEncodeXml(false);
StringBuffer username, password,realm;
oneblock->get_value("UsernameToken/Username", username);
oneblock->get_value("UsernameToken/Password", password);
oneblock->get_value("RealmToken/Realm", realm);
oneblock->setEncodeXml(encodeXML);
//DBGLOG("username=%s, password=%s", username.str(), password.str());
if(username.length() > 0)
{
ctx->setUserID(username.str());
ctx->setPassword(password.str());
if(realm.length()>0)
ctx->setRealm(realm.str());
ISecManager* secmgr = ctx->querySecManager();
if(secmgr != NULL)
{
ISecUser *user = ctx->queryUser();
if(user==NULL)
{
user = secmgr->createUser(username.str());
ctx->setUser(user);
}
if(user == NULL)
{
WARNLOG("Couldn't create ISecUser object for %s", username.str());
}
user->setName(username.str());
user->credentials().setPassword(password.str());
if(realm.length()>0)
user->setRealm(realm.str());
}
if(ctx->toBeAuthenticated())
{
if(stricmp(m_soapbinding->getTransportType(), "http") == 0)
{
EspHttpBinding* httpbinding = dynamic_cast<EspHttpBinding*>(m_soapbinding.get());
authenticated = httpbinding->doAuth(ctx);
}
else
{
authenticated = false;
}
if(!authenticated)
returnValue = SOAP_AUTHENTICATION_ERROR;
break;
}
}
}
}
if (returnValue == 0)
{
if (authenticated)
return 0;
returnValue = SOAP_AUTHENTICATION_REQUIRED;
}
StringBuffer peerStr;
ctx->getPeer(peerStr);
const char* userId = ctx->queryUserId();
VStringBuffer msg("SOAP request from %[email protected]%s.", (userId&&*userId)?userId:"unknown", (peerStr.length()>0)?peerStr.str():"unknown");
if (returnValue == SOAP_AUTHENTICATION_ERROR)
msg.append(" User authentication failed");
else
msg.append(" User authentication required");
DBGLOG("%s", msg.str());
return returnValue;
}