Bravo List
Register
Go Back   > Bravo List > Sourcecode > TBDev > Mods & Themes
Reply
  #1  
Old 29-01-16, 10:51
Chez's Avatar
Chez Chez is offline
Senior Member
 
Join Date: Sep 2011
P2P
Posts: 240
Default Login for a certain time
This mod allows you to log in for a certain time like one hour, one day, one week, one year and permanent.

In your login.php after:

PHP Code:
<form method="post" action="takelogin.php"
Add this:

PHP Code:
<tr>
<
td class="rowhead">Time:</td><td align="left">
<
select name="expires">
<
option value="0" selected>Permanent</option>
<
option value="3600">One hour</option>
<
option value="86400">One day</option>
<
option value="604800">One week</option>
<
option value="2629743">One month</option>
<
option value="31556926">One year</option>
</
select>
</
td></tr
Then in your takelogin.php find this:

PHP Code:
logincookie($row["id"], $row["passhash"]); 
And replace with this:

PHP Code:
$expires = (int) $_POST["expires"];

if (!
$expires or $expires <= or $expires 31556926) {
 
$expires 0x7fffffff;
} else {
 
$expires time() + $expires;
}

logincookie($row["id"], $row["passhash"], 1$expires); 
That's all!
__________________
http://www.bvlist.com/images/avatars/signaturepics/sigpic16443_2.gif
Reply With Quote
The Following User Says Thank You to Chez For This Useful Post:
puppy (15-11-16)
  #2  
Old 15-11-16, 10:55
puppy's Avatar
puppy puppy is offline
Member
 
Join Date: Feb 2016
P2P
Posts: 12
Default
Can you make it timeout / end session after 15mins? Love your work mate!
__________________
http://www.scene-community.com
Reply With Quote
  #3  
Old 15-11-16, 11:23
DND's Avatar
DND DND is offline
Support
 
Join Date: Dec 2008
Posts: 922
Default
<option value="900">15 Mins</option>
__________________
Need HELP!? I can install:

  1. Server/VPS (Debian,CentOS,Ubuntu,Fedora, FreeBSD) Optimization and ... + Modules
  2. Webserver Windows/Linux (Apache/Lighttpd/Nginx/Mysql/PhpMyAdmin/SSL) Optimization and ... + Modules
  3. Seedbox Windows/Linux (uTorrent,rTorrent,libTorrent,ruTorrent) + Modules
  4. TBDev Support
  5. Gazelle Support Install
  6. TSSE Install Support

Last edited by joeroberts; 15-11-16 at 13:45. Reason: Un needed coments keep it clean.
Reply With Quote
Reply

Tags
login , time

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 08:49. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2017, vBulletin Solutions Inc.