start only if sql server if turned on in csql.conf file
[csql.git] / include / UserManager.h
blob9e9cdb1f1b25ecd71e483b3740ddad7b7ed0aba3
1 /***************************************************************************
2 * Copyright (C) 2007 by www.databasecache.com *
3 * Contact: praba_tuty@databasecache.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 ***************************************************************************/
16 #ifndef USER_MANAGER_H
17 #define USER_MANAGER_H
18 /**
19 * @class UserManager
21 * @brief Interface for user management operations.
22 * This manages all the users in the system. Only default dba user <br/>
23 * can create and delete users in the system.<br/>
24 * If user wants to change his password, he should first get the connection and then call<br/>
25 * appropriate method in this object to change his password.<br/>
26 * <br/>
27 * Functionality: <br/>
28 * 1.Add and Delete Users<br/>
29 * 2.Change Password<br/>
30 * <br/>
34 class UserManager
36 public:
37 /** creates new User in the system.<br/>
38 * Only default dba user is allowed to call this method.
39 * @param name username to be created
40 * @param passwd password for the schema created
41 * @return int return code
43 virtual int createUser(const char *name, const char *passwd)=0;
45 /** deleted user from the system <br/>
46 * Only default dba user is allowed to call this method.
47 * @param name username to be deleted
48 * @return int return code
50 virtual int deleteUser(const char *name)=0;
52 /** changes password for self. Logged in user password is set to <br/>
53 * specified password.
54 * @param newPasswd new password to be set.
55 * @return int return code
57 virtual int changePassword(const char* newPasswd)=0;
59 /** changes the password for specified user.
60 * Only default dba user is allowed to call this method.
61 * @param username username for authentication
62 * @param password password for authentication
63 * @return int return code
65 virtual int changePassword(const char *userName, const char* newPasswd)=0;
66 virtual ~UserManager(){};
68 #endif