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:
Ignacio R. Morelle 2011-09-01 05:53:19 +00:00
parent 29614541f9
commit 3215cb516b
2 changed files with 14 additions and 2 deletions

View file

@ -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(&reg_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"

View file

@ -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(&reg_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"