00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef DBADMIN_H
00015 #define DBADMIN_H
00016
00017 #include <opt.h>
00018 #include <openssl/md5.h>
00019 #include <arpa/inet.h>
00020
00021
00022 #include "global.h"
00023
00024 #include "Exception.h"
00025 #include "Logger.h"
00026
00027 #include "DdtManager.h"
00028 #include "Validate.h"
00029
00030 #define CONF_FILE "cgi.conf"
00031
00032 class DbAdmin
00033 {
00034 public:
00035
00036
00037 DbAdmin(Logger *, char *, char *, char *, char *, char *, char *);
00038
00039
00040 ~DbAdmin();
00041
00042
00043
00044
00045 int checkPasswd(int id, char *aPass, char *aPassMd5);
00046
00047
00048 int hashPassword(const char *Pass, const char *PassConfirm,
00049 char *PassMd5);
00050
00051
00052
00053
00054
00055
00056 int dumpInfo(int id);
00057
00058
00059
00060
00061
00062
00063 bool addAccount(userAccount *newAccount, const char *baseDomain);
00064
00065
00066 bool updateAccount(userAccount *newAccount, const char *baseDomain);
00067
00068
00069 int removeAccount(int id);
00070
00071
00072 int addDnsRecord(int id, const char *dname, DnsRecordType type,
00073 const char *data, const char *baseDomain);
00074
00075 int delDnsRecord(int id, const char *dname, DnsRecordType type,
00076 const char *data);
00077
00078
00079 bool getAcctInfo(int id, userAccount *account);
00080
00081
00082
00083 private:
00084 Logger *log;
00085 Db *db;
00086 Dns *dns;
00087 DdtManager *manager;
00088 Validate *check;
00089
00090
00091 };
00092
00093
00094 #endif // DBADMIN_H