if (hi && !hi->users && !hi->opserv_level)
HANDLE_CLEAR_FLAG(hi, HELPING);
- if (GetUserH(user->nick)) {
- for (n=0; n<auth_func_used; n++)
- auth_func_list[n](user, old_info);
- } else
+ /* Call auth handlers */
+ if (!GetUserH(user->nick))
user->loc = 1;
if (hi) {
send_message(other, nickserv, "NSMSG_CLONE_AUTH", user->nick, user->ident, user->hostname);
}
+ /* Add this auth to users list of current auths */
user->next_authed = hi->users;
hi->users = user;
hi->lastseen = now;
+ /* Add to helpers list */
if (IsHelper(user))
userList_append(&curr_helpers, user);
+ /* Set the fakehost */
if (hi->fakehost || old_info)
apply_fakehost(hi);
#else
const char *id = "???";
#endif
+ /* Mark all the nicks registered to this
+ * account as registered nicks
+ * - Why not just this one? -rubin */
if (!nickserv_conf.disable_nicks) {
struct nick_info *ni;
for (ni = hi->nicks; ni; ni = ni->next) {
}
}
}
+ /* send the account to the ircd */
StampUser(user, id, hi->registered);
}
+ /* Stop trying to kick this user off their nick */
if ((ni = get_nick_info(user->nick)) && (ni->owner == hi))
timeq_del(0, nickserv_reclaim_p, user, TIMEQ_IGNORE_WHEN);
} else {
/* We cannot clear the user's account ID, unfortunately. */
user->next_authed = NULL;
}
+
+ /* Call auth handlers */
+ if (GetUserH(user->nick)) {
+ for (n=0; n<auth_func_used; n++)
+ auth_func_list[n](user, old_info);
+ }
}
static struct handle_info*
return 0;
}
+ switch (hi->cookie->type) {
+ case ACTIVATION:
+ safestrncpy(hi->passwd, hi->cookie->data, sizeof(hi->passwd));
+ if (nickserv_conf.sync_log)
+ SyncLog("ACCOUNTACC %s", hi->handle);
+ break;
+ case PASSWORD_CHANGE:
+ safestrncpy(hi->passwd, hi->cookie->data, sizeof(hi->passwd));
+ if (nickserv_conf.sync_log)
+ SyncLog("PASSCHANGE %s %s", hi->handle, hi->passwd);
+ break;
+ case EMAIL_CHANGE:
+ if (!hi->email_addr && nickserv_conf.sync_log) {
+ if (nickserv_conf.sync_log)
+ SyncLog("REGISTER %s %s %s %s", hi->handle, hi->passwd, hi->cookie->data, user->info);
+ }
+ nickserv_set_email_addr(hi, hi->cookie->data);
+ if (nickserv_conf.sync_log)
+ SyncLog("EMAILCHANGE %s %s", hi->handle, hi->cookie->data);
+ break;
+ default:
+ reply("NSMSG_BAD_COOKIE_TYPE", hi->cookie->type);
+ log_module(NS_LOG, LOG_ERROR, "Bad cookie type %d for account %s.", hi->cookie->type, hi->handle);
+ break;
+ }
+
nickserv_eat_cookie(hi->cookie);
reply("NSMSG_ATE_FOREIGN_COOKIE", hi->handle);
title = hi->fakehost + 1;
else {
/* If theres no title set then the default title will therefore
- be the first part of hidden_host in x3.conf.example, so for
- consistency with opt_fakehost we will print this here */
+ be the first part of hidden_host in x3.conf, so for
+ consistency with opt_fakehost we will print this here.
+ This isnt actually used in P10, its just handled to keep from crashing... */
char *hs, *hidden_suffix, *rest;
hs = conf_get_data("server/hidden_host", RECDB_QSTRING);
hidden_suffix = strdup(hs);
/* Yes we do this twice */
- rest = strrchr(hidden_suffix, '.');
- *rest++ = '\0';
- rest = strrchr(hidden_suffix, '.');
- *rest++ = '\0';
+ if((rest = strchr(hidden_suffix, '.')))
+ {
+ *rest = '\0';
+ title = hidden_suffix;
+ }
+ else
+ {
+ /* A lame default if someone configured hidden_host to something lame */
+ title = strdup("users");
+ free(hidden_suffix);
+ }
- title = hidden_suffix;
}
if (!title)