Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   Login for a certain time (http://www.bvlist.com/showthread.php?t=10707)

Chez 29th January 2016 10:51

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!

puppy 15th November 2016 10:55

Can you make it timeout / end session after 15mins? Love your work mate!

DND 15th November 2016 11:23

<option value="900">15 Minsoption>


All times are GMT +2. The time now is 06:52.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.