Main Page | Class Hierarchy | Class List | File List | Class Members

CoreManager.h

00001 // tacppd administrators
00002 // (c) Copyright 2000-2005 by tacppd team and contributors
00003 // see http://tacppd.org for more information
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 //  You should have received a copy of the GNU General Public License
00016 //  along with this program; if not, write to the Free Software
00017 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 // all comments which start from /** - this is comments for KDoc
00020 //  for classes
00021 //    @short [short description of the class]
00022 //    @author [class author]
00023 //    @version [class version]
00024 //    @see [references to other classes or methods]
00025 //  for methods
00026 //    @see [references]
00027 //    @return [sentence describing the return value]
00028 //    @exception [list the exeptions that could be thrown]
00029 //    @param [name id] [description]    - can be multiple
00030 
00031 #ifndef __CORE_MANAGER_H__
00032 #define __CORE_MANAGER_H__
00033 
00034 #include "global.h"
00035 
00036 namespace tacpp {
00037 
00038 //
00039 // monitor users
00040 //
00041 
00047 //class User_data : public md5 {
00048 class User_data {
00051   pthread_mutex_t Mutex_;
00054   void lock();
00057   void unlock();
00060   string username_;
00063   string password_;
00066   string type_;
00069   int acl_;
00070  public:
00073   string getUsername();
00076   void setUsername(string);
00079   string getPassword();
00082   void setPassword(string);
00085   string getType();
00088   void setType(string);
00091   int getAcl();
00094   void setAcl(int);
00097   bool check(const char*);
00100   User_data(const char*,char*,int,char*);
00103   ~User_data();
00106   void create_md5_hash(unsigned char*,unsigned char*);
00107 };
00108 
00114 class CoreManager : public Core_data {
00117   list<User_data*> usr_;
00120   pthread_mutex_t Mutex_;
00123   void lock();
00126   void unlock();
00127  public:
00130   CoreManager(const string,const string);
00133   ~CoreManager();
00136   void add(const char*);
00139   void del(const char*);
00142   void modify(const char*,const char*);
00145   void modify(const char*,int);
00148   void modify2(const char*,const char*);
00151   void cmodify(const char*,const char*);
00154   bool check(const char*,const char*,const char*,const char*);
00157   string buildcfstr(int);
00160   string applycf(char * const*mask,const string cmdname,const list<string>paramList,Command * cmd=NULL)throw (CmdErr);
00161 };
00162 
00163 };
00164 
00165 #endif // __CORE_MANAGER_H__

Generated on Thu Jul 21 23:09:45 2005 for tacppd.kdevelop by doxygen 1.3.5