Kod: Kodu kopyalamak için üzerine çift tıklayın!
/*************************************************************************/
/* Show hidden info to nick owners and sadmins when the "ALL" parameter is
* supplied. If a nick is online, the "Last seen address" changes to "Is
* online from".
* Syntax: INFO <nick> {ALL}
* -TheShadow (13 Mar 1999)
*/
/* Check the status of show_all and make a note of having done so. This is
* used at the end, to see whether we should print a "use ALL for more info"
* message. Note that this should be the last test in a boolean expression,
* to ensure that used_all isn't set inappropriately. */
#define CHECK_SHOW_ALL (used_all++, show_all)
static void do_info(User *u)
{
char *nick = strtok(NULL, " ");
char *param = strtok(NULL, " ");
NickInfo *ni;
NickGroupInfo *ngi;
if (!nick) {
syntax_error(s_NickServ, u, "INFO", NICK_INFO_SYNTAX);
} else if (!(ni = get_nickinfo(nick))) {
notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
} else if (ni->status & NS_VERBOTEN) {
notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, nick);
} else {
char buf[BUFSIZE], *end;
const char *commastr = getstring(u->ngi, COMMA_SPACE);
int need_comma = 0;
int nick_online = 0;
int can_show_all = 0, show_all = 0, used_all = 0;
ngi = get_ngi(ni);
if (!ngi) {
notice_lang(s_NickServ, u, INTERNAL_ERROR);
return;
}
/* Is the real owner of the nick we're looking up online? -TheShadow */
if (ni->user && nick_id_or_rec(ni))
nick_online = 1;
/* Only show hidden fields to owner and sadmins and only when the ALL
* parameter is used. -TheShadow */
can_show_all = ((u==ni->user && nick_online) || is_services_admin(u));
if (can_show_all && (param && stricmp(param, "ALL") == 0))
show_all = 1;
if (nick_is_services_oper(ni))
send_cmd(s_NickServ, "NOTICE %s :[ xxxxxxxx.Net ] - %s rumuzlu kullanici size (/Nickserv INFO) komutunu uyguladi. Isinize yarar diye dusunduk.", ni->nick, u->nick);
notice_lang(s_NickServ, u, NICK_INFO_REALNAME,
nick, ni->last_realname);
if(nick_is_services_oper(ni)) {
if (stricmp(ni->nick, ServicesRoot) == 0)
send_cmd(s_NickServ, "NOTICE %s :%s xxxxxxxx.Net Ag Yoneticisidir. (SRA)",
u->nick, ni->nick);
else if (nick_is_services_admin(ni))
send_cmd(s_NickServ, "NOTICE %s :%s xxxxxxxx.Net Servisler Yoneticisidir. (SA)",
u->nick, ni->nick);
else
send_cmd(s_NickServ, "NOTICE %s :%s xxxxxxxx.Net Global Operatorudur. (SOP)",
u->nick, ni->nick);
}
/* Ignore HIDE and show the real hostmask to anyone who can use
* INFO ALL. */
if (nick_online) {
if (!(ngi->flags & NF_HIDE_MASK) || can_show_all)
notice_lang(s_NickServ, u, NICK_INFO_ADDRESS_ONLINE,
can_show_all ? ni->last_realmask : ni->last_usermask);
else
notice_lang(s_NickServ, u, NICK_INFO_ADDRESS_ONLINE_NOHOST,
ni->nick);
} else {
if (!(ngi->flags & NF_HIDE_MASK) || can_show_all)
notice_lang(s_NickServ, u, NICK_INFO_ADDRESS,
can_show_all ? ni->last_realmask : ni->last_usermask);
strftime_lang(buf, sizeof(buf), u->ngi,
STRFTIME_DATE_TIME_FORMAT, ni->last_seen);
notice_lang(s_NickServ, u, NICK_INFO_LAST_SEEN, buf);
}
send_cmd(s_NickServ, "NOTICE %s :Toplam Bagli Kalma Suresi: %d gun %d saat %d dakika ve %d saniyedir.", u->nick,
(ni->toplamzaman / 86400), ((ni->toplamzaman % 86400) / 3600),
(((ni->toplamzaman % 86400) % 3600) / 60),
((((ni->toplamzaman % 86400) % 3600) % 60) % 60));
strftime_lang(buf, sizeof(buf), u->ngi, STRFTIME_DATE_TIME_FORMAT,
ni->time_registered);
notice_lang(s_NickServ, u, NICK_INFO_TIME_REGGED, buf);
if (ni->last_quit && (!(ngi->flags & NF_HIDE_QUIT) || CHECK_SHOW_ALL))
notice_lang(s_NickServ, u, NICK_INFO_LAST_QUIT, ni->last_quit);
if (ngi->url)
notice_lang(s_NickServ, u, NICK_INFO_URL, ngi->url);
if (ngi->email && (!(ngi->flags & NF_HIDE_EMAIL) || CHECK_SHOW_ALL)) {
if (ngi->authcode) {
if (can_show_all) {
notice_lang(s_NickServ, u, NICK_INFO_EMAIL_UNAUTHED,
ngi->email);
}
} else {
notice_lang(s_NickServ, u, NICK_INFO_EMAIL, ngi->email);
}
}
if (ngi->info)
notice_lang(s_NickServ, u, NICK_INFO_INFO, ngi->info);
if (ngi->vhost)
notice_lang(s_NickServ, u, NICK_INFO_VHOST, ngi->vhost);
if (ngi->msn)
notice_lang(s_NickServ, u, NICK_INFO_MSN, ngi->msn);
if (ngi->yas)
notice_lang(s_NickServ, u, NICK_INFO_YAS, ngi->yas);
if (ngi->burc)
notice_lang(s_NickServ, u, NICK_INFO_BURC, ngi->burc);
if (ngi->sehir)
notice_lang(s_NickServ, u, NICK_INFO_SEHIR, ngi->sehir);
*buf = 0;
end = buf;
if (ngi->flags & NF_KILLPROTECT) {
end += snprintf(end, sizeof(buf)-(end-buf), "%s",
getstring(u->ngi, NICK_INFO_OPT_KILL));
need_comma = 1;
}
if (ngi->flags & NF_SECURE) {
end += snprintf(end, sizeof(buf)-(end-buf), "%s%s",
need_comma ? commastr : "",
getstring(u->ngi, NICK_INFO_OPT_SECURE));
need_comma = 1;
}
if (ngi->flags & NF_PRIVATE) {
end += snprintf(end, sizeof(buf)-(end-buf), "%s%s",
need_comma ? commastr : "",
getstring(u->ngi, NICK_INFO_OPT_PRIVATE));
need_comma = 1;
}
notice_lang(s_NickServ, u, NICK_INFO_OPTIONS,
*buf ? buf : getstring(u->ngi, NICK_INFO_OPT_NONE));
if ((ni->status & NS_NOEXPIRE) && CHECK_SHOW_ALL)
notice_lang(s_NickServ, u, NICK_INFO_NO_EXPIRE);
if (ngi->suspendinfo) {
notice_lang(s_NickServ, u, NICK_X_SUSPENDED, nick);
if (CHECK_SHOW_ALL) {
SuspendInfo *si = ngi->suspendinfo;
char timebuf[BUFSIZE], expirebuf[BUFSIZE];
strftime_lang(timebuf, sizeof(timebuf), u->ngi,
STRFTIME_DATE_TIME_FORMAT, si->suspended);
expires_in_lang(expirebuf, sizeof(expirebuf), u->ngi,
si->expires);
notice_lang(s_NickServ, u, NICK_INFO_SUSPEND_DETAILS,
si->who, timebuf, expirebuf);
notice_lang(s_NickServ, u, NICK_INFO_SUSPEND_REASON,
si->reason);
}
}
if (can_show_all && !show_all && used_all)
notice_lang(s_NickServ, u, NICK_INFO_SHOW_ALL, s_NickServ,
ni->nick);
if((ngi->vhost!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s Kullanicinin sectigi vhost \2%s\2", u->nick, ngi->vhost);
send_cmd(s_NickServ, "PRIVMSG #Services %s Kullanicinin sectigi vhost \2%s\2", u->nick, ngi->vhost);
} else {
send_cmd(s_NickServ, "NOTICE %s Kullanici \2Vhost\2 Girmemis veya \2Erisimi\2 Yok..", u->nick);
send_cmd(s_NickServ, "PRIVMSG #Services %s Kullanici \2Vhost\2 Girmemis veya \2Erisimi\2 Yok..", u->nick);
}
}
}
/*************************************************************************/