Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules
New Posts New Topics All Posts All Forums Index General Modules Themes Development International XOOPS.org

Search

Donat-O-Meter

Make donations with PayPal!
Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $65.00
Net Balance: $61.80
Left to go: $38.20

Donations
studioC  ($25)May-17
Anonymous ($15)May-16
Anonymous ($25)May-4

Learn XOOPS Core

Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

2 2.5 2.6 3.0 90 2013 Abuse AntiHarvesting AntiMalUser AntiSpam API Beats billige black Blocks blue Captcha capture Casual cell Checksum Christmas chronolabs content Conversion Debauchosity demo docek download Dresses EC2 editor ELB evden eve facebook floor free games herre Honeypot Human IP jQuery kantor klubovi lamps log logger Marquee mobile module modules Monster MyAlbum-p newbb news newsletter online oxygen PageRank Payment Permissions pink Plugin portal Prevention profile project Protector Protocols publisher Rights rmcommon Room sale security Server site Smarty Spam stem Studio support tag tags tdmcreate Theme themes txmod Umfrage User userlog website Whitepaper xoops XOOPS2 Xortify XPayment ZendFramework

New Users

Registering user

# 136024

ngochuyen

Welcome to XOOPS!




Bottom   Previous Topic   Next Topic  Register To Post



#1 Posted on: 2012/6/7 21:50 Temporary Password
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!

Top

ksagert
Just popping in
Just popping in
Joined:
2012/6/7 21:44
From Leduc
Group:
Registered Users
Posts: 2
(Show More) (Show Less)


#2 Posted on: 2012/6/7 22:37 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

Top


AngeloRocha
Quite a regular
Quite a regular
Joined:
2010/6/8 11:32
From Brasil
Group:
Registered Users
Posts: 263
(Show More) (Show Less)


#3 Posted on: 2012/6/8 3:28 Re: Temporary Password
Nice hack ! The choice of enabling this feature would be a good addition to the profile module.

Top


The Dutch speaking XOOPS community has moved!
____________________________________

For Dutch support now go to www.nlxoops.nl
flipse
Moderator
Moderator
Joined:
2005/9/15 4:11
From The Netherlands
Group:
Registered Users
Community Coordinator (temporary)
Posts: 700
(Show More) (Show Less)







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You can vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.

[Advanced Search]