#include "hash.h"
#include "ircd.h"
#include "ircd_alloc.h"
+#include "ircd_auth.h"
#include "ircd_chattr.h"
#include "ircd_features.h"
#include "ircd_log.h"
static time_t last_too_many2;
assert(cptr == sptr);
+ if (!IsIAuthed(sptr)) {
+ if (iauth_active)
+ return iauth_start_client(iauth_active, sptr);
+ else
+ SetIAuthed(sptr);
+ }
switch (conf_check_client(sptr))
{
case ACR_OK:
if (MyConnect(sptr)) {
cli_handler(sptr) = CLIENT_HANDLER;
release_dns_reply(sptr);
-
+ SetLocalNumNick(sptr);
send_reply(sptr,
RPL_WELCOME,
+ feature_str(FEAT_NETWORK),
feature_str(FEAT_PROVIDER) ? " via " : "",
feature_str(FEAT_PROVIDER) ? feature_str(FEAT_PROVIDER) : "",
nick);
set_snomask(sptr, cli_snomask(sptr) & SNO_NOISY, SNO_ADD);
if (feature_bool(FEAT_CONNEXIT_NOTICES))
sendto_opmask_butone(0, SNO_CONNEXIT,
- "Client connecting: %s (%s@%s) [%s] {%d}",
+ "Client connecting: %s (%s@%s) [%s] {%d} [%s] <%s%s>",
cli_name(sptr), user->username, user->host,
- cli_sock_ip(sptr), get_client_class(sptr));
+ cli_sock_ip(sptr), get_client_class(sptr),
+ cli_info(sptr), NumNick(cptr) /* two %s's */);
IPcheck_connect_succeeded(sptr);
/*
ircd_strncpy(cli_user(new_client)->host, parv[5], HOSTLEN);
ircd_strncpy(cli_user(new_client)->realhost, parv[5], HOSTLEN);
ircd_strncpy(cli_info(new_client), parv[parc - 1], REALLEN);
- if (account)
- ircd_strncpy(cli_user(new_client)->account, account, ACCOUNTLEN);
+ if (account) {
+ int len = ACCOUNTLEN;
+ if ((p = strchr(account, ':'))) {
+ len = (p++) - account;
+ cli_user(new_client)->acc_create = atoi(p);
+ Debug((DEBUG_DEBUG, "Received timestamped account in user mode; "
+ "account \"%s\", timestamp %Tu", account,
+ cli_user(new_client)->acc_create));
+ }
+ ircd_strncpy(cli_user(new_client)->account, account, len);
+ }
if (HasHiddenHost(new_client))
ircd_snprintf(0, cli_user(new_client)->host, HOSTLEN, "%s.%s",
account, feature_str(FEAT_HIDDEN_HOST));
cli_user(sptr) = make_user(sptr);
cli_user(sptr)->server = &me;
}
- SetLocalNumNick(sptr);
hAddClient(sptr);
/*
targets = cli_targets(sptr);
- if (IsChannelName(cli_name(sptr)) && IsInvited(sptr, target))
- return;
/*
* Already in table?
*/
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?
*/
&& (chan->channel->mode.mode & MODE_DELJOINS))
SetDelayedJoin(chan);
else
- sendcmdto_channel_butserv_butone(cptr, CMD_JOIN, chan->channel, cptr,
+ sendcmdto_channel_butserv_butone(cptr, CMD_JOIN, chan->channel, cptr, 0,
"%H", chan->channel);
if (IsChanOp(chan) && HasVoice(chan))
- sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr,
+ sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr, 0,
"%H +ov %C %C", chan->channel, cptr,
cptr);
else if (IsChanOp(chan) || HasVoice(chan))
- sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr,
+ sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr, 0,
"%H +%c %C", chan->channel, IsChanOp(chan) ? 'o' : 'v', cptr);
}
return 0;
do_host_hiding = 1;
break;
default:
+ send_reply(sptr, ERR_UMODEUNKNOWNFLAG, *m);
break;
}
}
{
if ((FlagHas(&setflags, FLAG_OPER) || FlagHas(&setflags, FLAG_LOCOP)) &&
!IsAnOper(sptr))
- det_confs_butmask(sptr, CONF_CLIENT & ~CONF_OPS);
+ det_confs_butmask(sptr, CONF_CLIENT & ~CONF_OPERATOR);
if (SendServNotice(sptr))
{
*m++ = ' ';
while ((*m++ = *t++))
; /* Empty loop */
+
+ if (cli_user(cptr)->acc_create) {
+ char nbuf[20];
+ Debug((DEBUG_DEBUG, "Sending timestamped account in user mode for "
+ "account \"%s\"; timestamp %Tu", cli_user(cptr)->account,
+ cli_user(cptr)->acc_create));
+ ircd_snprintf(0, t = nbuf, sizeof(nbuf), ":%Tu",
+ cli_user(cptr)->acc_create);
+ m--; /* back up over previous nul-termination */
+ while ((*m++ = *t++))
+ ; /* Empty loop */
+ }
}
*m = '\0';