]> jfr.im git - irc/quakenet/newserv.git/commitdiff
suspendtime is now set where you'd expect, and displayed too
authorChris Porter <redacted>
Mon, 10 Mar 2008 01:54:44 +0000 (01:54 +0000)
committerChris Porter <redacted>
Mon, 10 Mar 2008 01:54:44 +0000 (01:54 +0000)
chanserv/authcmds/commandlist.c
chanserv/chancmds/suspendchan.c
chanserv/chancmds/suspendchanlist.c
chanserv/database/chanservdb_messages.c
chanserv/usercmds/suspenduser.c
chanserv/usercmds/suspenduserlist.c

index 9cbc789ecc79568577cfc0b238d573ac03645de4..e251b3d6ac388e4780aefdf434f789c440e98791 100644 (file)
@@ -30,7 +30,7 @@ void _init() {
   chanservaddcommand("login", QCMD_SECURE | QCMD_NOTAUTHED | QCMD_ALIAS, 2, csa_doauth, "Authenticates you on the bot.", "Usage: LOGIN <username> <password>\nAuthenticates you on the bot, where:\nusername - your username\npassword - your password\nIf you do not have a username and password, see HELLO.\nNote: due to the sensitive nature of this command, you must send the message\nto Q@CServe.quakenet.org when using it.\nNote: the preferred way to authenticate is to use the /AUTH command.\n");
   chanservaddcommand("newpass", QCMD_SECURE | QCMD_AUTHED, 3, csa_donewpw, "Change your password.", "Usage: NEWPASS <oldpassword> <newpassword> <newpassword>\nChanges your account password.  Your new password must be at least 6 characters\nlong, contain at least one number and one letter, and may not contain sequences\nof letters or numbers.  Your new password will be sent to your registered email\naddress.  Where:\noldpassword - your existing account password\nnewpassword - your desired new password.  Must be entered the same both times.\nNote: due to the sensitive nature of this command, you must send the message to\nQ@CServe.quakenet.org when using it.\n");
   chanservaddcommand("requestpassword", QCMD_NOTAUTHED, 1, csa_doreqpw, "Requests the current password by email.", "Usage: REQUESTPASSWORD <email>\nSends your current password to your registered email address, where:\nemail    - your registered email address\n");
-  chanservaddcommand("sendpassword", QCMD_OPER, 1, csa_dosendpw, "Sends the users current password by email.", "Usage: SENDPASSWORD <username>\nSends the password for the specified account to the specified users email address.\n");
+  chanservaddcommand("sendpassword", QCMD_HELPER, 1, csa_dosendpw, "Sends the users current password by email.", "Usage: SENDPASSWORD <username>\nSends the password for the specified account to the specified users email address.\n");
   chanservaddcommand("setemail", QCMD_OPER, 2, csa_dosetmail, "Set the email address.", "");
   chanservaddcommand("setpassword", QCMD_OPER, 2, csa_dosetpw, "Set a new password.", "");
 }
