Hi all !
I am facing a problem ,multiple users login with same username and password .I need to stop it urgent.Need adeas to solve this problem.........
satish
There is no reliable way to do this with technology and I suggest you use social pressure/sanction to achieve this result. In theory it might be possible to use the i.p address of the client, but in many situations multiple machines will have the same i.p. address and thus cannot be relied on.
Marcus ,
Thanks for this reply.But i need it urgent because in my school stdents sharing his username and password.
Pls check it is my idea .
1.if add a column(flag) in table mdl_user store a 'false' value when user create new account .
2.Make a function which accept three value table name,flag field and username(which user enter) .this function return the value of flag field (true or false) .This function call if the user exist in database.
2.1 if 'false' returned then allow to login user and insert value into flag field 'true'.
2.2 if 'true'retuned then do not allow to login and print the message below the username and password field "This user already logged".Do not insert any value in database.
2.3 Now when sign out user then insert into flag field value 'flase'.
3.User allow to login only when flag field value 'false'.
pls chek it and give me your more ideas........
Thanks
satish
Thanks ! for your ideas
I added a flag field in table mdl_user but when the user close the window without logout ,flag field do not update .only one idea need how can i update flag field value when the user close the window without logout.
waiting help from all..........
satish
very good idea !!!
It is very good idea ,actually i need this ,i want to logout previous logged user.I am working on this problem ,i want to implement but need help in every step.
First problem is how can i store session key in user table ?
i think we have to add a new field which store session key.
waiting your ideas....
satish
Thank you sir !
your second idea is very nice ,but sir how can i check any existing user(which is logged) .
need your idea in brief ,i am working on this problem ,can you help me sir ?.I want to implement it....
waiting sir your reply.
satish
Thanks !
But sir this is for intranet which store session in tmp folder.My website on internet based www.kompz.com/skool ,then how can i access tmp folder ?.
need your help more..............
satish
HI:
If all you need is to allow a unique login by a user by logging out the previous login and deleting all but one session, then you may find this plugin useful. http://docs.moodle.org/en/Uniquelogin_authentication
It works beautifully and does not require any code modification since it is a plugin. A great piece of code by Emanuel Delgado.
Ciao
AN.
$CFG->tracksessionip = true;
What it does is store the IP of the user when they first authenticate, and then checks for changes every time they access a page. If the IP changes then they get an error and are prevented from doing anything.
Ok, heres the logic. The session key on login is stored in a database field. Next time another user logs in, that field is overwritten by the new session key. The first user is logged out.
To do this, attached is a file with details. Please remember to make backup of all files that you edit before trying anything.
Need suggestions and test on this code. I only have a MySQL installation so the code is only made for that, if someone could update the files with Postgres changes and post it here, would be great for everyone
I don't think so this is logical to get log out first user if second user get log-in, instead of this second user should get message that first user is login by using same user name and passwor....
if any one have solution please let me know...
I try unique login plugin but it's not useful for me..
thanks in advance