Ignore Concurrent for Administrator

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
Bishu
User
Posts: 427

Ignore Concurrent for Administrator

Post by Bishu »

I have made the concurrent login to disallow.
but I want to ignore this option only for administrator (user level -1)

And I have also made a master password to login for all the user at
Server Events -> Global -> All Pages -> User_CustomValidate
I want to ignore the concurrent login whenever it login with the Master Password for any user.


mobhar
User
Posts: 11660

Post by mobhar »

Not sure what is exactly do you want to achieve? Did you mean you want to disallow concurrent login for user Administrator level (hard-coded)?


Bishu
User
Posts: 427

Post by Bishu »

I have 2 issue

No. 1) Yes I would like to disabled concurrent login for Administrator Only.

No.2) I have made a Master Password example "master" which I can login for any user.
Now when I login with the "master" password the user can not login as it show you have already login.
So, I want the user allow login if i am login with the master password also.
but the user should not allow to login concurrent with his same password.


mobhar
User
Posts: 11660

Post by mobhar »

Bishu wrote:
1) Yes I would like to disabled concurrent login for Administrator Only.

You cannot disable concurrent login for Administrator.

2) ....

You may simply change/increase the value of "1" to your desired number of concurrent user from "Security" -> "Advanced" -> "User Login Options" -> "Maximum concurrent user session count", and then regenerate ALL the script files again.


kirondedshem
User
Posts: 642

Post by kirondedshem »

No. 1) Yes I would like to disabled concurrent login for Administrator Only.
No.2)

this should point you to the right direction. try to pick hints from this and impliment your solution

Both these might not be supported by default in phpmaker but you can still imliment them yousrself, eg you need to be able to know who has logged in and wether he has used a master password or not. You need to information to be saved on the server so that anyone who tries to login you have a list of all currelty looged in users who have used a master password.

SO for this you need to create a table in your db to save eg(this is just an example) table will save the following data (user_id, if_used_master_password_status, is_logged_in_Status).
You can populate this table after a user has looged in event User_LoggedIn($usr), DONT forget to clear this session when he logs out in event User_LoggingOut($usr).

Now when users try to log in you can first query if there is an existing user logged in with amster password or whatever other condition. Then decide if the user can eb allowed to login in or not.
You can do this in the following event User_LoggingIn($usr, &$pwd)

That way users can log in and reserve the session stoping any other users from loggin in, Then then can log out and it clears the session in the db and lets other users also log in.

With above approach you acn also stop the hardcoded user from logginin if you wanted to.


Post Reply