]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/nickserv.h
Couple of srvx updates.
[irc/evilnet/x3.git] / src / nickserv.h
index bd83a64625e47129f9289f5480c894e1334a581e..490382af4a3eb6df6690f9c8a31ee1504b01e234 100644 (file)
@@ -22,6 +22,7 @@
 #define _nickserv_h
 
 #include "hash.h"   /* for NICKLEN, etc., and common.h */
+#include "dict.h"
 #include <tre/regex.h> /* for regex in nickserv_config */
 struct svccmd;
 
@@ -83,22 +84,19 @@ struct handle_cookie {
 };
 
 struct handle_note {
-    struct handle_note *next;
-    time_t expires;
-    time_t set;
-    int id;
-    char setter[NICKSERV_HANDLE_LEN+1];
-    char note[1];
+    char            setter[NICKSERV_HANDLE_LEN+1];
+    time_t          date;
+    char            note[1];
 };
 
 struct handle_info {
     struct nick_info *nicks;
     struct string_list *masks;
+    struct string_list *sslfps;
     struct string_list *ignores;
     struct userNode *users;
     struct userData *channels;
     struct handle_cookie *cookie;
-    struct handle_note *notes;
     struct handle_note *note;
     struct language *language;
     char *email_addr;
@@ -114,6 +112,7 @@ struct handle_info {
     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];
@@ -186,6 +185,8 @@ struct nickserv_config {
     unsigned long ounregister_flags;
     const char *auto_oper;
     const char *auto_admin;
+    const char *auto_oper_privs;
+    const char *auto_admin_privs;
     char default_style;
     struct string_list *denied_fakehost_words;
     unsigned int force_handles_lowercase;
@@ -202,8 +203,10 @@ struct nickserv_config {
     const char *ldap_field_account;
     const char *ldap_field_password;
     const char *ldap_field_email;
+    const char *ldap_field_oslevel;
     struct string_list *ldap_object_classes;
     const char *ldap_oper_group_dn;
+    unsigned int ldap_oper_group_level;
     const char *ldap_field_group_member;
     unsigned int ldap_timeout;
 #endif
@@ -213,49 +216,51 @@ void init_nickserv(const char *nick);
 struct handle_info *get_handle_info(const char *handle);
 struct handle_info *smart_get_handle_info(struct userNode *service, struct userNode *user, const char *name);
 int oper_try_set_access(struct userNode *user, struct userNode *bot, struct handle_info *target, unsigned int new_level);
-int oper_outranks(struct svccmd *cmd, struct userNode *user, struct handle_info *hi);
+int oper_outranks(struct userNode *user, struct handle_info *hi);
 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);
 void nickserv_show_oper_accounts(struct userNode *user, struct svccmd *cmd);
 
-struct handle_info *get_victim_oper(struct svccmd *cmd, struct userNode *user, const char *target);
-struct handle_info *loc_auth(char *handle, char *password);
+struct handle_info *get_victim_oper(struct userNode *user, const char *target);
+struct handle_info *loc_auth(char *sslfp, char *handle, char *password, char *userhost);
 
-typedef void (*user_mode_func_t)(struct userNode *user, const char *mode_change);
-void reg_user_mode_func(user_mode_func_t func);
-typedef void (*channel_mode_func_t)(struct userNode *who, struct chanNode *channel, char **mode, unsigned int argc);
-void reg_channel_mode_func(channel_mode_func_t func);
+typedef void (*user_mode_func_t)(struct userNode *user, const char *mode_change, void *extra);
+void reg_user_mode_func(user_mode_func_t func, void *extra);
+typedef void (*channel_mode_func_t)(struct userNode *who, struct chanNode *channel, char **mode, unsigned int argc, void *extra);
+void reg_channel_mode_func(channel_mode_func_t func, void *extra);
 
 /* auth_funcs are called when a user gets a new handle_info.  They are
  * called *after* user->handle_info has been updated.  */
-typedef void (*auth_func_t)(struct userNode *user, struct handle_info *old_handle);
-void reg_auth_func(auth_func_t func);
+typedef void (*auth_func_t)(struct userNode *user, struct handle_info *old_handle, void *extra);
+void reg_auth_func(auth_func_t func, void *extra);
 
 /* Called just after a handle is renamed. */
-typedef void (*handle_rename_func_t)(struct handle_info *handle, const char *old_handle);
-void reg_handle_rename_func(handle_rename_func_t func);
+typedef void (*handle_rename_func_t)(struct handle_info *handle, const char *old_handle, void *extra);
+void reg_handle_rename_func(handle_rename_func_t func, void *extra);
 
 /* unreg_funcs are called right before a handle is unregistered.
  * `user' is the person who caused the handle to be unregistered (either a
  * client authed to the handle, or an oper). */
-typedef void (*unreg_func_t)(struct userNode *user, struct handle_info *handle);
-void reg_unreg_func(unreg_func_t func);
+typedef void (*unreg_func_t)(struct userNode *user, struct handle_info *handle, void *extra);
+void reg_unreg_func(unreg_func_t func, void *extra);
 
 /* Called just before a handle is merged */
-typedef void (*handle_merge_func_t)(struct userNode *user, struct handle_info *handle_to, struct handle_info *handle_from);
-void reg_handle_merge_func(handle_merge_func_t);
+typedef void (*handle_merge_func_t)(struct userNode *user, struct handle_info *handle_to, struct handle_info *handle_from, void *extra);
+void reg_handle_merge_func(handle_merge_func_t, void *extra);
 
 /* Called after an allowauth. handle is null if allowauth authorization was
  * removed */
-typedef void (*allowauth_func_t)(struct userNode *user, struct userNode *target, struct handle_info *handle);
-void reg_allowauth_func(allowauth_func_t func);
+typedef void (*allowauth_func_t)(struct userNode *user, struct userNode *target, struct handle_info *handle, void *extra);
+void reg_allowauth_func(allowauth_func_t func, void *extra);
 
 /* Called when an auth attempt fails because of a bad password */
-typedef void (*failpw_func_t)(struct userNode *user, struct handle_info *handle);
-void reg_failpw_func(failpw_func_t func);
+typedef void (*failpw_func_t)(struct userNode *user, struct handle_info *handle, void *extra);
+void reg_failpw_func(failpw_func_t func, void *extra);
 
 void send_func_list(struct userNode *user);
 
+extern dict_t nickserv_handle_dict;
+
 #endif