From: Gabriel B. <sh...@us...> - 2006-03-18 00:36:10
|
Update of /cvsroot/solidircd/solidircd-stable/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15968/src Modified Files: glines.c m_shun.c s_serv.c s_user.c Log Message: fixed shun, readded freeze from solid2.2.20. Index: s_user.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_user.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** s_user.c 12 Mar 2006 16:05:54 -0000 1.22 --- s_user.c 18 Mar 2006 00:36:03 -0000 1.23 *************** *** 1664,1667 **** --- 1664,1694 ---- int tleft = MAXRECIPIENTS; /* targets left */ + /* If User is in freezed mode then don't send text */ + + if (cptr->user && cptr->user->special_mode) { + switch (cptr->user->special_mode) { + + case 3: + + + #ifdef ERROR_FREEZE_NOTICE + sendto_one(sptr, err_str(ERR_NOTEXTTOSEND), me.name, parv[0]); + #endif + + return 0; + } + } + + /* Need to add something here for shunned users */ + + if IsShunned(sptr) { + + + #ifdef ERROR_FREEZE_NOTICE + sendto_one(sptr, err_str(ERR_NOTEXTTOSEND), me.name, parv[0]); + #endif + return 0; + } + cmd = notice ? MSG_NOTICE : MSG_PRIVATE; ismine = MyClient(sptr); Index: glines.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/glines.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** glines.c 17 Mar 2006 21:44:04 -0000 1.4 --- glines.c 18 Mar 2006 00:36:03 -0000 1.5 *************** *** 207,214 **** --- 207,224 ---- if (tgminutes) + + #if 0 + sendto_one(target, ":%s NOTICE %s :*** %s waves a magic wand " + "and g-lines you",me.name, parv[1], parv[0]); + #endif sendto_realops("%s added temporary %d min. "NETWORK_GLINE_NAME" for" " [%s@%s] [%s]", parv[0], tgminutes, user, host, reason); else + + #if 0 + sendto_one(target, ":%s NOTICE %s :*** %s waves a magic wand " + "and g-lines you",me.name, parv[1], parv[0]); + #endif sendto_realops("%s added "NETWORK_GLINE_NAME" for [%s@%s] [%s]", parv[0], user, host, reason); Index: m_shun.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/m_shun.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** m_shun.c 26 Dec 2005 05:21:38 -0000 1.2 --- m_shun.c 18 Mar 2006 00:36:03 -0000 1.3 *************** *** 161,164 **** --- 161,169 ---- if (MyConnect(sptr)) { + + #if 0 + sendto_one(target, ":%s NOTICE %s :*** %s waves a magic wand " + "and shuns you",me.name, parv[1], parv[0]); + #endif send_globops("Shun added for (%s@%s) by %s, expires in %d seconds (Reason: %s)", user, host, parv[0], shun_time, buffer); Index: s_serv.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_serv.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** s_serv.c 7 Jan 2006 22:13:26 -0000 1.15 --- s_serv.c 18 Mar 2006 00:36:03 -0000 1.16 *************** *** 4125,4128 **** --- 4125,4273 ---- } + /* + ** m_freeze (stop a user from sending data to the server) + */ + + int m_freeze(aClient *cptr, aClient *sptr, int parc, char *parv[]) + { + aClient *target; + + if (check_registered(sptr)) + return 0; + + if (parc < 2) + { + sendto_one (sptr, err_str(ERR_NEEDMOREPARAMS), + me.name, parv[0], "FREEZE"); + return 0; + } + + target = find_client (parv[1], NULL); + + if (target == NULL) + { + sendto_one (sptr, err_str (ERR_NOSUCHNICK), + me.name, sptr->name, parv[1]); + return 0; + } + + if (IsServer(cptr)) { + sendto_serv_butone(cptr, ":%s FREEZE :%s", parv[0], parv[1]); + target->user->special_mode = 3; + return 0; + } + + if (!IsOper(sptr)) + { + sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); + return 0; + } + + if (IsServer (target)) + { + /* I guess we'll allow net admins to freeze servers */ + if (!IsAdmin (sptr)) + { + sendto_one (sptr, err_str (ERR_NOSUCHNICK), + me.name, sptr->name, parv[1]); + return 0; + } + } + + if (IsOper (target)) + { + sendto_ops("%s (%s@%s) tried to FREEZE ircop [%s]", sptr->name, + sptr->user->username, sptr->user->host, parv[1]); + + sendto_serv_butone(&me, ":%s GNOTICE :%s (%s@%s) tried to FREEZE ircop [%s]", + me.name, sptr->name, sptr->user->username, sptr->user->host, parv[1]); + return 0; + } + + target->user->special_mode = 3; + #if 0 + sendto_one(target, ":%s NOTICE %s :*** %s waves a magic wand " + "and freezes you",me.name, parv[1], parv[0]); + #endif + sendto_ops("%s (%s@%s) added SILENT FREEZE on [%s]", sptr->name, + sptr->user->username, sptr->user->host, parv[1]); + + sendto_serv_butone(&me, ":%s GLOBOPS :%s (%s@%s) added SILENT FREEZE on [%s]", + me.name, sptr->name, sptr->user->username, sptr->user->host, parv[1]); + + sendto_serv_butone(cptr, ":%s FREEZE %s", IsServer(cptr) ? parv[0] : me.name, parv[1]); + + return 0; + } + + + + /* + ** m_unfreeze (stop a user from sending data to the server) + */ + + int m_unfreeze(aClient *cptr, aClient *sptr, int parc, char *parv[]) + { + aClient *target; + + if (check_registered(sptr)) + return 0; + + if (parc < 2) + { + sendto_one (sptr, err_str(ERR_NEEDMOREPARAMS), + me.name, parv[0], "UNFREEZE"); + return 0; + } + + if (!IsOper(sptr)) + { + sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); + return 0; + } + + target = find_client (parv[1], NULL); + if (target == NULL) + { + sendto_one (sptr, err_str (ERR_NOSUCHNICK), + me.name, sptr->name, parv[1]); + return 0; + } + + if (IsServer(cptr)) { + sendto_serv_butone(cptr, ":%s UNFREEZE :%s", parv[0], parv[1]); + target->user->special_mode = 0; + return 0; + } + + if (IsOper (target)) + { + sendto_ops("%s (%s@%s) tried to UNFREEZE ircop [%s]", sptr->name, + sptr->user->username, sptr->user->host, parv[1]); + + sendto_serv_butone(&me, ":%s GNOTICE :%s (%s@%s) tried to UNFREEZE ircop [%s]", + me.name, sptr->name, sptr->user->username, sptr->user->host, parv[1]); + return 0; + } + + target->user->special_mode = 0; + + #if 0 + sendto_one(target, ":%s NOTICE %s :*** %s waves a magic wand " + "and returns you to normality", me.name, parv[1], parv[0]); + #endif + + sendto_ops("%s (%s@%s) unset SILENT FREEZE on [%s]", sptr->name, + sptr->user->username, sptr->user->host, parv[1]); + + sendto_serv_butone(&me, ":%s GNOTICE :%s (%s@%s) set UNFREEZE on [%s]", + me.name, sptr->name, sptr->user->username, sptr->user->host, parv[1]); + + sendto_serv_butone(cptr, ":%s UNFREEZE :%s", parv[0], parv[1]); + + return 0; + } + + u_long memcount_s_serv(MCs_serv *mc) |