/[dragonmtn]/snowwhite/nickserv.c
ViewVC logotype

Diff of /snowwhite/nickserv.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by Halcy0n, Sat Apr 9 13:00:58 2005 UTC revision 1.7 by Halcy0n, Tue Apr 12 06:18:29 2005 UTC
# Line 225  interp::service_cmd_t nickserv_commands[ Line 225  interp::service_cmd_t nickserv_commands[
225    { "sendpass",                 ns_getpass,              0,     LOG_NO, CMD_REG },    { "sendpass",                 ns_getpass,              0,     LOG_NO, CMD_REG },
226    { "setpass",                  ns_setpass,              0,             LOG_DB, 0 },    { "setpass",                  ns_setpass,              0,             LOG_DB, 0 },
227    { "setemail",                 ns_setemail,             0,     LOG_NO, CMD_REG },    { "setemail",                 ns_setemail,             0,     LOG_NO, CMD_REG },
   { "realgetpass",              ns_getrealpass,  OOPER, LOG_NO, CMD_REG },  
228    { "delete",                   ns_delete,               OOPER, LOG_DB, CMD_REG },    { "delete",                   ns_delete,               OOPER, LOG_DB, CMD_REG },
229    { "list",                             ns_list,                 OOPER, LOG_NO, CMD_REG },    { "list",                             ns_list,                 OOPER, LOG_NO, CMD_REG },
230    { "save",                             ns_save,                 OOPER, LOG_NO, CMD_REG },    { "save",                             ns_save,                 OOPER, LOG_NO, CMD_REG },
# Line 5094  NCMD(ns_getkey) Line 5093  NCMD(ns_getkey)
5093  #endif  #endif
5094    
5095  /**  /**
  * Debugging command, get password field bits from user structure  
  * \deprecated Use of this command is deprecated  
  */  
 NCMD(ns_getrealpass)  
 {  
         char *from = nick->nick;  
         RegNickList *targetNick;  
   
         if (addFlood(nick, 5))  
                 return RET_KILLED;  
   
         if (numargs < 2) {  
                 sSend(":%s NOTICE %s :You must specify a nick to getrealpass",  
                           NickServ, from);  
                 return RET_SYNTAX;  
         }  
 #ifdef ENABLE_GRPOPS  
         if (isRoot(nick) == 0 && isGRPop(nick) == 0)  
 #else  
         if (isRoot(nick) == 0)  
 #endif  
         {  
                 PutReply(NickServ, nick, ERR_NOACCESS, 0, 0, 0);  
                 return RET_NOPERM;  
         }  
   
         sSend(":%s NOTICE %s :Warning -- this command is deprecated.",  
                   NickServ, from);  
   
         targetNick = getRegNickData(args[1]);  
   
         if (targetNick == NULL)  
                 sSend(":%s NOTICE %s :Nick %s is not registered", NickServ, from,  
                           args[1]);  
         else if (targetNick->flags & NMARK) {  
                 if (targetNick->markby)  
                         sSend  
                                 (":%s NOTICE %s :\2Important Note:\2 %s has been marked by %s -- you need to contact the setter before retrieving the password for the nick in question.",  
                                  NickServ, from, targetNick->nick, targetNick->markby);  
                 else  
                         sSend(":%s NOTICE %s :\2Important Note:\2 %s has been marked.",  
                                   NickServ, from, targetNick->nick);  
                 return RET_OK;  
         }  
                 else if (!opFlagged(nick, OROOT | OVERRIDE)  
                                  && (targetNick->flags & NOSENDPASS)) {  
                 sSend  
                         (":%s NOTICE %s :Nick %s has enabled the \2NOPWSEND\2 option.",  
                          NickServ, from, args[1]);  
                 return RET_EFAULT;  
         }  
                 else if ((!isRoot(nick) && (targetNick->opflags & OROOT))  
                                  || (!isServop(nick) && (targetNick->opflags & OSERVOP))) {  
                 sSend  
                         (":%s NOTICE %s :Permission denied -- a GRPop may not GRP a user with root or servop privileges.",  
                          NickServ, from);  
                 sSend(":%s GLOBOPS :%s!%s@%s tries to getrealpass \2%s\2.",  
                           NickServ, from, nick->user, nick->host, args[1]);  
                 operlog->log(nick, NS_GETREALPASS, args[1], RET_FAIL);  
                 return RET_NOPERM;  
         } else {  
                 if (!(targetNick->flags & NENCRYPT))  
                         sSend(":%s NOTICE %s :The password for %s is %s", NickServ, from,  
                                   targetNick->nick, targetNick->password);  
                 else {  
                         u_char *p;  
   
                         sSend(":%s NOTICE %s :The password for %s is encrypted: %s", NickServ, from,  
                                   targetNick->nick, md5_printable(targetNick->password));  
                         p = toBase64(targetNick->password, 16);  
                         if (p != NULL) {  
                                 sSend(":%s NOTICE %s :In Base64 format that is: $%s", NickServ, from,  
                                           p);  
                                 FREE(p);  
                         }  
                 }  
                 sSend(":%s GLOBOPS :%s used getrealpass on %s", myname, from,  
                           args[1]);  
                 operlog->log(nick, NS_GETREALPASS, args[1], 0);  
         }  
         return RET_OK;  
 }  
   
 /**  
5096   * \nscmd Getpass   * \nscmd Getpass
5097   * \syntax Getpass \<nick> { options }   * \syntax Getpass \<nick> { options }
5098   * \plr Send a password change authorization key to the user's e-mail   * \plr Send a password change authorization key to the user's e-mail

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26