projects
/
NeonServV5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
9fc84e5
)
fixed CheckAuth to take care about different timezones and sumer time changes
author
pk910
<philipp@zoelle1.de>
Sun, 25 Mar 2012 10:24:26 +0000
(12:24 +0200)
committer
pk910
<philipp@zoelle1.de>
Sun, 25 Mar 2012 10:24:26 +0000
(12:24 +0200)
src/main.c
patch
|
blob
|
history
diff --git
a/src/main.c
b/src/main.c
index 1287faf242dcba4c22148ccc945e55931ad570ea..1292a82c7c627c68e6241e80e3dab80fcaf18774 100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-429,7
+429,10
@@
static AUTHLOOKUP_CALLBACK(main_checkauths_callback) {
printf_mysql_query("SELECT `user_id`, `user_registered` FROM `users` WHERE `user_user` = '%s'", escape_string(auth));
res = mysql_use();
if ((row = mysql_fetch_row(res)) != NULL) {
printf_mysql_query("SELECT `user_id`, `user_registered` FROM `users` WHERE `user_user` = '%s'", escape_string(auth));
res = mysql_use();
if ((row = mysql_fetch_row(res)) != NULL) {
- if(!exists || (strcmp(row[1], "0") && registered != atoi(row[1]))) {
+ int diff = registered - atoi(row[1]);
+ if(diff < 0)
+ diff *= -1;
+ if(!exists || (strcmp(row[1], "0") && diff > 86400)) {
//User is no longer valid! Delete it...
deleteUser(atoi(row[0]));
char *alertchan = get_string_field("General.CheckAuths.alertchan");
//User is no longer valid! Delete it...
deleteUser(atoi(row[0]));
char *alertchan = get_string_field("General.CheckAuths.alertchan");