From f07229a9ee06bd989efd14f4223e787b90f9148e Mon Sep 17 00:00:00 2001 From: rburchell Date: Sun, 15 Feb 2009 15:21:35 +0000 Subject: Blah, blah.. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2061 5417fbe8-f217-4b02-8779-1006273d7864 --- include/account.h | 3 +++ include/opertype.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ include/services.h | 2 +- include/svsoper.h | 56 -------------------------------------------------- 4 files changed, 64 insertions(+), 57 deletions(-) create mode 100644 include/opertype.h delete mode 100644 include/svsoper.h (limited to 'include') diff --git a/include/account.h b/include/account.h index 0217753ad..ed0bcc877 100644 --- a/include/account.h +++ b/include/account.h @@ -58,6 +58,7 @@ class NickCore : public Extensible { next = prev = NULL; display = email = greet = url = NULL; + ot = NULL; pass[0] = '\0'; icq = flags = 0; language = accesscount = channelcount = 0; @@ -79,6 +80,8 @@ class NickCore : public Extensible MemoInfo memos; uint16 channelcount; /* Number of channels currently registered */ + OperType *ot; + /* Unsaved data */ time_t lastmail; /* Last time this nick record got a mail */ SList aliases; /* List of aliases */ diff --git a/include/opertype.h b/include/opertype.h new file mode 100644 index 000000000..9d5e77224 --- /dev/null +++ b/include/opertype.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2008-2009 Robin Burchell + * Copyright (C) 2008-2009 Anope Team + * + * Please read COPYING and README for further details. + * + * + * $Id$ + * + */ + +class OperType +{ + private: + /** The name of this opertype, e.g. "sra". + */ + std::string name; + + /** Privs that this opertype may use, e.g. 'users/auspex'. + * This *must* be std::list, see commands comment for details. + */ + std::list privs; + + /** Commands this user may execute, e.g: + * botserv/set/ *, botserv/set/private, botserv/ * + * et cetera. + * + * This *must* be std::list, not std::map, because + * we support full globbing here. This shouldn't be a problem + * as we don't invoke it often. + */ + std::list commands; + public: + /** Create a new opertype of the given name. + * @param nname The opertype name, e.g. "sra". + */ + OperType(const std::string &nname); + + /** Check whether this opertype has access to run the given command string. + * @param cmdstr The string to check, e.g. botserv/set/private. + * @return True if this opertype may run the specified command, false otherwise. + */ + bool HasCommand(const std::string &cmdstr); + + /** Check whether this opertype has access to the given special permission. + * @param privstr The priv to check for, e.g. users/auspex. + * @return True if this opertype has the specified priv, false otherwise. + */ + bool HasPriv(const std::string &privstr); + + /** Add the specified command to this opertype. + * @param cmdstr The command mask to grant this opertype access to, e.g: nickserv/ *, chanserv/set/ *, botserv/set/private. + */ + void AddCommand(const std::string &cmdstr); + + /** Add the specified priv mask to this opertype. + * @param privstr The specified mask of privs to grant this opertype access to, e.g. users/auspex, users/ *, etc. + */ + void AddPriv(const std::string &privstr); +}; diff --git a/include/services.h b/include/services.h index 552688411..6f7353111 100644 --- a/include/services.h +++ b/include/services.h @@ -433,7 +433,7 @@ typedef struct csmodeutil_ CSModeUtil; typedef struct session_ Session; #include "bots.h" -#include "svsoper.h" +#include "opertype.h" /*************************************************************************/ diff --git a/include/svsoper.h b/include/svsoper.h deleted file mode 100644 index bf5c5c486..000000000 --- a/include/svsoper.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2008-2009 Robin Burchell - * Copyright (C) 2008-2009 Anope Team - * - * Please read COPYING and README for further details. - * - * - * $Id$ - * - */ - -class SVSOper -{ - private: - /** The name of this opertype, e.g. "sra". - */ - std::string name; - - /** Privs that this opertype may use, e.g. 'users/auspex'. - * This *must* be std::list, see commands comment for details. - */ - std::list privs; - - /** Commands this user may execute, e.g: - * botserv/set/ *, botserv/set/private, botserv/ * - * et cetera. - * - * This *must* be std::list, not std::map, because - * we support full globbing here. This shouldn't be a problem - * as we don't invoke it often. - */ - std::list commands; - public: - - /** Check whether this opertype has access to run the given command string. - * @param cmdstr The string to check, e.g. botserv/set/private. - * @return True if this opertype may run the specified command, false otherwise. - */ - bool HasCommand(const std::string &cmdstr); - - /** Check whether this opertype has access to the given special permission. - * @param privstr The priv to check for, e.g. users/auspex. - * @return True if this opertype has the specified priv, false otherwise. - */ - bool HasPriv(const std::string &privstr); - - /** Add the specified command to this opertype. - * @param cmdstr The command mask to grant this opertype access to, e.g: nickserv/ *, chanserv/set/ *, botserv/set/private. - */ - void AddCommand(const std::string &cmdstr); - - /** Add the specified priv mask to this opertype. - * @param privstr The specified mask of privs to grant this opertype access to, e.g. users/auspex, users/ *, etc. - */ - void AddPriv(const std::string &privstr); -}; -- cgit