index 9d580c6b3dcf07d99d2c6b5b9ffb07f1c187a579..870a7f73f69b53dd4176957c5e904f54bc382820 100644 (file)
@@ -47,6 +47,7 @@ int csc_dosuspendchan(void *source, int cargc, char **cargv) {
   CSetSuspended(rcp);
   rcp->suspendreason = getsstring(cargv[1], 250);
   rcp->suspendby = rup->ID;
+  rcp->suspendtime = time(NULL);
   cs_log(sender,"SUSPENDCHAN %s (%s)",cip->name->content,rcp->suspendreason->content);
   if(cip->channel)
     chanservjoinchan(cip->channel);
index b740a4decb10ef029241bc96b6727a4b9d6626cd..22d753c0190e28f29923889636af4e4d646fd180 100644 (file)
@@ -26,9 +26,9 @@ int csc_dosuspendchanlist(void *source, int cargc, char **cargv) {
   chanindex *cip;
   regchan *rcp;
   int i;
-  char *bywhom;
+  char *bywhom, buf[200];
   unsigned int count=0;
-  
+  struct tm *tmp;
   if (!rup)
     return CMD_ERROR;
   
@@ -59,7 +59,11 @@ int csc_dosuspendchanlist(void *source, int cargc, char **cargv) {
           bywhom="unknown";
       }
       count++;
-      chanservsendmessage(sender, "%-30s %-15s %s", cip->name->content, bywhom, rcp->suspendreason->content);
+
+      tmp=gmtime(&(rcp->suspendtime));
+      strftime(buf,15,"%d/%m/%y %H:%M",tmp);
+
+      chanservsendmessage(sender, "%-30s %-15s %-15s %s", cip->name->content, bywhom, buf, rcp->suspendreason->content);
       if (count >= 2000) {
         chanservstdmessage(sender, QM_TOOMANYRESULTS, 2000, "channels");
         return CMD_ERROR;
index b7e5db25de52be5b166101c5a04674132bc239a7..39081a0b014cfd2c7d940bcee40dd9bdcca19789 100644 (file)
@@ -137,8 +137,8 @@ char *defaultmessages[MAXMESSAGES] = {
   /* 126*/ "Found %u %s%s.",
   /* 127*/ "Attention: Your Q account has been suspended. You are being disconnected.",
   /* 128*/ "Username:       Flags:            Suspended: Email:                         Last user@host:",
-  /* 129*/ "Username:       Suspend type: Suspended by:   Expires:        Reason:",
-  /* 130*/ "Channel:                       Suspended by:   Reason:",
+  /* 129*/ "Username:       Suspend type: Suspended by:   Date suspended: Expires:        Reason:",
+  /* 130*/ "Channel:                       Suspended by:   Date suspended: Reason:",
   /* 131*/ "You cannot request ownership of %s as there is a channel %s present.",
   /* 132*/ "You have been granted ownership of %s.",
   /* 133*/ "#:  User:                                              Authed:         Disconnected:   Reason:",
index 7078aa3aad3c531d9ab6e1d3f1f08f5f425a4f22..b20f0852e505b47cd85865b1a9f508c62a9a6370 100644 (file)
@@ -154,6 +154,7 @@ int csu_dosuspenduser(void *source, int cargc, char **cargv) {
           vrup->flags|=QUFLAG_SUSPENDED;
           vrup->suspendby=rup->ID;
           vrup->suspendexp=expires;
+          vrup->suspendtime=time(NULL);
           vrup->suspendreason=getsstring(reason, strlen(reason)+1);
           
           killtheusers(sender,vrup);
@@ -180,6 +181,7 @@ int csu_dosuspenduser(void *source, int cargc, char **cargv) {
           vrup->flags|=QUFLAG_SUSPENDED;
           vrup->suspendby=rup->ID;
           vrup->suspendexp=expires;
+          vrup->suspendtime=time(NULL);
           vrup->suspendreason=getsstring(reason, strlen(reason)+1);
           
           killtheusers(sender,vrup);
@@ -219,6 +221,7 @@ int csu_dosuspenduser(void *source, int cargc, char **cargv) {
       vrup->flags|=QUFLAG_SUSPENDED;
     vrup->suspendby=rup->ID;
     vrup->suspendexp=expires;
+    vrup->suspendtime=time(NULL);
     vrup->suspendreason=getsstring(reason, strlen(reason)+1);
     
     chanservwallmessage("%s (%s) %s %s (expires: %s)", sender->nick, rup->username, (gline)?((gline == 2)?"instantly glined":"delayed glined"):"suspended", vrup->username, expires?buf:"never");
index afdd2743c47785980bebd45d06a00e103b409ae9..4d1878ccaf6aed32ac3400a8ec3ac8627b79b5ae 100644 (file)
@@ -22,7 +22,7 @@ int csu_dosuspenduserlist(void *source, int cargc, char **cargv) {
   int i;
   unsigned int count=0;
   struct tm *tmp;
-  char buf[200];
+  char buf[200], buf2[200];
   
   if (!rup)
     return CMD_ERROR;
@@ -71,8 +71,11 @@ int csu_dosuspenduserlist(void *source, int cargc, char **cargv) {
           strftime(buf,15,"%d/%m/%y %H:%M",tmp);
         }
         
+        tmp=gmtime(&(dbrup->suspendtime));
+        strftime(buf2,15,"%d/%m/%y %H:%M",tmp);
+
         count++;
-        chanservsendmessage(sender, "%-15s %-13s %-15s %-15s %s", dbrup->username, suspendtype, UHasOperPriv(rup)?(bywhom?bywhom:"unknown"):"not shown", (dbrup->suspendexp)?((time(0) >= dbrup->suspendexp)?"next auth":buf):"never", dbrup->suspendreason->content);
+        chanservsendmessage(sender, "%-15s %-13s %-15s %-15s %-15s %s", dbrup->username, suspendtype, UHasOperPriv(rup)?(bywhom?bywhom:"unknown"):"not shown", buf2, (dbrup->suspendexp)?((time(0) >= dbrup->suspendexp)?"next auth":buf):"never", dbrup->suspendreason->content);
         if (count >= 2000) {
           chanservstdmessage(sender, QM_TOOMANYRESULTS, 2000, "users");
           return CMD_ERROR;