summaryrefslogtreecommitdiff
path: root/src/core/cs_sendpass.c
diff options
context:
space:
mode:
authorrob rob@31f1291d-b8d6-0310-a050-a5561fc1590b <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2006-10-17 20:42:40 +0000
committerrob rob@31f1291d-b8d6-0310-a050-a5561fc1590b <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2006-10-17 20:42:40 +0000
commit9bf8366451b60148699657ed966c0913fbae9465 (patch)
tree3a48a1aaa582ec259657ff1029dd691b3a99fb92 /src/core/cs_sendpass.c
parent3dbe219758f5c9712a5c1935d85be1434cf0eee8 (diff)
BUILD : 1.7.17 (1185) BUGS : N/A NOTES : Encryption now offers the choice of none, old and md5 - the md5 module is nicely taken from irc-services and actaully works, yes, real md5, in anope, wow eh?
git-svn-id: svn://svn.anope.org/anope/trunk@1185 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@905 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core/cs_sendpass.c')
-rw-r--r--src/core/cs_sendpass.c68
1 files changed, 35 insertions, 33 deletions
diff --git a/src/core/cs_sendpass.c b/src/core/cs_sendpass.c
index 61eb70524..ee31287df 100644
--- a/src/core/cs_sendpass.c
+++ b/src/core/cs_sendpass.c
@@ -37,15 +37,12 @@ int AnopeInit(int argc, char **argv)
moduleAddCommand(CHANSERV, c, MOD_UNIQUE);
moduleSetChanHelp(myChanServHelp);
-#ifdef USE_ENCRYPTION
- return MOD_STOP;
-#else
+
if (UseMail) {
return MOD_CONT;
} else {
return MOD_STOP;
}
-#endif
}
/**
@@ -89,35 +86,40 @@ int do_sendpass(User * u)
notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);
} else {
char buf[BUFSIZE];
- MailInfo *mail;
-
- snprintf(buf, sizeof(buf),
- getstring2(founder, CHAN_SENDPASS_SUBJECT), ci->name);
- mail = MailBegin(u, founder, buf, s_ChanServ);
- if (!mail)
- return MOD_CONT;
-
- fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_HEAD));
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_1),
- ci->name);
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_2),
- ci->founderpass);
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_3));
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_4));
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_5),
- NetworkName);
- fprintf(mail->pipe, "\n.\n");
-
- MailEnd(mail);
-
- alog("%s: %s!%s@%s used SENDPASS on %s", s_ChanServ, u->nick,
- u->username, u->host, chan);
- notice_lang(s_ChanServ, u, CHAN_SENDPASS_OK, chan);
+ char tmp_pass[PASSMAX];
+ if(enc_decrypt(ci->founderpass,tmp_pass,PASSMAX)==1) {
+ MailInfo *mail;
+
+ snprintf(buf, sizeof(buf),
+ getstring2(founder, CHAN_SENDPASS_SUBJECT), ci->name);
+ mail = MailBegin(u, founder, buf, s_ChanServ);
+ if (!mail)
+ return MOD_CONT;
+
+ fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_HEAD));
+ fprintf(mail->pipe, "\n\n");
+ fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_1),
+ ci->name);
+ fprintf(mail->pipe, "\n\n");
+ fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_2),
+ tmp_pass);
+ fprintf(mail->pipe, "\n\n");
+ fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_3));
+ fprintf(mail->pipe, "\n\n");
+ fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_4));
+ fprintf(mail->pipe, "\n\n");
+ fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_5),
+ NetworkName);
+ fprintf(mail->pipe, "\n.\n");
+
+ MailEnd(mail);
+
+ alog("%s: %s!%s@%s used SENDPASS on %s", s_ChanServ, u->nick,
+ u->username, u->host, chan);
+ notice_lang(s_ChanServ, u, CHAN_SENDPASS_OK, chan);
+ } else {
+ notice_lang(s_ChanServ, u, CHAN_SENDPASS_UNAVAILABLE);
+ }
}
return MOD_CONT;
}