コード例 #1
0
std::string fuh::get_mail(const std::string& user) {
	try {
		return get_detail_for_user(user, "user_email");
	} catch (error& e) {
		ERR_UH << "Could not retrieve email for user '" << user << "' :" << e.message << std::endl;
		return "";
	}
}
コード例 #2
0
std::string fuh::get_hash(const std::string& user) {
	try {
		return get_detail_for_user(user, "user_password");
	} catch (error e) {
		ERR_UH << "Could not retrieve password for user '" << user << "' :" << e.message << std::endl;
		return time_t(0);
	}
}
コード例 #3
0
time_t fuh::get_registrationdate(const std::string& user) {
	try {
		int time_int = atoi(get_detail_for_user(user, "user_regdate").c_str());
		return time_t(time_int);
	} catch (error& e) {
		ERR_UH << "Could not retrieve registration date for user '" << user << "' :" << e.message << std::endl;
		return time_t(0);
	}
}
コード例 #4
0
bool fuh::user_is_active(const std::string& name) {
	try {
		int user_type = atoi(get_detail_for_user(name, "user_type").c_str());
		return user_type != USER_INACTIVE && user_type != USER_IGNORE;
	} catch (error& e) {
		ERR_UH << "Could not retrieve user type for user '" << name << "' :" << e.message << std::endl;
		return false;
	}
}