/***********************************************************************
X3 ChangeLog
+2005-08-11 Alex Schumann <rubin@afternet.org>
+
+ * src/proto-p10.c: added irc_umode() to send usermodes (Life4Christ)
+
+ * src/proto-bahumit.c: added irc_umode() to send usermodes, untested..
+
+ * src/proto.h: added irc_umode() to send usermodes (Life4Christ)
+
+ * src/nickserv.c: Added option to have authserv oper/admin people with
+ opserv access. (Life4Christ)
+
+ * src/opserv.c: Added admin_level config option
+
+ * src/opserv.h: Added admin_level config option
+
2005-08-11 Alex Schumann <rubin@afternet.org>
* src/proto-p10.c: Avoid duplicating an oper in curr_opers (,staff
#define KEY_SET_TITLE_LEVEL "set_title_level"
#define KEY_SET_FAKEHOST_LEVEL "set_fakehost_level"
#define KEY_TITLEHOST_SUFFIX "titlehost_suffix"
+#define KEY_AUTO_OPER "auto_oper"
+#define KEY_AUTO_ADMIN "auto_admin"
#define KEY_FLAG_LEVELS "flag_levels"
#define KEY_HANDLE_EXPIRE_FREQ "handle_expire_freq"
#define KEY_ACCOUNT_EXPIRE_FREQ "account_expire_freq"
{ "NSMSG_SET_EPITHET", "$bEPITHET: $b%s" },
{ "NSMSG_SET_TITLE", "$bTITLE: $b%s" },
{ "NSMSG_SET_FAKEHOST", "$bFAKEHOST: $b%s" },
+
+ { "NSMSG_AUTO_OPER", "You have been auto-opered" },
+ { "NSMSG_AUTO_OPER_ADMIN", "You have been auto-admined" },
+
{ "NSEMAIL_ACTIVATION_SUBJECT", "Account verification for %s" },
{ "NSEMAIL_ACTIVATION_BODY",
"This email has been sent to verify that this email address belongs to the person who tried to register an account on %1$s. Your cookie is:\n"
unsigned long auto_reclaim_delay;
unsigned char default_maxlogins;
unsigned char hard_maxlogins;
+ const char *auto_oper;
+ const char *auto_admin;
} nickserv_conf;
/* We have 2^32 unique account IDs to use. */
reply("NSMSG_WEAK_PASSWORD");
if (hi->passwd[0] != '$')
cryptpass(passwd, hi->passwd);
- reply("NSMSG_AUTH_SUCCESS");
+ /* If a channel was waiting for this user to auth,
+ * finish adding them */
process_adduser_pending(user);
+
+ reply("NSMSG_AUTH_SUCCESS");
+
+ if(!IsOper(user))
+ {
+ /* Auto Oper users with Opserv access -Life4Christ 8-10-2005 */
+ if( nickserv_conf.auto_admin[0] && hi->opserv_level >= opserv_conf_admin_level())
+ {
+ irc_umode(user,nickserv_conf.auto_admin);
+ reply("NSMSG_AUTO_OPER_ADMIN");
+ }
+ else if (nickserv_conf.auto_oper[0] && hi->opserv_level > 0)
+ {
+ irc_umode(user,nickserv_conf.auto_oper);
+ reply("NSMSG_AUTO_OPER");
+ }
+ }
+
+ /* Wipe out the pass for the logs */
argv[pw_arg] = "****";
return 1;
}
nickserv_conf.email_search_level = str ? strtoul(str, NULL, 0) : 600;
str = database_get_data(conf_node, KEY_TITLEHOST_SUFFIX, RECDB_QSTRING);
nickserv_conf.titlehost_suffix = str ? str : "example.net";
+
+ str = database_get_data(conf_node, KEY_AUTO_OPER, RECDB_QSTRING);
+ nickserv_conf.auto_oper = str ? str : "";
+
+ str = database_get_data(conf_node, KEY_AUTO_ADMIN, RECDB_QSTRING);
+ nickserv_conf.auto_admin = str ? str : "";
+
str = conf_get_data("server/network", RECDB_QSTRING);
nickserv_conf.network_name = str ? str : "some IRC network";
if (!nickserv_conf.auth_policer_params) {
#define KEY_BLOCK_GLINE_DURATION "block_gline_duration"
#define KEY_ISSUER "issuer"
#define KEY_ISSUED "issued"
+#define KEY_ADMIN_LEVEL "admin_level"
#define IDENT_FORMAT "%s [%s@%s/%s]"
#define IDENT_DATA(user) user->nick, user->ident, user->hostname, inet_ntoa(user->ip)
unsigned long purge_lock_delay;
unsigned long join_flood_moderate;
unsigned long join_flood_moderate_threshold;
+ unsigned long admin_level;
} opserv_conf;
struct trusted_host {
} else {
opserv_conf.staff_auth_channel = NULL;
}
+
+ str = database_get_data(conf_node, KEY_ADMIN_LEVEL, RECDB_QSTRING);
+ opserv_conf.admin_level = str ? strtoul(str, NULL, 0): 800;
+
str = database_get_data(conf_node, KEY_UNTRUSTED_MAX, RECDB_QSTRING);
opserv_conf.untrusted_max = str ? strtoul(str, NULL, 0) : 5;
str = database_get_data(conf_node, KEY_PURGE_LOCK_DELAY, RECDB_QSTRING);
dict_foreach(child, set_policer_param, pp);
}
+/* lame way to export opserv_conf value to nickserv.c ... */
+unsigned int
+opserv_conf_admin_level()
+{
+ return(opserv_conf.admin_level);
+}
+
static void
opserv_db_init(void) {
/* set up opserv_trusted_hosts dict */
void init_opserv(const char *nick);
unsigned int gag_create(const char *mask, const char *owner, const char *reason, time_t expires);
int opserv_bad_channel(const char *name);
+unsigned int opserv_conf_admin_level();
#endif
putsock(":%s MODE %s "FMT_TIME_T" %s", who->nick, target->name, target->timestamp, modes);
}
+/* Untested...*/
+void
+irc_umode(struct userNode *target, const char *modes)
+{
+ putsock(":%s MODE %s %s ",self->numeric,target->nick, modes);
+}
+
+
void
irc_svsmode(struct userNode *target, char *modes, unsigned long stamp) {
extern struct userNode *nickserv;
target->name, modes, target->timestamp);
}
+/* Added to allow services to mode users
+ 2005 - 8 - 10 by Life4Christ
+*/
+void
+irc_umode(struct userNode *target, const char *modes)
+{
+ putsock("%s " P10_MODE " %s %s ",self->numeric,target->nick, modes);
+}
+
+
void
irc_invite(struct userNode *from, struct userNode *who, struct chanNode *to)
{
void irc_join(struct userNode *who, struct chanNode *what);
void irc_invite(struct userNode *from, struct userNode *who, struct chanNode *to);
void irc_mode(struct userNode *who, struct chanNode *target, const char *modes);
+void irc_umode(struct userNode *target, const char *modes);
void irc_kick(struct userNode *who, struct userNode *target, struct chanNode *from, const char *msg);
void irc_part(struct userNode *who, struct chanNode *what, const char *reason);
void irc_topic(struct userNode *who, struct chanNode *what, const char *topic);