[X2serv-cvs] CVS: x2/source accounting.c,1.4,1.5 commands.c,1.130,1.131 misc.c,1.38,1.39
Brought to you by:
sirvulcan
From: Alex S. <ru...@us...> - 2001-02-05 10:55:24
|
Update of /cvsroot/x2serv/x2/source In directory usw-pr-cvs1:/tmp/cvs-serv3334/source Modified Files: accounting.c commands.c misc.c Log Message: improved teh LAST command to take # of lines as argument Index: accounting.c =================================================================== RCS file: /cvsroot/x2serv/x2/source/accounting.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** accounting.c 2000/12/19 08:11:56 1.4 --- accounting.c 2001/02/05 10:55:35 1.5 *************** *** 18,21 **** --- 18,22 ---- char *gmode; // time_t mystart, myend; + Debug(DBGINFO, "Examining: %s", LogLine); datestr = (char *) mysep(&LogLine, "]"); *************** *** 31,39 **** return(0); } if(!strcasecmp(mycommand, "LOGIN") || !strcasecmp(mycommand, "PASS") || !strcasecmp(mycommand, "RESETPASS")) { - /* Dont show the password */ myrest = "*******"; } if(cptr) { --- 32,41 ---- return(0); } + /* No longer necessary since we do this in the log itself now if(!strcasecmp(mycommand, "LOGIN") || !strcasecmp(mycommand, "PASS") || !strcasecmp(mycommand, "RESETPASS")) { myrest = "*******"; } + */ if(cptr) { *************** *** 117,121 **** if(parselog(LogLine, uptr, cptr, chan, nuh, command, rest, start, end)) line++; ! if(line > maxlines) return(TRUE); } --- 119,123 ---- if(parselog(LogLine, uptr, cptr, chan, nuh, command, rest, start, end)) line++; ! if(line >= maxlines) return(TRUE); } Index: commands.c =================================================================== RCS file: /cvsroot/x2serv/x2/source/commands.c,v retrieving revision 1.130 retrieving revision 1.131 diff -C2 -r1.130 -r1.131 *** commands.c 2001/02/03 07:51:22 1.130 --- commands.c 2001/02/05 10:55:35 1.131 *************** *** 2365,2369 **** int c_last(C_PARAM) { ! ShowLog(uptr, cptr, "*", "*", "*", "*", 0, time(NULL), 10); return(TRUE); } --- 2365,2388 ---- int c_last(C_PARAM) { ! char *arg; ! int numoflines; ! ! arg = (char *) strtok(rest, " "); ! ! ! if(!arg) ! { ! send_to_user(uptr, "USAGE: last <n>"); ! send_to_user(uptr, "where <n> is the number of lines you wish to see."); ! return(FALSE); ! } ! numoflines = atoi(rest); ! ! if(numoflines < 1 || numoflines > 200) ! { ! send_to_user(uptr, "Invalid argument. must be 1-200"); ! return(FALSE); ! } ! ShowLog(uptr, cptr, "*", "*", "*", "*", 0, time(NULL), numoflines); return(TRUE); } Index: misc.c =================================================================== RCS file: /cvsroot/x2serv/x2/source/misc.c,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -r1.38 -r1.39 *** misc.c 2001/01/24 00:54:17 1.38 --- misc.c 2001/02/05 10:55:36 1.39 *************** *** 306,310 **** else { ! sprintf(buff, "[%s] global %s!%s@%s %s %s", time2str(time(NULL)), uptr->Nick, uptr->UserID, uptr->Address, command, rest); --- 306,310 ---- else { ! sprintf(buff, "[%s] global %s!%s@%s - %s %s", time2str(time(NULL)), uptr->Nick, uptr->UserID, uptr->Address, command, rest); |