? rx/.deps
? rx/Makefile
? src/.deps
? src/Makefile
? src/config.h
? src/modules-list.h
? src/stamp-h1
Index: src/nickserv.c
===================================================================
RCS file: /cvsroot/x2serv/srvx2/src/nickserv.c,v
retrieving revision 1.5
diff -c -r1.5 nickserv.c
*** src/nickserv.c 3 Oct 2004 01:41:34 -0000 1.5
--- src/nickserv.c 18 Oct 2004 07:07:03 -0000
***************
*** 1528,1533 ****
--- 1528,1575 ----
failpw_func_list[failpw_func_used++] = func;
}
+ /*
+ * Return 1 if the handle/pass pair matches, 0 if it doesnt.
+ *
+ * called by nefariouses enhanced AC login-on-connect code
+ *
+ */
+ int loc_auth(struct userNode *user, char *handle, char *password)
+ {
+ int pw_arg, used, maxlogins;
+ struct handle_info *hi;
+ /*
+ struct userNode *other;
+ */
+
+ hi = dict_find(nickserv_handle_dict, handle, NULL);
+ pw_arg = 2;
+ if (!hi) {
+ return 0;
+ }
+ /* Responses from here on look up the language used by the handle they asked about. */
+ if (!checkpass(password, hi->passwd)) {
+ return 0;
+ }
+ if (HANDLE_FLAGGED(hi, SUSPENDED)) {
+ return 0;
+ }
+ maxlogins = hi->maxlogins ? hi->maxlogins : nickserv_conf.default_maxlogins;
+ /* Do we want to deny if they already have more logins? I dont see why but
+ * someone else might? -Rubin
+ for (used = 0, other = hi->users; other; other = other->next_authed) {
+ if (++used >= maxlogins) {
+ send_message_type(4, user, cmd->parent->bot,
+ handle_find_message(hi, "NSMSG_MAX_LOGINS"),
+ maxlogins);
+ argv[pw_arg] = "MAXLOGINS";
+ return 1;
+ }
+ }
+ */
+ return 1;
+ }
+
static NICKSERV_FUNC(cmd_auth)
{
int pw_arg, used, maxlogins;
Index: src/nickserv.h
===================================================================
RCS file: /cvsroot/x2serv/srvx2/src/nickserv.h,v
retrieving revision 1.2
diff -c -r1.2 nickserv.h
*** src/nickserv.h 25 Aug 2004 00:32:02 -0000 1.2
--- src/nickserv.h 18 Oct 2004 07:07:03 -0000
***************
*** 128,133 ****
--- 128,135 ----
int oper_has_access(struct userNode *user, struct userNode *bot, unsigned int min_level, unsigned int quiet);
void nickserv_show_oper_accounts(struct userNode *user, struct svccmd *cmd);
+ int loc_auth(struct userNode *user, char *handle, char *password);
+
/* auth_funcs are called when a user gets a new handle_info. They are
* called *after* user->handle_info has been updated. */
typedef void (*auth_func_t)(struct userNode *user, struct handle_info *old_handle);
Index: src/proto-p10.c
===================================================================
RCS file: /cvsroot/x2serv/srvx2/src/proto-p10.c,v
retrieving revision 1.7
diff -c -r1.7 proto-p10.c
*** src/proto-p10.c 3 Oct 2004 01:41:34 -0000 1.7
--- src/proto-p10.c 18 Oct 2004 07:07:05 -0000
***************
*** 427,433 ****
void
irc_account(struct userNode *user, const char *stamp)
{
! putsock("%s " P10_ACCOUNT " %s %s", self->numeric, user->numeric, stamp);
}
void
--- 427,433 ----
void
irc_account(struct userNode *user, const char *stamp)
{
! putsock("%s " P10_ACCOUNT " %s R %s", self->numeric, user->numeric, stamp);
}
void
***************
*** 1042,1054 ****
static CMD_FUNC(cmd_account)
{
struct userNode *user;
! if ((argc < 3) || !origin || !GetServerH(origin))
return 0; /* Origin must be server. */
user = GetUserN(argv[1]);
if (!user)
return 1; /* A QUIT probably passed the ACCOUNT. */
! call_account_func(user, argv[2]);
return 1;
}
--- 1042,1076 ----
static CMD_FUNC(cmd_account)
{
struct userNode *user;
+ struct server *server;
! if ((argc < 3) || !origin || !(server = GetServerH(origin)))
return 0; /* Origin must be server. */
+
+ /* This next line appears to tremple origin.. why? */
user = GetUserN(argv[1]);
if (!user)
return 1; /* A QUIT probably passed the ACCOUNT. */
!
! if(!strcmp(argv[2],"C"))
! {
! if(loc_auth(user, argv[4], argv[5]))
! {
! /* Return a AC A */
! putsock("%s " P10_ACCOUNT " %s A %s", self->numeric, server->numeric , argv[3]);
!
! }
! else
! {
! /* Return a AC D */
! putsock("%s " P10_ACCOUNT " %s D %s", self->numeric, server->numeric , argv[3]);
! }
! return 1;
! }
! else if(!strcmp(argv[2],"R"))
! call_account_func(user, argv[3]);
! else
! call_account_func(user, argv[2]); /* For backward compatability */
return 1;
}
syntax highlighted by Code2HTML, v. 0.9.1