added status "network"
[srvx.git] / src / nickserv.h
index 0a5862bb8bead350e5a8fd40fde1648135f82a6c..322170e2825422abdfb1b805b17a7df2a0548c67 100644 (file)
@@ -1,11 +1,12 @@
 /* nickserv.h - Nick/authentiction service
  * Copyright 2000-2004 srvx Development Team
  *
- * This program is free software; you can redistribute it and/or modify
+ * This file is part of srvx.
+ *
+ * srvx is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.  Important limitations are
- * listed in the COPYING file that accompanies this software.
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -13,7 +14,8 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, email srvx-maintainers@srvx.net.
+ * along with srvx; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 
 #ifndef _nickserv_h
@@ -36,12 +38,17 @@ struct svccmd;
 #define HI_FLAG_NODELETE       0x00000080
 #define HI_FLAG_NETWORK_HELPER 0x00000100
 #define HI_FLAG_BOT            0x00000200
+#define HI_FLAG_AUTOHIDE       0x00000400
+#define HI_FLAG_INVI           0x00000800
+#define HI_FLAG_OPER           0x00001000
+#define HI_FLAG_NETWORK        0x00002000
+
 /* Flag characters for the above.  First char is LSB, etc. */
-#define HANDLE_FLAGS "SphgscfnHb"
+#define HANDLE_FLAGS "SphgscfnHbxIoN"
 
 /* HI_STYLE_* go into handle_info.userlist_style */
-#define HI_STYLE_DEF          'd'
-#define HI_STYLE_ZOOT         'Z'
+#define HI_STYLE_DEF    'd'
+#define HI_STYLE_ZOOT   'Z'
 
 #define HI_DEFAULT_FLAGS       (HI_FLAG_MIRC_COLOR)
 #define HI_DEFAULT_STYLE       HI_STYLE_DEF
@@ -57,6 +64,7 @@ struct svccmd;
 #define IsHelping(user) (user->handle_info && HANDLE_FLAGGED(user->handle_info, HELPING))
 #define IsStaff(user) (IsOper(user) || IsSupportHelper(user) || IsNetworkHelper(user))
 #define IsBot(user) (user->handle_info && HANDLE_FLAGGED(user->handle_info, BOT))
+#define IsInvi(user) (user->handle_info && HANDLE_FLAGGED(user->handle_info, INVI))
 
 enum cookie_type {
     ACTIVATION,
@@ -69,32 +77,55 @@ struct handle_cookie {
     struct handle_info *hi;
     char *data;
     enum cookie_type type;
-    time_t expires;
+    unsigned long expires;
     char cookie[COOKIELEN+1];
 };
 
+struct handle_note {
+    struct handle_note *next;
+    unsigned long expires;
+    unsigned long set;
+    int id;
+    char setter[NICKSERV_HANDLE_LEN+1];
+    char note[1];
+};
+
+struct authlogEntry {
+    unsigned long login_time;
+    unsigned long logout_time;
+    const char *hostmask;
+    const char *quit_reason;
+    struct userNode *user;
+    struct authlogEntry *next;
+};
+
 struct handle_info {
     struct nick_info *nicks;
     struct string_list *masks;
     struct userNode *users;
     struct userData *channels;
     struct handle_cookie *cookie;
+    struct handle_note *notes;
     struct language *language;
+    struct authlogEntry *authlog;
+    char *website;
+    char *devnull;
     char *email_addr;
     char *epithet;
     char *infoline;
     char *handle;
-#ifdef WITH_PROTOCOL_BAHAMUT
+    char *fakehost;
+    char *fakeident;
     unsigned long id;
-#endif
-    time_t registered;
-    time_t lastseen;
+    unsigned long registered;
+    unsigned long lastseen;
+    int karma;
     unsigned short flags;
     unsigned short opserv_level;
+    unsigned short staff_level;
     unsigned short screen_width;
     unsigned short table_width;
     unsigned char userlist_style;
-    unsigned char announcements;
     unsigned char maxlogins;
     char passwd[MD5_CRYPT_LENGTH+1];
     char last_quit_host[USERLEN+HOSTLEN+2];
@@ -123,7 +154,15 @@ struct nick_info *get_nick_info(const char *nick);
 struct modeNode *find_handle_in_channel(struct chanNode *channel, struct handle_info *handle, struct userNode *except);
 int nickserv_modify_handle_flags(struct userNode *user, struct userNode *bot, const char *str, unsigned long *add, unsigned long *remove);
 int oper_has_access(struct userNode *user, struct userNode *bot, unsigned int min_level, unsigned int quiet);
+int staff_has_access(struct userNode *user, struct userNode *bot, unsigned int min_level, unsigned int quiet);
 void nickserv_show_oper_accounts(struct userNode *user, struct svccmd *cmd);
+struct handle_info *checklogin(const char *user, const char *pass, const char *numeric, const char *hostmask, const char *ipmask);
+char *getfakehost(const char *user);
+void nickserv_devnull_delete(char *name);
+void nickserv_devnull_rename(char *oldname, char *newname);
+char *generate_fakehost(struct handle_info *handle);
+char *generate_fakeident(struct handle_info *handle, struct userNode *user);
+void apply_fakehost(struct handle_info *handle, struct userNode *user);
 
 /* auth_funcs are called when a user gets a new handle_info.  They are
  * called *after* user->handle_info has been updated.  */