X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fs_user.c;h=632e185b5348bfa146b473cf193342ff7743f448;hb=7fbfc390d32f9acc3192d011b813f66f35370faa;hp=1fdfcbf323751eaaee06cd4f28479c12ab7971cb;hpb=dda7c8d90d9f681bd06979d45735ba009dbbee26;p=ircu2.10.12-pk.git diff --git a/ircd/s_user.c b/ircd/s_user.c index 1fdfcbf..632e185 100644 --- a/ircd/s_user.c +++ b/ircd/s_user.c @@ -57,6 +57,7 @@ #include "s_misc.h" #include "s_serv.h" /* max_client_count */ #include "send.h" +#include "ssl.h" #include "struct.h" #include "supported.h" #include "sys.h" @@ -355,6 +356,16 @@ int register_user(struct Client *cptr, struct Client *sptr) Count_unknownbecomesclient(sptr, UserStats); + /* + * Set user's initial modes + */ + tmpstr = (char*)client_get_default_umode(sptr); + if (tmpstr) { + char *umodev[] = { NULL, NULL, NULL, NULL }; + umodev[2] = tmpstr; + set_user_mode(cptr, sptr, 3, umodev, ALLOWMODES_ANY); + } + SetUser(sptr); cli_handler(sptr) = CLIENT_HANDLER; SetLocalNumNick(sptr); @@ -385,16 +396,10 @@ int register_user(struct Client *cptr, struct Client *sptr) cli_info(sptr), NumNick(cptr) /* two %s's */); IPcheck_connect_succeeded(sptr); - /* - * Set user's initial modes - */ - tmpstr = (char*)client_get_default_umode(sptr); - if (tmpstr) { - char *umodev[] = { NULL, NULL, NULL, NULL }; - umodev[2] = tmpstr; - set_user_mode(cptr, sptr, 1, umodev, ALLOWMODES_ANY); + + if(cli_connect(sptr)->con_ssl) { + SetSSLConn(sptr); } - } else { struct Client *acptr = user->server; @@ -499,7 +504,8 @@ static const struct UserMode { { FLAG_CHSERV, 'k' }, { FLAG_DEBUG, 'g' }, { FLAG_ACCOUNT, 'r' }, - { FLAG_HIDDENHOST, 'x' } + { FLAG_HIDDENHOST, 'x' }, + { FLAG_SSLCONN, 'S' } }; /** Length of #userModeList. */ @@ -702,10 +708,6 @@ int check_target_limit(struct Client *sptr, void *target, const char *name, assert(cli_local(sptr)); targets = cli_targets(sptr); - /* If user is invited to channel, give him/her a free target */ - if (IsChannelName(name) && IsInvited(sptr, target)) - return 0; - /* * Same target as last time? */ @@ -723,6 +725,10 @@ int check_target_limit(struct Client *sptr, void *target, const char *name, */ if (!created) { if (CurrentTime < cli_nexttarget(sptr)) { + /* If user is invited to channel, give him/her a free target */ + if (IsChannelName(name) && IsInvited(sptr, target)) + return 0; + if (cli_nexttarget(sptr) - CurrentTime < TARGET_DELAY + 8) { /* * No server flooding @@ -1076,6 +1082,12 @@ int set_user_mode(struct Client *cptr, struct Client *sptr, int parc, case 'x': if (what == MODE_ADD) do_host_hiding = 1; + case 'S': + if (what == MODE_ADD) + SetSSLConn(sptr); + else + ClearSSLConn(sptr); + break; break; case 'r': if (*(p + 1) && (what == MODE_ADD)) { @@ -1102,6 +1114,10 @@ int set_user_mode(struct Client *cptr, struct Client *sptr, int parc, ClearLocOp(sptr); if (!FlagHas(&setflags, FLAG_ACCOUNT) && IsAccount(sptr)) ClrFlag(sptr, FLAG_ACCOUNT); + if (!FlagHas(&setflags, FLAG_SSLCONN) && IsSSLConn(sptr)) + ClrFlag(sptr, FLAG_SSLCONN); + else if (FlagHas(&setflags, FLAG_SSLCONN) && !IsSSLConn(sptr)) + SetFlag(sptr, FLAG_SSLCONN); /* * new umode; servers can set it, local users cannot; * prevents users from /kick'ing or /mode -o'ing @@ -1128,7 +1144,10 @@ int set_user_mode(struct Client *cptr, struct Client *sptr, int parc, { if ((FlagHas(&setflags, FLAG_OPER) || FlagHas(&setflags, FLAG_LOCOP)) && !IsAnOper(sptr)) + { det_confs_butmask(sptr, CONF_CLIENT & ~CONF_OPERATOR); + client_set_privs(sptr, NULL); + } if (SendServNotice(sptr)) {