ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.1.x/src/s_user.c
(Generate patch)

Comparing ircd-hybrid-8/src/s_user.c (file contents):
Revision 1196 by michael, Sun Aug 21 10:09:23 2011 UTC vs.
Revision 1219 by michael, Sun Sep 18 09:02:38 2011 UTC

# Line 190 | Line 190 | show_lusers(struct Client *source_p)
190      to = source_p->name;
191    }
192  
193 <  if (!ConfigServerHide.hide_servers || IsOper(source_p))
193 >  if (!ConfigServerHide.hide_servers || HasUMode(source_p, UMODE_OPER))
194      sendto_one(source_p, form_str(RPL_LUSERCLIENT),
195                 from, to, (Count.total-Count.invisi),
196                 Count.invisi, dlink_list_length(&global_serv_list));
# Line 210 | Line 210 | show_lusers(struct Client *source_p)
210      sendto_one(source_p, form_str(RPL_LUSERCHANNELS),
211                 from, to, dlink_list_length(&global_channel_list));
212  
213 <  if (!ConfigServerHide.hide_servers || IsOper(source_p))
213 >  if (!ConfigServerHide.hide_servers || HasUMode(source_p, UMODE_OPER))
214    {
215      sendto_one(source_p, form_str(RPL_LUSERME),
216                 from, to, Count.local, Count.myserver);
# Line 231 | Line 231 | show_lusers(struct Client *source_p)
231               from, to, Count.total, Count.max_tot,
232               Count.total, Count.max_tot);
233  
234 <  if (!ConfigServerHide.hide_servers || IsOper(source_p))
234 >  if (!ConfigServerHide.hide_servers || HasUMode(source_p, UMODE_OPER))
235      sendto_one(source_p, form_str(RPL_STATSCONN), from, to,
236                 Count.max_loc_con, Count.max_loc_cli, Count.totalrestartcount);
237  
# Line 445 | Line 445 | register_local_user(struct Client *sourc
445  
446    if (ConfigFileEntry.invisible_on_connect)
447    {
448 <    source_p->umodes |= UMODE_INVISIBLE;
448 >    AddUMode(source_p, UMODE_INVISIBLE);
449      ++Count.invisi;
450    }
451  
# Line 522 | Line 522 | register_remote_user(struct Client *sour
522                           source_p->host, source_p->from->name);
523      kill_client(source_p->from, source_p, "%s (Server doesn't exist)", me.name);
524  
525 <    SetKilled(source_p);
525 >    AddFlag(source_p, FLAGS_KILLED);
526      exit_client(source_p, &me, "Ghosted Client");
527      return;
528    }
# Line 537 | Line 537 | register_remote_user(struct Client *sour
537      kill_client(source_p->from, source_p,
538                  "%s (NICK from wrong direction (%s != %s))",
539                  me.name, source_p->servptr->name, target_p->from->name);
540 <    SetKilled(source_p);
540 >    AddFlag(source_p, FLAGS_KILLED);
541      exit_client(source_p, &me, "USER server wrong direction");
542      return;
543    }
# Line 546 | Line 546 | register_remote_user(struct Client *sour
546     * If the nick has been introduced by a services server,
547     * make it a service as well.
548     */
549 <  if (IsService(source_p->servptr))
550 <    SetService(source_p);
549 >  if (HasFlag(source_p->servptr, FLAGS_SERVICE))
550 >    AddFlag(source_p, FLAGS_SERVICE);
551  
552    /* Increment our total user count here */
553    if (++Count.total > Count.max_tot)
# Line 814 | Line 814 | change_simple_umode(va_list args)
814    flag = va_arg(args, unsigned int);
815  
816    if (what == MODE_ADD)
817 <    source_p->umodes |= flag;
817 >    AddUMode(source_p, flag);
818    else
819 <    source_p->umodes &= ~flag;
819 >    DelUMode(source_p, flag);
820  
821    return NULL;
822   }
# Line 867 | Line 867 | set_user_mode(struct Client *client_p, s
867      *m++ = '+';
868  
869      for (i = 0; i < 128; i++)
870 <      if (source_p->umodes & user_modes[i])
870 >      if (HasUMode(source_p, user_modes[i]))
871          *m++ = (char)i;
872      *m = '\0';
873  
# Line 897 | Line 897 | set_user_mode(struct Client *client_p, s
897          case 'o':
898            if (what == MODE_ADD)
899            {
900 <            if (IsServer(client_p) && !IsOper(source_p))
900 >            if (IsServer(client_p) && !HasUMode(source_p, UMODE_OPER))
901              {
902                ++Count.oper;
903                SetOper(source_p);
# Line 908 | Line 908 | set_user_mode(struct Client *client_p, s
908              /* Only decrement the oper counts if an oper to begin with
909               * found by Pat Szuta, Perly , perly@xnet.com
910               */
911 <            if (!IsOper(source_p))
911 >            if (!HasUMode(source_p, UMODE_OPER))
912                break;
913  
914              ClearOper(source_p);
# Line 919 | Line 919 | set_user_mode(struct Client *client_p, s
919                dlink_node *dm;
920  
921                detach_conf(source_p, OPER_TYPE);
922 <              ClearOperFlags(source_p);
923 <              source_p->umodes &= ~ConfigFileEntry.oper_only_umodes;
922 >              ClrOFlag(source_p);
923 >              DelUMode(source_p, ConfigFileEntry.oper_only_umodes);
924  
925                if ((dm = dlinkFindDelete(&oper_list, source_p)) != NULL)
926                  free_dlink_node(dm);
# Line 942 | Line 942 | set_user_mode(struct Client *client_p, s
942          default:
943            if ((flag = user_modes[(unsigned char)*m]))
944            {
945 <            if (MyConnect(source_p) && !IsOper(source_p) &&
945 >            if (MyConnect(source_p) && !HasUMode(source_p, UMODE_OPER) &&
946                  (ConfigFileEntry.oper_only_umodes & flag))
947              {
948                badflag = 1;
# Line 965 | Line 965 | set_user_mode(struct Client *client_p, s
965      sendto_one(source_p, form_str(ERR_UMODEUNKNOWNFLAG),
966                 me.name, source_p->name);
967  
968 <  if (HasUMode(source_p, UMODE_NCHANGE) && !IsOperN(source_p))
968 >  if (HasUMode(source_p, UMODE_NCHANGE) && !HasOFlag(source_p, OPER_FLAG_N))
969    {
970 <    sendto_one(source_p, ":%s NOTICE %s :*** You have no admin flag;",
970 >    sendto_one(source_p, ":%s NOTICE %s :*** You have no nchange flag;",
971                 me.name, source_p->name);
972 <    DelUMode(source_p, UMODE_NCHANGE); /* only tcm's really need this */
972 >    DelUMode(source_p, UMODE_NCHANGE);
973    }
974  
975 <  if (MyConnect(source_p) && (source_p->umodes & UMODE_ADMIN) &&
976 <      !IsOperAdmin(source_p) && !IsOperHiddenAdmin(source_p))
975 >  if (MyConnect(source_p) && HasUMode(source_p, UMODE_ADMIN) &&
976 >      !HasOFlag(source_p, OPER_FLAG_HIDDEN_ADMIN|OPER_FLAG_ADMIN))
977    {
978      sendto_one(source_p, ":%s NOTICE %s :*** You have no admin flag;",
979                 me.name, source_p->name);
980 <    source_p->umodes &= ~UMODE_ADMIN;
980 >    DelUMode(source_p, UMODE_ADMIN);
981    }
982  
983 <  if (!(setflags & UMODE_INVISIBLE) && IsInvisible(source_p))
983 >  if (!(setflags & UMODE_INVISIBLE) && HasUMode(source_p, UMODE_INVISIBLE))
984      ++Count.invisi;
985 <  if ((setflags & UMODE_INVISIBLE) && !IsInvisible(source_p))
985 >  if ((setflags & UMODE_INVISIBLE) && !HasUMode(source_p, UMODE_INVISIBLE))
986      --Count.invisi;
987  
988    /*
# Line 1025 | Line 1025 | send_umode(struct Client *client_p, stru
1025      if (MyClient(source_p) && !(flag & sendmask))
1026        continue;
1027  
1028 <    if ((flag & old) && !(source_p->umodes & flag))
1028 >    if ((flag & old) && !HasUMode(source_p, flag))
1029      {
1030        if (what == MODE_DEL)
1031          *m++ = (char)i;
# Line 1036 | Line 1036 | send_umode(struct Client *client_p, stru
1036          *m++ = (char)i;
1037        }
1038      }
1039 <    else if (!(flag & old) && (source_p->umodes & flag))
1039 >    else if (!(flag & old) && HasUMode(source_p, flag))
1040      {
1041        if (what == MODE_ADD)
1042          *m++ = (char)i;
# Line 1070 | Line 1070 | send_umode_out(struct Client *client_p,
1070    char buf[IRCD_BUFSIZE] = { '\0' };
1071    dlink_node *ptr = NULL;
1072  
1073 <  send_umode(NULL, source_p, old, IsOperHiddenAdmin(source_p) ?
1073 >  send_umode(NULL, source_p, old, HasOFlag(source_p, OPER_FLAG_HIDDEN_ADMIN) ?
1074               SEND_UMODES & ~UMODE_ADMIN : SEND_UMODES, buf);
1075  
1076    if (buf[0])
# Line 1215 | Line 1215 | oper_up(struct Client *source_p)
1215    SetOper(source_p);
1216  
1217    if (oconf->modes)
1218 <    source_p->umodes |= oconf->modes;
1218 >    AddUMode(source_p, oconf->modes);
1219    else if (ConfigFileEntry.oper_umodes)
1220 <    source_p->umodes |= ConfigFileEntry.oper_umodes;
1220 >    AddUMode(source_p, ConfigFileEntry.oper_umodes);
1221    else
1222 <    source_p->umodes |= (UMODE_SERVNOTICE|UMODE_OPERWALL|
1223 <                         UMODE_WALLOP|UMODE_LOCOPS);
1222 >    AddUMode(source_p, UMODE_SERVNOTICE|UMODE_OPERWALL|
1223 >                       UMODE_WALLOP|UMODE_LOCOPS);
1224  
1225 <  if (!(old & UMODE_INVISIBLE) && IsInvisible(source_p))
1225 >  if (!(old & UMODE_INVISIBLE) && HasUMode(source_p, UMODE_INVISIBLE))
1226      ++Count.invisi;
1227 <  if ((old & UMODE_INVISIBLE) && !IsInvisible(source_p))
1227 >  if ((old & UMODE_INVISIBLE) && !HasUMode(source_p, UMODE_INVISIBLE))
1228      --Count.invisi;
1229  
1230    assert(dlinkFind(&oper_list, source_p) == NULL);
# Line 1232 | Line 1232 | oper_up(struct Client *source_p)
1232  
1233    operprivs = oper_privs_as_string(oconf->port);
1234  
1235 <  SetOFlag(source_p, oconf->port);
1235 >  AddOFlag(source_p, oconf->port);
1236  
1237 <  if (IsOperAdmin(source_p) || IsOperHiddenAdmin(source_p))
1237 >  if (HasOFlag(source_p, OPER_FLAG_HIDDEN_ADMIN|OPER_FLAG_ADMIN))
1238      AddUMode(source_p, UMODE_ADMIN);
1239 <  if (!IsOperN(source_p))
1239 >  if (!HasOFlag(source_p, OPER_FLAG_N))
1240      DelUMode(source_p, UMODE_NCHANGE);
1241  
1242    sendto_realops_flags(UMODE_ALL, L_ALL, "%s (%s@%s) is now an operator",

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines