Skip to content
Snippets Groups Projects
Commit c5dbe3e4 authored by rswindell's avatar rswindell
Browse files

New @-codes:

- PWAGE - age (in days) of current user's password
- PWDAYS - maximum age (in days) before forced-password-change (or "unlimited")
- PWDATE (alias for MEMO) - date of last change of the current user's password
- AUTODEL - days of user inactivity before auto-deletion (or "unlimited")
parent ef3c7328
No related branches found
No related tags found
No related merge requests found
...@@ -338,6 +338,22 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen, long* pmode) ...@@ -338,6 +338,22 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen, long* pmode)
return str; return str;
} }
if(strcmp(sp, "PWDAYS") == 0) {
if(cfg.sys_pwdays) {
safe_snprintf(str, maxlen, "%u", cfg.sys_pwdays);
return str;
}
return text[Unlimited];
}
if(strcmp(sp, "AUTODEL") == 0) {
if(cfg.sys_autodel) {
safe_snprintf(str, maxlen, "%u", cfg.sys_autodel);
return str;
}
return text[Unlimited];
}
if(strcmp(sp, "PAGER") == 0) if(strcmp(sp, "PAGER") == 0)
return (thisnode.misc&NODE_POFF) ? text[Off] : text[On]; return (thisnode.misc&NODE_POFF) ? text[Off] : text[On];
...@@ -594,7 +610,13 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen, long* pmode) ...@@ -594,7 +610,13 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen, long* pmode)
return(str); return(str);
} }
if(!strcmp(sp,"MEMO")) if(strcmp(sp, "PWAGE") == 0) {
time_t age = time(NULL) - useron.pwmod;
safe_snprintf(str, maxlen, "%ld", (long)(age/(24*60*60)));
return str;
}
if(strcmp(sp, "PWDATE") == 0 || strcmp(sp, "MEMO") == 0)
return(unixtodstr(&cfg,useron.pwmod,str)); return(unixtodstr(&cfg,useron.pwmod,str));
if(!strcmp(sp,"SEC") || !strcmp(sp,"SECURITY")) { if(!strcmp(sp,"SEC") || !strcmp(sp,"SECURITY")) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment