Skip to content
Snippets Groups Projects
Commit 206134e2 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Use new C++ wrapper for unixtodstr()

Fix new date editing bug in user editor: we must use the numeric format
for dates when creating strings to be edited.
parent b5caa291
No related branches found
No related tags found
No related merge requests found
Pipeline #6977 passed
...@@ -143,8 +143,8 @@ void sbbs_t::nodesync(bool clearline) ...@@ -143,8 +143,8 @@ void sbbs_t::nodesync(bool clearline)
if(!(sys_status&SS_NEWDAY)) { if(!(sys_status&SS_NEWDAY)) {
now=time(NULL); now=time(NULL);
unixtodstr(&cfg,(time32_t)logontime,str); unixtodstr(logontime,str);
unixtodstr(&cfg,(time32_t)now,today); unixtodstr(now,today);
if(strcmp(str,today)) { /* New day, clear "today" user vars */ if(strcmp(str,today)) { /* New day, clear "today" user vars */
sys_status|=SS_NEWDAY; // So we don't keep doing this over&over sys_status|=SS_NEWDAY; // So we don't keep doing this over&over
resetdailyuserdat(&cfg, &useron,/* write: */true); resetdailyuserdat(&cfg, &useron,/* write: */true);
......
...@@ -187,7 +187,7 @@ void sbbs_t::update_qwkroute(char *via) ...@@ -187,7 +187,7 @@ void sbbs_t::update_qwkroute(char *via)
for(i=0;i<total_qwknodes;i++) for(i=0;i<total_qwknodes;i++)
if(qwknode[i].time>t) if(qwknode[i].time>t)
fprintf(stream,"%s %s:%s\r\n" fprintf(stream,"%s %s:%s\r\n"
,unixtodstr(&cfg,(time32_t)qwknode[i].time,str),qwknode[i].id,qwknode[i].path); ,unixtodstr(qwknode[i].time,str),qwknode[i].id,qwknode[i].path);
fclose(stream); fclose(stream);
} }
else else
......
...@@ -73,8 +73,8 @@ void sbbs_t::useredit(int usernumber) ...@@ -73,8 +73,8 @@ void sbbs_t::useredit(int usernumber)
return; return;
} }
} }
unixtodstr(&cfg,time32(NULL),str); unixtodstr(time(NULL),str);
unixtodstr(&cfg,user.laston,tmp); unixtodstr(user.laston,tmp);
if(strcmp(str,tmp) && user.ltoday) { if(strcmp(str,tmp) && user.ltoday) {
user.ltoday=user.ttoday=user.ptoday=user.etoday=user.textra=0; user.ltoday=user.ttoday=user.ptoday=user.etoday=user.textra=0;
user.freecdt=cfg.level_freecdtperday[user.level]; user.freecdt=cfg.level_freecdtperday[user.level];
...@@ -341,28 +341,28 @@ void sbbs_t::useredit(int usernumber) ...@@ -341,28 +341,28 @@ void sbbs_t::useredit(int usernumber)
break; break;
case 'K': /* date changes */ case 'K': /* date changes */
bputs(text[UeditLastOn]); bputs(text[UeditLastOn]);
datestr(user.laston,str); unixtodstr(user.laston,str);
gettmplt(str, date_template(&cfg, tmp, sizeof tmp),K_LINE|K_EDIT); gettmplt(str, date_template(&cfg, tmp, sizeof tmp),K_LINE|K_EDIT);
if(sys_status&SS_ABORT) if(sys_status&SS_ABORT)
break; break;
user.laston=dstrtounix(&cfg,str); user.laston=dstrtounix(&cfg,str);
putuserdatetime(user.number, USER_LASTON, user.laston); putuserdatetime(user.number, USER_LASTON, user.laston);
bputs(text[UeditFirstOn]); bputs(text[UeditFirstOn]);
datestr(user.firston,str); unixtodstr(user.firston,str);
gettmplt(str, date_template(&cfg, tmp, sizeof tmp),K_LINE|K_EDIT); gettmplt(str, date_template(&cfg, tmp, sizeof tmp),K_LINE|K_EDIT);
if(sys_status&SS_ABORT) if(sys_status&SS_ABORT)
break; break;
user.firston=dstrtounix(&cfg,str); user.firston=dstrtounix(&cfg,str);
putuserdatetime(user.number, USER_FIRSTON, user.firston); putuserdatetime(user.number, USER_FIRSTON, user.firston);
bputs(text[UeditExpire]); bputs(text[UeditExpire]);
datestr(user.expire,str); unixtodstr(user.expire,str);
gettmplt(str, date_template(&cfg, tmp, sizeof tmp),K_LINE|K_EDIT); gettmplt(str, date_template(&cfg, tmp, sizeof tmp),K_LINE|K_EDIT);
if(sys_status&SS_ABORT) if(sys_status&SS_ABORT)
break; break;
user.expire=dstrtounix(&cfg,str); user.expire=dstrtounix(&cfg,str);
putuserdatetime(user.number, USER_EXPIRE, user.expire); putuserdatetime(user.number, USER_EXPIRE, user.expire);
bputs(text[UeditPwModDate]); bputs(text[UeditPwModDate]);
datestr(user.pwmod,str); unixtodstr(user.pwmod,str);
gettmplt(str, date_template(&cfg, tmp, sizeof tmp),K_LINE|K_EDIT); gettmplt(str, date_template(&cfg, tmp, sizeof tmp),K_LINE|K_EDIT);
if(sys_status&SS_ABORT) if(sys_status&SS_ABORT)
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment