- snprintf(junk,MAXBUF,"%s%s=+%s@%s ",u->nick,*u->oper ? "*" : "",u->ident,u->GetIPString());
- strlcat(Return,junk,MAXBUF);
+ // Anyone may query their own IP
+ if (u != user)
+ {
+ if (!checked_privs)
+ {
+ // Do not trigger the insufficient priviliges message more than once
+ checked_privs = true;
+ has_privs = user->HasPrivPermission("users/auspex");
+ if (!has_privs)
+ user->WriteNumeric(ERR_NOPRIVILEGES, "%s :Permission Denied - You do not have the required operator privileges",user->nick.c_str());
+ }
+
+ if (!has_privs)
+ continue;
+ }
+
+ retbuf = retbuf + u->nick + (IS_OPER(u) ? "*" : "") + "=";
+ if (IS_AWAY(u))
+ retbuf += "-";
+ else
+ retbuf += "+";
+ retbuf += u->ident + "@" + u->GetIPString() + " ";
+ nicks++;