add below piece to info.startupPost() method.
void startupPost()
{
int SessionCounter;
int num = 0;
int maxSessions = Info::licensedUsersTotal();
UserInfo userInfo;
UserId CurrentUserId;
xSession TmpSession;
;
//if ( XGlobal::isAOS()== false )
// return;
CurrentUserId = curuserid();
for(SessionCounter = 1; SessionCounter < maxSessions;SessionCounter++ )
{
TmpSession = new xSession(SessionCounter, true);
if(TmpSession && TmpSession.userId())
{
select firstOnly userInfo where userInfo.id == TmpSession.userId();
if (userInfo && (CurrentUserId == TmpSession.userId()))
num++ ;
}
}
if (num > 1)
{
if(box::yesno("The same user id can't log in twice. Do you want to log in anyway? ",
DialogButton::Yes, "Log in", "Log out") == DialogButton::No)
{
infolog.shutDown(true);
}
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment