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 //FIXME: quick fix wrt bug #3764; only Anonymous is detected now.
61 //The code after should be used only after user approval.
65 string email = getEnv("EMAIL_ADDRESS");
67 email = getEnv("EMAIL");
68 return from_local8bit(email);
71 } // namespace support