X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/303e85c59e4c04cb7100ebb4641c0ff214c40542..6ac21a70e238ca31704f4a5be3a3b71af2c2d2d0:/ircd/s_user.c diff --git a/ircd/s_user.c b/ircd/s_user.c index bda9bca8..1a9d51f4 100644 --- a/ircd/s_user.c +++ b/ircd/s_user.c @@ -89,7 +89,7 @@ int user_modes[256] = { 0, /* W */ 0, /* X */ 0, /* Y */ - UMODE_SSLCLIENT, /* Z */ + UMODE_SECURE, /* Z */ /* 0x5B */ 0, 0, 0, 0, 0, 0, /* 0x60 */ UMODE_ADMIN, /* a */ 0, /* b */ @@ -441,7 +441,7 @@ register_local_user(struct Client *client_p, struct Client *source_p) return (CLIENT_EXITED); } - if(IsConfSSLNeeded(aconf) && !IsSSL(source_p)) + if(IsConfSSLNeeded(aconf) && !IsSecure(source_p)) { ServerStats.is_ref++; sendto_one_notice(source_p, ":*** Notice -- You need to use SSL/TLS to use this server"); @@ -634,8 +634,8 @@ register_local_user(struct Client *client_p, struct Client *source_p) add_to_id_hash(source_p->id, source_p); } - if (IsSSL(source_p) && !IsInsecure(source_p)) - source_p->umodes |= UMODE_SSLCLIENT; + if (IsSecure(source_p)) + source_p->umodes |= UMODE_SECURE; if (source_p->umodes & UMODE_INVISIBLE) Count.invisi++; @@ -1047,7 +1047,7 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char if(source_p != target_p) { - if (MyOper(source_p) && parc < 3) + if (HasPrivilege(source_p, "auspex:umodes") && parc < 3) show_other_user_mode(source_p, target_p); else sendto_one(source_p, form_str(ERR_USERSDONTMATCH), me.name, source_p->name); @@ -1116,11 +1116,6 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char if(MyConnect(source_p)) { source_p->umodes &= ~ConfigFileEntry.oper_only_umodes; - if (!(source_p->umodes & UMODE_SERVNOTICE) && source_p->snomask != 0) - { - source_p->snomask = 0; - showsnomask = true; - } source_p->flags &= ~OPER_FLAGS; rb_dlinkFindDestroy(source_p, &local_oper_list); @@ -1158,8 +1153,8 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char case 's': if (MyConnect(source_p)) { - if(!IsOper(source_p) - && (ConfigFileEntry.oper_only_umodes & UMODE_SERVNOTICE)) + if((ConfigFileEntry.oper_only_umodes & UMODE_SERVNOTICE) && + (!IsOper(source_p) || !HasPrivilege(source_p, "usermode:servnotice"))) { if (what == MODE_ADD || source_p->umodes & UMODE_SERVNOTICE) badflag = true; @@ -1218,6 +1213,18 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char if(badflag) sendto_one(source_p, form_str(ERR_UMODEUNKNOWNFLAG), me.name, source_p->name); + if(MyClient(source_p)) + { + if ((ConfigFileEntry.oper_only_umodes & UMODE_SERVNOTICE) && + !HasPrivilege(source_p, "usermode:servnotice")) + source_p->umodes &= ~UMODE_SERVNOTICE; + if (!(source_p->umodes & UMODE_SERVNOTICE) && source_p->snomask != 0) + { + source_p->snomask = 0; + showsnomask = true; + } + } + if(MyClient(source_p) && (source_p->snomask & SNO_NCHANGE) && !IsOperN(source_p)) { sendto_one_notice(source_p, ":*** You need oper and nick_changes flag for +s +n"); @@ -1237,6 +1244,9 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char source_p->umodes &= ~UMODE_ADMIN; } + if(MyClient(source_p)) + source_p->handler = IsOperGeneral(source_p) ? OPER_HANDLER : CLIENT_HANDLER; + /* let modules providing usermodes know that we've changed our usermode --nenolod */ hdata.client = source_p; hdata.oldumodes = setflags; @@ -1434,11 +1444,19 @@ oper_up(struct Client *source_p, struct oper_conf *oper_p) source_p->snomask &= ~SNO_NCHANGE; if(!IsOperOperwall(source_p)) source_p->umodes &= ~UMODE_OPERWALL; + if((ConfigFileEntry.oper_only_umodes & UMODE_SERVNOTICE) && + !HasPrivilege(source_p, "usermode:servnotice")) + { + source_p->umodes &= ~UMODE_SERVNOTICE; + source_p->snomask = 0; + } hdata.client = source_p; hdata.oldumodes = old; hdata.oldsnomask = oldsnomask; call_hook(h_umode_changed, &hdata); + source_p->handler = IsOperGeneral(source_p) ? OPER_HANDLER : CLIENT_HANDLER; + sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s (%s!%s@%s) is now an operator", oper_p->name, source_p->name, source_p->username, source_p->host);