From d2b289e3eb3a3c6dd71caa4d51e4f4f7d6028cf7 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Thu, 11 Dec 2014 04:11:54 +0000
Subject: [PATCH] As theorized by Digital Man, the HTTP server did indeed have
 the same bug as the FTP server.

Bug-fix: daily statistics and free-credits-per-day were not reset when the user
logged in via HTTP. This affected: posts_today, emails_today, free_credits,
timeon_today, and extra time values (e.g. posts_today would contnue to
accumulate potentially affecting uh... hand-wavey stuff). getuserdat() does the
necessary value resets, we just needed to write the entire user record back to
disk upon successfull login, rather than just updating specific fields in the
user record on disk.
---
 src/sbbs3/websrvr.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/sbbs3/websrvr.c b/src/sbbs3/websrvr.c
index 84e1b6f23a..d500cbb3b9 100644
--- a/src/sbbs3/websrvr.c
+++ b/src/sbbs3/websrvr.c
@@ -1381,10 +1381,11 @@ void http_logon(http_session_t * session, user_t *usr)
 	else {
 		SAFECOPY(session->username,session->user.alias);
 		/* Adjust Connect and host */
-		putuserrec(&scfg,session->user.number,U_MODEM,LEN_MODEM,"HTTP");
-		putuserrec(&scfg,session->user.number,U_COMP,LEN_COMP,session->host_name);
-		putuserrec(&scfg,session->user.number,U_NOTE,LEN_NOTE,session->host_ip);
-		putuserrec(&scfg,session->user.number,U_LOGONTIME,0,ultoa((ulong)session->logon_time,str,16));
+		SAFECOPY(session->user.modem, session->is_tls?"HTTPS":"HTTP");
+		SAFECOPY(session->user.comp, session->host_name);
+		SAFECOPY(session->user.note, session->host_ip);
+		session->user.logontime = session->logon_time;
+		putuserdat(&scfg, &session->user);
 	}
 	session->client.user=session->username;
 	client_on(session->socket, &session->client, /* update existing client record? */TRUE);
-- 
GitLab