* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
* the file COPYING for details.
else if (opt_realname)
match = InspIRCd::Match(user->fullname, matchtext);
else if (opt_showrealhost)
- match = InspIRCd::Match(user->host, matchtext);
+ match = InspIRCd::Match(user->host, matchtext, ascii_case_insensitive_map);
else if (opt_ident)
- match = InspIRCd::Match(user->ident, matchtext);
+ match = InspIRCd::Match(user->ident, matchtext, ascii_case_insensitive_map);
else if (opt_port)
{
irc::portparser portrange(matchtext, false);
long portno = -1;
while ((portno = portrange.GetToken()))
- if (portno == user->GetPort())
+ if (portno == user->GetServerPort())
{
match = true;
break;
* -- w00t
*/
if (!match)
- match = InspIRCd::Match(user->dhost, matchtext);
+ match = InspIRCd::Match(user->dhost, matchtext, ascii_case_insensitive_map);
if (!match)
match = InspIRCd::Match(user->nick, matchtext);
if (chan->HasUser(user))
return true;
/* Opers see all */
- if (IS_OPER(user))
+ if (user->HasPrivPermission("users/auspex"))
return true;
/* Cant see inside a +s or a +p channel unless we are a member (see above) */
else if (!chan->IsModeSet('s') && !chan->IsModeSet('p'))
Channel* chlast = ServerInstance->FindChan(lcn);
std::string wholine = initial + (ch ? ch->name : lcn) + " " + u->ident + " " + (opt_showrealhost ? u->host : u->dhost) + " " +
- ((*ServerInstance->Config->HideWhoisServer && !IS_OPER(user)) ? ServerInstance->Config->HideWhoisServer : u->server) +
+ ((*ServerInstance->Config->HideWhoisServer && !user->HasPrivPermission("servers/auspex")) ? ServerInstance->Config->HideWhoisServer : u->server) +
" " + u->nick + " ";
/* away? */
opt_viewopersonly = true;
break;
case 'h':
- if (IS_OPER(user))
+ if (user->HasPrivPermission("users/auspex"))
opt_showrealhost = true;
break;
case 'u':
- if (IS_OPER(user))
+ if (user->HasPrivPermission("users/auspex"))
opt_unlimit = true;
break;
case 'r':
opt_realname = true;
break;
case 'm':
- opt_mode = true;
+ if (user->HasPrivPermission("users/auspex"))
+ opt_mode = true;
break;
case 'M':
- opt_metadata = true;
+ if (user->HasPrivPermission("users/auspex"))
+ opt_metadata = true;
break;
case 'i':
opt_ident = true;
break;
case 'p':
- opt_port = true;
+ if (user->HasPrivPermission("users/auspex"))
+ opt_port = true;
break;
case 'a':
opt_away = true;
break;
case 'l':
- opt_local = true;
+ if (user->HasPrivPermission("users/auspex") || !*ServerInstance->Config->HideWhoisServer)
+ opt_local = true;
break;
case 'f':
- opt_far = true;
+ if (user->HasPrivPermission("users/auspex") || !*ServerInstance->Config->HideWhoisServer)
+ opt_far = true;
break;
case 't':
opt_time = true;
if (CanView(ch,user))
{
bool inside = ch->HasUser(user);
-
+
/* who on a channel. */
CUList *cu = ch->GetUsers();
-
+
for (CUList::iterator i = cu->begin(); i != cu->end(); i++)
{
/* None of this applies if we WHO ourselves */
/* opers only, please */
if (opt_viewopersonly && !IS_OPER(i->first))
continue;
-
+
/* If we're not inside the channel, hide +i users */
- if (i->first->IsModeSet('i') && !inside && !IS_OPER(user))
+ if (i->first->IsModeSet('i') && !inside && !user->HasPrivPermission("users/auspex"))
continue;
}
-
+
SendWhoLine(user, initial, ch, i->first, whoresults);
}
}
{
if (!user->SharesChannelWith(oper))
{
- if (usingwildcards && (!oper->IsModeSet('i')) && (!IS_OPER(user)))
+ if (usingwildcards && (!oper->IsModeSet('i')) && (!user->HasPrivPermission("users/auspex")))
continue;
}
{
if (!user->SharesChannelWith(i->second))
{
- if (usingwildcards && (i->second->IsModeSet('i')) && (!IS_OPER(user)))
+ if (usingwildcards && (i->second->IsModeSet('i')) && (!user->HasPrivPermission("users/auspex")))
continue;
}
return CMD_FAILURE;
}
}
-