RE: [development-axapta] Deny user log on concurrently

2005-05-13 Thread James Flavell




Sorry Kenneth I would like to add maybe another question in the same area:
 
If I have two companies within one system is there any place I can control
to make sure the total user licenses are allocated correctly to each
company?
E.g.
Comapny A - paid for 10 users
Company B - paid for 25 users
So users who login and are associated with company A should be limited to 10
and likewise users logins for users assocaited with comapnyB shoul dbe
limited to 25.
 
I guess i will have to do modification so the system knows which company a
user id is associated with but where is the best place to put the code for
the checking how many users for each company is already logged in (I guess
it is going to be basically the sameplace as where Kenneth would need his
check also)
 
Thanks
James

-Original Message-
From: development-axapta@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of kamchung322
Sent: 13 May 2005 15:25
To: development-axapta@yahoogroups.com
Subject: [development-axapta] Deny user log on concurrently


Hi, 

Is it possible to deny user log on concurrently ?

Regards

Kenneth. 






 _ 

Yahoo! Groups Links


* To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
 

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 
 

* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
http://docs.yahoo.com/info/terms/ . 




[Non-text portions of this message have been removed]












Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










RE: [development-axapta] Deny user log on concurrently

2005-05-13 Thread Jesper Kehlet




Yes. What you will have to do is to write a little piece of code in the
Application.startup() method that traverses through sessions, compares
the logged on sessions' user id's to the current user + session id, and
does an xInfo.shutdown() if the current user is already logged on with a
different session id.
 
For example, a little like this (the try-catch is to prevent a
Ctrl-Break situation):
 
 int maxSessions = Info::licensedUsersTotal() ?
Info::licensedUsersTotal() : 3;
 int i;
 xSession session;
 ;
 for(i = 1; i = maxSessions; i++)
 {
 session = new xSession(i, true);
 if(session.userId() == curuserid()  session.sessionId() !=
sessionid())
 {
 try
 {
 Box::info(You are already logged on. Good bye!);
 new xInfo().shutDown(true);
 }
 catch(Exception::Break)
 {
 new xInfo().shutDown(true);
 }
 }
 }



From: development-axapta@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of kamchung322
Sent: Friday, May 13, 2005 1:25 AM
To: development-axapta@yahoogroups.com
Subject: [development-axapta] Deny user log on concurrently


Hi, 

Is it possible to deny user log on concurrently ?

Regards

Kenneth. 








Yahoo! Groups Links


* To visit your group on the web, go to:
 http://groups.yahoo.com/group/development-axapta/
  
* To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
be 
  
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service http://docs.yahoo.com/info/terms/ . 




[Non-text portions of this message have been removed]












Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.