Exemplo n.º 1
0
/// Gets the current user.
///
/// \return The current user.
passwd_ns::user
passwd_ns::current_user(void)
{
    if (fake_current_user) {
        const user u = fake_current_user.get();
        LD(F("Current user is fake: %s") % format_user(u));
        return u;
    } else {
        const user u = find_user_by_uid(::getuid());
        LD(F("Current user is: %s") % format_user(u));
        return u;
    }
}
Exemplo n.º 2
0
/* result: build a formatted result string from the currently stored tweet */
std::string tw::Reader::result()
{
	switch (type) {
	case TWEET:
		return format_tweet(response);
	case USER:
		return format_user(response);
	default:
		return "";
	}
}