TekUser.cpp

00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Kevin McBride                                   *
00003  *   kevin@planetsaphire.com                                               *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Library General Public License as       *
00007  *   published by the Free Software Foundation; either version 2 of the    *
00008  *   License, or (at your option) any later version.                       *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU Library General Public     *
00016  *   License along with this program; if not, write to the                 *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #define LIBTEKLTI_EXPORT
00022 
00023 #ifndef _cplusplus
00024 #define _cplusplus
00025 #endif /* _cplusplus */
00026 
00027 #include "teklti.h"
00028 #include "tekuserunixrw.h"
00029 
00030 
00031 MKTEKUUID(UTekUser, "061B46F4-3D58-11DA-9D30-000BDBC434D9")
00032 MKTEKDEBUGSTRING(DBTekUser, "DBTekUser")
00033 
00034 
00035 /*class TekUserUnixRW : public TekUser
00036 {
00037 public:
00038   TekUserUnixRW();
00039   ~TekUserUnixRW();
00040 
00041   virtual TEKERR put_TekUserInfo(struct TekUserInfo * SUInfo);
00042 
00043   virtual TEKERR get_Description(uchar_t** RetVal);
00044   virtual TEKERR get_GroupID(gid_t* RetVal);
00045   virtual TEKERR get_HomeDir(uchar_t** RetVal);
00046   virtual TEKERR get_UserID(uid_t* RetVal);
00047   virtual TEKERR get_Username(uchar_t** RetVal);
00048   virtual TEKERR put_Description(const uchar_t* NewDescription);
00049   virtual TEKERR put_GroupID(gid_t NewGroupID);
00050   virtual TEKERR put_HomeDir(const uchar_t* NewHomeDir);
00051   virtual TEKERR put_Password(uchar_t* NewPassword);
00052   virtual TEKERR put_UserID(uid_t NewID);
00053   virtual TEKERR put_Username(const uchar_t* NewUsername);
00054   virtual TEKERR Save();
00055 
00056 private:
00057     struct TekUserInfo Priv_UserInfo;
00058 };*/
00059 
00060 
00061 TEKERR TekUserInfoCreate(
00062       struct TekUserInfo * UserInfo,
00063       TekUser ** RetVal,
00064       TekUserType UserType
00065 )
00066 {
00067       TekUser * NewVal;
00068       TEKERR terr;
00069 
00070 #ifndef     NO_SIZE_T_CHECKS
00071       if ( RetVal == NULL )
00072             return TEKERR_POINTER;
00073 #endif      /* NO_SIZE_T_CHECKS */
00074 
00075 #ifdef      _WINDOWS
00076       return TEKERR_NOTIMPL;
00077 #else /* not _WINDOWS */
00078       switch ( UserType )
00079       {
00080             case TekUserType_Any:
00081             case TekUserType_POSIX:
00082             case TekUserType_Linux:
00083                   /* Create a new TekUserUnix instance. */
00084                   NewVal = new TekUserUnixRW;
00085                   terr = NewVal->put_TekUserInfo(UserInfo);
00086 
00087                   /* Set the retval. */
00088                   *RetVal = NewVal;
00089 
00090                   /* We're done. */
00091                   break;
00092             case TekUserType_POSIX_RO:
00093             case TekUserType_Linux_RO:
00094 #ifndef     NO_SIZE_T_CHECKS
00095                   if ( UserInfo == NULL )
00096                         return TEKERR_POINTER;
00097 #endif      /* NO_SIZE_T_CHECKS */
00098                   /* Create a new TekUserUnix instance. */
00099                   NewVal = new TekUserUnixRO;
00100                   terr = NewVal->put_TekUserInfo(UserInfo);
00101 
00102                   /* Set the retval. */
00103                   *RetVal = NewVal;
00104 
00105                   /* We're done. */
00106                   break;
00107             case TekUserType_Windows:
00108             default:
00109                   return TEKERR_UNAVAILABLE;
00110       }
00111 #endif      /* not _WINDOWS */
00112 
00113       return TEKERR_OK;
00114 }
00115 
00116 
00117 #ifdef      NULL
00118 #undef      NULL
00119 #endif      /* NULL */
00120 #define     NULL  (0)
00121 
00122 
00126 TekUser::TekUser()
00127 {
00128       ;
00129 }
00130 
00134 TekUser::~TekUser()
00135 {
00136       ;
00137 }
00138 
00139 
00140 
00141 #if   NULL != 0
00142 
00147 TEKERR TekUser::put_TekUserInfo(struct TekUserInfo * SUInfo)
00148 {
00149       return TEKERR_NOTIMPL;
00150 }
00151 
00157 TEKERR TekUser::put_Description(const uchar_t * NewDescription)
00158 {
00159       return TEKERR_NOTIMPL;
00160 }
00161 
00167 TEKERR TekUser::get_Description(uchar_t ** RetVal)
00168 {
00169       return TEKERR_NOTIMPL;
00170 }
00171 
00177 TEKERR TekUser::get_GroupID(gid_t * RetVal)
00178 {
00179       return TEKERR_NOTIMPL;
00180 }
00181 
00187 TEKERR TekUser::get_HomeDir(uchar_t ** RetVal)
00188 {
00189       return TEKERR_NOTIMPL;
00190 }
00191 
00197 TEKERR TekUser::get_UserID(uid_t * RetVal)
00198 {
00199       return TEKERR_NOTIMPL;
00200 }
00201 
00207 TEKERR TekUser::get_Username(uchar_t ** RetVal)
00208 {
00209       return TEKERR_NOTIMPL;
00210 }
00211 
00217 TEKERR TekUser::put_GroupID(gid_t NewGroupID)
00218 {
00219       return TEKERR_NOTIMPL;
00220 }
00221 
00227 TEKERR TekUser::put_HomeDir(const uchar_t * NewHomeDir)
00228 {
00229       return TEKERR_NOTIMPL;
00230 }
00231 
00237 TEKERR TekUser::put_Password(uchar_t * NewPassword)
00238 {
00239       return TEKERR_NOTIMPL;
00240 }
00241 
00249 TEKERR TekUser::put_UserID(uid_t NewID)
00250 {
00251       return TEKERR_NOTIMPL;
00252 }
00253 
00259 TEKERR TekUser::put_Username(const uchar_t * NewUsername)
00260 {
00261       return TEKERR_NOTIMPL;
00262 }
00263 
00269 TEKERR TekUser::Save()
00270 {
00271       return TEKERR_NOTIMPL;
00272 }
00273 
00274 #endif      /* NULL != 0 */
00275 
SourceForge.net Logo  Technical Library Template Interface Project Page