Check out Symmetric Chess, our featured variant for March, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Comments/Ratings for a Single Item

Earlier Reverse Order Later
Logging In[Subject Thread] [Add Response]
🕸Fergus Duniho wrote on Fri, Oct 27, 2017 05:34 PM UTC:

I presently have two functions for logging in and a script for logging in that doesn't call either function. I want to consolidate these into one function. Right now, I am adding this subject without being logged in first, because the script that handles this will use the login function, and I want to test how well it works.


🕸Fergus Duniho wrote on Fri, Oct 27, 2017 05:38 PM UTC:

Although the login function logged me in, it did not update my LastLogin time. Even though I log in everyday, my LastLogin time is 2017-09-07 00:18:04, which is over a month and a half ago.


🕸Fergus Duniho wrote on Fri, Oct 27, 2017 05:41 PM UTC:

As expected, logging in with the cvplogin.php script also did not update my LastLogin time.


🕸Fergus Duniho wrote on Fri, Oct 27, 2017 05:52 PM UTC:

By the process of elimination, I expected that logging in while making a move in Game Courier would update my LastLogin time, but it did not. Is there a fourth way of logging in that I'm missing? When I sort the Person table by LastLogin, there is one person who logged in today, and more people who logged in yesterday and earlier this week. Notably, the first person I recognize when I sort by LastLogin in descending order, is H. G. Muller, whose LastLogin value is 2017-09-18. H.G., do you remember if you did anything different on that day? Like maybe update a password or something?


H. G. Muller wrote on Fri, Oct 27, 2017 07:27 PM UTC:

H.G., do you remember if you did anything different on that day? Like maybe update a password or something?

I looked back in the comment list, and on that day I did not post any comment. But the next day I posted a request to rename my Hug-Mate submission to Paco-Shako. So it is a good guess that what I did that day was submit the Hug-Mate article, mail the link to the inventor, and got his feedback the next day, informing me that the name Hug Mate was no longer used, after I which posted that comment. Submitting the article involved all kind of logins, definitely one for each of the 48 piece images, but also for the article text, which I probably revised many times.


🕸Fergus Duniho wrote on Fri, Oct 27, 2017 08:45 PM UTC:

This is a mystery. Using grep, the only php script I could find the string "LastLogin" in was /index/loginfuncs.php, where it is used in the function save_login_time(). But using grep again, I could not find this function in any script except the one it is defined in, and it is not used in that script. It appears to be defined but never used. Yet some people are having their LastLogin times updated.


🕸Fergus Duniho wrote on Fri, Oct 27, 2017 09:06 PM UTC:

I just changed my Person information, and my LastLogin column changed to 2017-10-27 21:04:38.


🕸Fergus Duniho wrote on Fri, Oct 27, 2017 09:19 PM UTC:

Here's what's going on. Whenever a row in the Person table is updated, the LastLogin column is automatically updated to the current timestamp. This is done by MYSQL, not by PHP, which is why it happens without appearing in the PHP code. The reason it wasn't always updating is that logging in hasn't been coded to update the Person table when someone logs in. So, it has updated only when someone has done something that involves updating their information in the person table.

I am going to change this by having the login function update the new IPAddress column whenever someone logs in. My plan is to eventually offer the ability for members to find their geographical neighbors, so that people can play Chess variants in person, as David and I used to do after I noticed his email address was with my local phone company and asked if he was local.


🕸Fergus Duniho wrote on Sat, Oct 28, 2017 12:09 AM UTC:

I am writing this to login with the login function, which should now update IPAddress and by extension LastLogin.


🕸Fergus Duniho wrote on Sat, Oct 28, 2017 12:13 AM UTC:

That worked. The IPAddress field and the LastLogin field were both updated when I signed in.


🕸Fergus Duniho wrote on Sat, Oct 28, 2017 12:20 AM UTC:

I added some lines of the cvplogin script version to the login function, and I am testing that it works.


🕸Fergus Duniho wrote on Sat, Oct 28, 2017 12:33 AM UTC:

I modified the cvplogin script to use the login function, but it is not updating the LastLogin time anymore. I think this is because my IP address is not any different than it was the first time it recorded it.


🕸Fergus Duniho wrote on Sat, Oct 28, 2017 12:41 AM UTC:

I added "LastLogin=NOW()" to the UPDATE statement, and it updated the time.


🕸Fergus Duniho wrote on Sat, Oct 28, 2017 12:54 AM UTC:

I rewrote the pass_okay function to return the value of login, and it worked. I also modified login with better code from pass_okay where appropriate. So, logging in should now be handled by a single function, which is login in the loginfuncs.php file. This function combines the best code from the three previous login routines, it always updates the LastLogin time when someone logs in, and it keeps track of the last IP address used by each person who logs in.


14 comments displayed

Earlier Reverse Order Later

Permalink to the exact comments currently displayed.