wesnothd: Make forum and sample user handlers print "Never"
rather than the Unix epoch for users who've never logged in after registration
This commit is contained in:
parent
29614541f9
commit
3215cb516b
2 changed files with 14 additions and 2 deletions
|
@ -173,7 +173,13 @@ std::string fuh::user_info(const std::string& name) {
|
|||
time_t ll_date = get_lastlogin(name);
|
||||
|
||||
std::string reg_string = ctime(®_date);
|
||||
std::string ll_string = ctime(&ll_date);
|
||||
std::string ll_string;
|
||||
|
||||
if(ll_date) {
|
||||
ll_string = ctime(&ll_date);
|
||||
} else {
|
||||
ll_string = "Never";
|
||||
}
|
||||
|
||||
std::stringstream info;
|
||||
info << "Name: " << name << "\n"
|
||||
|
|
|
@ -222,7 +222,13 @@ std::string suh::user_info(const std::string& name) {
|
|||
time_t ll_date = get_lastlogin(name);
|
||||
|
||||
std::string reg_string = ctime(®_date);
|
||||
std::string ll_string = ctime(&ll_date);
|
||||
std::string ll_string;
|
||||
|
||||
if(ll_date) {
|
||||
ll_string = ctime(&ll_date);
|
||||
} else {
|
||||
ll_string = "Never";
|
||||
}
|
||||
|
||||
std::stringstream info;
|
||||
info << "Name: " << name << "\n"
|
||||
|
|
Loading…
Add table
Reference in a new issue