1
wruckman
Re: Last login times not updating
  • 2005/11/15 0:04

  • wruckman

  • Just popping in

  • Posts: 1

  • Since: 2005/8/3 8


I had the same issue with my login times not updating. I figured out what the problem was for my site and i had to modify a few lines of code.

the first thing was that i wanted to have a secure login using ssl so i added the following to my user.php file.

$port $_SERVER['SERVER_PORT'];
if(
$port !== "443") {
header ("Location: https://mysite/xoopsdir/user.php");
}


This code indirectly caused the problem. basically i was forcing people to use a https page because it was encrypted. for some reason this causes issues with the last login being recored in the database from the checklogin.php file.

Removing that code fixed the last login issue, but left my site without ssl login.

in order to get the last login to work, and have my site ssl secured i found a way to change the post method of the system_userform.html template.

i went into templates in the admin console and went to system templates. i choose to edit the system_userform.html template to this:

<fieldset style="padding: 10px;">
  <
legend style="font-weight: bold;"><{$lang_login}></legend>
  <
form action="https://mysite/xoopsdir/user.php" method="post">
    <{
$lang_username}> <input type="text" name="uname" size="26" maxlength="25" value="<{$usercookie}>" /><br />
    <{
$lang_password}> <input type="password" name="pass" size="21" maxlength="32" /><br />
    <
input type="hidden" name="op" value="login" />
    <
input type="hidden" name="xoops_redirect" value="<{$redirect_page}>" />
    <
input type="submit" value="<{$lang_login}>" />
  </
form>
  <
a name="lost"></a>
  <
div><{$lang_notregister}><br /></div>
</
fieldset>

<
br />

<
fieldset style="padding: 10px;">
  <
legend style="font-weight: bold;"><{$lang_lostpassword}></legend>
  <
div><br /><{$lang_noproblem}></div>
  <
form action="lostpass.php" method="post">
    <{
$lang_youremail}> <input type="text" name="email" size="26" maxlength="60" />&nbsp;&nbsp;<input type="hidden" name="op" value="mailpasswd" /><input type="hidden" name="t" value="<{$mailpasswd_token}>" /><input type="submit" value="<{$lang_sendpassword}>" />
  </
form>
</
fieldset>


With the https as the post url, it will prompt for the certificate after hitting the login button transfer the info using ssl and saves the correct last login time in the database using the default method of calling the funtion in checklogin.php:

$user->setVar('last_login'time());


Hope this helps!




TopTop



Login

Who's Online

260 user(s) are online (166 user(s) are browsing Support Forums)


Members: 0


Guests: 260


more...

Donat-O-Meter

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

Latest GitHub Commits