Rudiments
userentry.h
1 // Copyright (c) 2002-2014 David Muse
2 // See the COPYING file for more information.
3 
4 #ifndef RUDIMENTS_USERENTRY_H
5 #define RUDIMENTS_USERENTRY_H
6 
7 #include <rudiments/private/userentryincludes.h>
8 
9 class userentryprivate;
10 
13 class RUDIMENTS_DLLSPEC userentry {
14  public:
15 
17  userentry();
18 
21  userentry(const userentry &u);
22 
25  userentry &operator=(const userentry &u);
26 
28  ~userentry();
29 
32  bool initialize(const char *username);
33 
36  bool initialize(uid_t userid);
37 
39  const char *getName() const;
40 
42  const char *getPassword() const;
43 
54  uid_t getUserId() const;
55 
63  const char *getSid() const;
64 
66  gid_t getPrimaryGroupId() const;
67 
69  const char *getRealName() const;
70 
72  const char *getHomeDirectory() const;
73 
75  const char *getShell() const;
76 
78  const char *getEncryptedPassword() const;
79 
83  long getLastChangeDate() const;
84 
87  int32_t getDaysBeforeChangeAllowed() const;
88 
91  int32_t getDaysBeforeChangeRequired() const;
92 
95  int32_t getDaysBeforeExpirationWarning() const;
96 
99  int32_t getDaysOfInactivityAllowed() const;
100 
103  int32_t getExpirationDate() const;
104 
106  int32_t getFlag() const;
107 
108 
117  static char *getName(uid_t userid);
118 
125  static uid_t getUserId(const char *username);
126 
136  static char *getSid(const char *username);
137 
143  static bool platformSupportsFormalSid();
144 
147  static bool needsMutex();
148 
152  static void setMutex(threadmutex *mtx);
153 
154  #include <rudiments/private/userentry.h>
155 };
156 
157 #endif
Definition: threadmutex.h:13
Definition: userentry.h:13