Rudiments
/home/dmuse/src/rudiments/include/rudiments/shadowentry.h
00001 // Copyright (c) 2002 David Muse
00002 // See the COPYING file for more information.
00003 
00004 #ifndef RUDIMENTS_SHADOWENTRY_H
00005 #define RUDIMENTS_SHADOWENTRY_H
00006 
00007 #include <rudiments/private/shadowentryincludes.h>
00008 
00009 #ifdef RUDIMENTS_NAMESPACE
00010 namespace rudiments {
00011 #endif
00012 
00013 class shadowentryprivate;
00014 
00017 class RUDIMENTS_DLLSPEC shadowentry {
00018         public:
00019 
00026                 static bool     getEncryptedPassword(const char *username,
00027                                                         char **password);
00028 
00034                 static bool     getLastChangeDate(const char *username,
00035                                                         long *lstchg);
00036 
00041                 static bool     getDaysBeforeChangeAllowed(
00042                                                 const char *username,
00043                                                 int32_t *min);
00044 
00049                 static bool     getDaysBeforeChangeRequired(
00050                                                 const char *username,
00051                                                 int32_t *max);
00052 
00058                 static bool     getDaysBeforeExpirationWarning(
00059                                                 const char *username,
00060                                                 int32_t *warn);
00061 
00066                 static bool     getDaysOfInactivityAllowed(
00067                                                 const char *username,
00068                                                 int32_t *inact);
00069 
00075                 static bool     getExpirationDate(const char *username,
00076                                                         int32_t *expire);
00077 
00082                 static bool     getFlag(const char *username,
00083                                                 int32_t *flag);
00084 
00086                 shadowentry();
00087 
00090                 shadowentry(const shadowentry &s);
00091 
00094                 shadowentry     &operator=(const shadowentry &s);
00095 
00097                 ~shadowentry();
00098 
00101                 bool    initialize(const char *username);
00102 
00104                 const char      *getName() const;
00105 
00107                 const char      *getEncryptedPassword() const;
00108 
00112                 long            getLastChangeDate() const;
00113 
00116                 int32_t         getDaysBeforeChangeAllowed() const;
00117 
00120                 int32_t         getDaysBeforeChangeRequired() const;
00121 
00125                 int32_t         getDaysBeforeExpirationWarning() const;
00126 
00129                 int32_t         getDaysOfInactivityAllowed() const;
00130 
00133                 int32_t         getExpirationDate() const;
00134 
00137                 int32_t         getFlag() const;
00138 
00140                 void    print() const;
00141 
00144                 static  bool    needsMutex();
00145 
00149                 static  void    setMutex(mutex *mtx);
00150 
00151         #include <rudiments/private/shadowentry.h>
00152 };
00153 
00154 #ifdef RUDIMENTS_NAMESPACE
00155 }
00156 #endif
00157 
00158 #endif