Hi Friends,
Get patch from -
http://xoops.biz/dist/my_autologin_for_xoops-2.0.9.x.zip--------------------------------------------------
This is my first XOOPS hack released to public
My hack is highly influenced by GIJOE auto-login hack. This does exactly same thing but my approach is bit refined (I think so, feel free to disagree).
Followings are major changes.
1. In place of making a localized code change, I also changed "kernel/member.php" and added two new methods loginUserAuto (auto-login someone using saved cookies) and loginUserEmail (login someone using email as username).
2. I am using value stored in actkey column for auto-login feature. I too am totally against storing the MD5 of real password in user cookies (like the author of original auto-login and several other people). So here is perhaps the safer work-around. MD5 of actkey is sent to user's browser as cookies and the same is matched for auto-login. I found this column useless after user activation - so why don't we overload it.
Minor differences:
1. I had to change "kernel/user.php" also as it was not persisting actkey column for any existing user.
2. _MB_SYSTEM_REMEMBERME is not used. Rather global variable _REMEMBERME is used to render 'system_userform.html' and 'system_block_login.html' both. I didn't see any reason of duplicating variable for block and main page.
3. Using cookie name 'autologin_key' in place of 'autologin_pass'
4. Using xoops's standard function checkEmail() to test if email was passed as userId.
Looking forward to see feedback from you people
------------------------------------------------------
Q. How to install hack?
A. You should be knowing what you are doing
This patch is ok for version 2.0.9.x only and you just need to overwrite files with the supplied ones. (For older versions, serach for the word "sraj" in hacked files and merge the chages manually).
After overwrite, don't forget to update system module
Done, Enjoy...
------------------------------------------------------
GIJOE: Sorry I copied your code-fragments shamelessly. Feel free to merge my suggested changes in your hack. I guess, there are still scopes of making it better.
(If we allow auto-login from just one PC then, every auto-login can reset actkey to a new value and update autologin cookies - perhaps much safer option.)
Cheers,
Sudhaker Raj
sudhaker _at_ yahoo _dot_ com