1 /* cmd_global_staff.c - NeonServ v5.6
2 * Copyright (C) 2011-2012 Philipp Kreil (pk910)
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #include "cmd_global.h"
24 CMD_BIND(global_cmd_staff) {
25 MYSQL_RES *res, *res2;
27 printf_mysql_query("SELECT `rank_id`, `rank_name` FROM `support_ranks` ORDER BY `rank_order` ASC");
29 while ((row = mysql_fetch_row(res)) != NULL) {
30 printf_mysql_query("SELECT `user_user`, `user_god` FROM `users` WHERE `user_rank` = '%s'", row[0]);
32 if(mysql_num_rows(res2)) {
33 reply(textclient, user, "\002%s\002", row[1]);
34 while ((row2 = mysql_fetch_row(res2)) != NULL) {
35 if(strcmp(row2[1], "0")) {
36 //god enabled - show nicks
37 char loggedinBuf[MAXLEN];
39 struct UserNode *cuser;
40 for(cuser = getUsersWithAuth(row2[0], NULL); cuser; cuser = getUsersWithAuth(row2[0], cuser)) {
41 loggedinPos += sprintf(loggedinBuf+loggedinPos, (loggedinPos ? ", %s" : "%s"), cuser->nick);
44 reply(textclient, user, " %s (%s: %s)", row2[0], get_language_string(user, "NS_STAFF_LOGGEDIN"), loggedinBuf);
46 reply(textclient, user, " %s", row2[0]);
48 reply(textclient, user, " %s", row2[0]);