admin.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00029 #ifndef ADMIN_H
00030 #define ADMIN_H
00031 #include "../plugin.h"
00032 #include "../botkernel.h"
00033
00034 #ifndef HAVE_TINYXML
00035 #include "../tinyxml/tinyxml.h"
00036 #else
00037 #include <tinyxml.h>
00038 #endif
00039
00040 #include "postconnect.h"
00041 #include <iostream>
00042 using namespace std;
00043
00050 class Admin : public Plugin
00051 {
00052 private:
00054 TiXmlDocument * doc ;
00056 TiXmlNode* root;
00058 void initFile();
00059 public:
00061 Admin(BotKernel*);
00063 bool addChannel(string);
00065 bool delChannel(string);
00067 bool channelExists(string);
00069 vector<string> getChannelsList();
00071 bool addSuperAdmin(string);
00073 bool addTempSuperAdmin(string,unsigned int);
00075 void clearTempAdmins();
00077 bool delSuperAdmin(unsigned int);
00079 bool isSuperAdmin(string);
00081 bool maskIsSuperAdmin(string);
00083 vector<string> superAdminList();
00085 bool addUser(string,string,unsigned int);
00087 bool delUser(string,string);
00089 bool userExists(string,string);
00091 bool updateUserLevel(string,string,unsigned int);
00093 unsigned int getUserLevel(string,string);
00095 unsigned int getMaskLevel(string,string);
00097 vector<string> chanLevels(string);
00099 void enableCommand(string,string);
00101 void disableCommand(string,string);
00103 void addOnlyonCommand(string,string);
00105 void delOnlyonCommand(string,string);
00107 bool commandOK(string,string);
00109 vector<string> commandsStatus();
00110 };
00111
00112
00113 #endif
00114