1
ksagert
Temporary Password
  • 2012/6/8 2:50

  • ksagert

  • Just popping in

  • Posts: 2

  • Since: 2012/6/8 2


Hello!

I have been using Xoops only for the past couple hours, but I have absolutely fell in love with it and I have very, VERY high hopes of using it with our Non-Profit organization.

I will be securely hosting some files on Xoops for Members-Eyes-Only, and I am pretty paranoid about security. I don't want people to just register all willie-nillie. I already know how to make user accounts manually, but is there a way that I can setup a temporary password (like the password I would input while setting up the account) and have a page come up immediately following the initial login requiring the user to change their password?

Any help with this would be great!

2
AngeloRocha
Re: Temporary Password

This hack will force to change the password on first access.
Go to include/checklogin.php

In the line 63:
$user->setVar('last_login'time());


Change to:
$last_login=$user->getVar('last_login');
$user->setVar('last_login'time());


Go to line 85:
// Set cookie for rememberme
    
if (!empty($xoopsConfig['usercookie'])) {
        if (!empty(
$_POST["rememberme"])) {
            
setcookie($xoopsConfig['usercookie'], $_SESSION['xoopsUserId'] . '-' md5($user->getVar('pass') . XOOPS_DB_NAME XOOPS_DB_PASS XOOPS_DB_PREFIX), time() + 31536000'/'XOOPS_COOKIE_DOMAIN0);
        } else {
            
setcookie($xoopsConfig['usercookie'], 0, -1'/'XOOPS_COOKIE_DOMAIN0);
        }
    }


Chage to:
// Set cookie for rememberme
    
if (!empty($xoopsConfig['usercookie'])) {
        if (!empty(
$_POST["rememberme"])) {
            
setcookie($xoopsConfig['usercookie'], $_SESSION['xoopsUserId'] . '-' md5($user->getVar('pass') . XOOPS_DB_NAME XOOPS_DB_PASS XOOPS_DB_PREFIX), time() + 31536000'/'XOOPS_COOKIE_DOMAIN0);
        } else {
            
setcookie($xoopsConfig['usercookie'], 0, -1'/'XOOPS_COOKIE_DOMAIN0);
        }
    }
    if (
$last_login == 0) {
        
redirect_header(XOOPS_URL.'/modules/profile/changepass.php'5'Please, change your password!');
    }


Note:
It makes the User is redirected to change password on first login, if he quit without changing the screen no longer appears.
I hope you understand my bad English.

Font.:http://bit.ly/NRwJR7
www.xoopsfire.com

3
Anonymous
Re: Temporary Password
  • 2012/6/8 8:28

  • Anonymous

  • Posts: 0

  • Since:


Nice hack ! The choice of enabling this feature would be a good addition to the profile module.

Login

Who's Online

231 user(s) are online (152 user(s) are browsing Support Forums)


Members: 0


Guests: 231


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits