3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "support/userinfo.h"
14 #include "support/environment.h"
16 #include <boost/assert.hpp>
28 #ifdef HAVE_SYS_TYPES_H
29 # include <sys/types.h>
37 docstring const user_name()
42 DWORD size = UNLEN + 1;
43 if (!GetUserName(name, &size))
44 return _("Unknown user");
45 return from_local8bit(name);
47 struct passwd * pw(getpwuid(geteuid()));
50 string name = pw->pw_gecos;
53 return from_local8bit(name);
58 docstring const user_email()
60 string email = getEnv("EMAIL_ADDRESS");
62 email = getEnv("EMAIL");
63 return from_local8bit(email);
66 } // namespace support