]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Merge.
authorsplidge <redacted>
Mon, 10 Mar 2008 21:46:10 +0000 (21:46 +0000)
committersplidge <redacted>
Mon, 10 Mar 2008 21:46:10 +0000 (21:46 +0000)
1  2 
chanserv/authcmds/hello.c

index 63f1aec9d0aa83e2fe297941a83599bc69d87e97,1a2f26a35b1bd87677ac97da0685295663141aa6..40f5d16a74230bb586b852dbb2792bc7e7c39dc9
@@@ -7,12 -7,6 +7,12 @@@
   * CMDDESC: Creates a new user account.
   * CMDFUNC: csa_dohello
   * CMDPROTO: int csa_dohello(void *source, int cargc, char **cargv);
 + * CMDHELP: Usage: HELLO <email> <email>
 + * CMDHELP: Creates a new user account for yourself.  Your current nickname will be used
 + * CMDHELP: for the name of the account, and may only contain letters, numbers and 
 + * CMDHELP: hyphens (-).  An email containing password details will be sent to the email
 + * CMDHELP: address supplied.  Where:
 + * CMDHELP: email    - your email address.  Must be entered the same way both times.
   */
  
  #include "../chanserv.h"
@@@ -30,6 -24,7 +30,7 @@@ int csa_dohello(void *source, int cargc
    reguser *ruh;
    int found=0;
    char *dupemail;
+   activeuser *aup;
  
    if (getreguserfromnick(sender))
      return CMD_ERROR;
      return CMD_ERROR;
    }
  
+   if (!(aup = getactiveuserfromnick(sender)))
+     return CMD_ERROR;
+   if (aup->helloattempts > MAXHELLOS) {
+     chanservstdmessage(sender, QM_MAXHELLOLIMIT);
+     return CMD_ERROR;
+   }
    if (strcmp(cargv[0],cargv[1])) {
      chanservstdmessage(sender, QM_EMAILDONTMATCH);
      cs_log(sender,"HELLO FAIL username %s email don't match (%s vs %s)",sender->nick,cargv[0],cargv[1]);
@@@ -64,6 -67,8 +73,8 @@@
      }
    }
  
+   aup->helloattempts++;
+   
    dupemail = strdup(cargv[0]);
    local=strchr(dupemail, '@');
    *(local++)='\0';