00001 /*************************************************************************** 00002 * Copyright (C) 2007 by www.databasecache.com * 00003 * Contact: praba_tuty@databasecache.com * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (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 ***************************************************************************/ 00016 #ifndef USER_MANAGER_IMPL_H 00017 #define USER_MANAGER_IMPL_H 00018 #include<UserManager.h> 00019 #include<os.h> 00020 00021 class Database; 00022 class UserManagerImpl: public UserManager 00023 { 00024 private: 00025 bool isDba; 00026 char userName[IDENTIFIER_LENGTH]; 00027 Database *systemDatabase_; 00028 00029 public: 00030 00031 UserManagerImpl(){} 00032 ~UserManagerImpl(){} 00033 00034 void setSysDb(Database *db) { systemDatabase_ = db; } 00035 void setDba(bool flag) { isDba = flag; } 00036 void setUserName(const char *name){ strcpy( userName, name); } 00037 int createUser(const char *name, const char *passwd); 00038 00039 int deleteUser(const char *name); 00040 00041 int changePassword(const char* newPasswd); 00042 00043 int changePassword(const char *userName, const char* newPasswd); 00044 00045 }; 00046 00047 00048 #endif