projects
/
NeonServV5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed getTextBot() function and added textbot parameter to the CMD_BIND header...
[NeonServV5.git]
/
src
/
modules
/
global.mod
/
cmd_global_setaccess.c
diff --git
a/src/modules/global.mod/cmd_global_setaccess.c
b/src/modules/global.mod/cmd_global_setaccess.c
index f69b3c04616f363f49346f75b6130da80038622f..c931640391b38d56afb7f7d9e5188fc7c17bc0c0 100644
(file)
--- a/
src/modules/global.mod/cmd_global_setaccess.c
+++ b/
src/modules/global.mod/cmd_global_setaccess.c
@@
-39,13
+39,13
@@
CMD_BIND(global_cmd_setaccess) {
MYSQL_ROW row;
caccess = atoi(argv[1]);
if(caccess < 0 || caccess > 1000) {
MYSQL_ROW row;
caccess = atoi(argv[1]);
if(caccess < 0 || caccess > 1000) {
- reply(
getTextBot()
, user, "NS_INVALID_ACCESS", caccess);
+ reply(
textclient
, user, "NS_INVALID_ACCESS", caccess);
return;
}
printf_mysql_query("SELECT `user_access` FROM `users` WHERE `user_user` = '%s'", escape_string(user->auth));
res = mysql_use();
if ((row = mysql_fetch_row(res)) == NULL || atoi(row[0]) < caccess) {
return;
}
printf_mysql_query("SELECT `user_access` FROM `users` WHERE `user_user` = '%s'", escape_string(user->auth));
res = mysql_use();
if ((row = mysql_fetch_row(res)) == NULL || atoi(row[0]) < caccess) {
- reply(
getTextBot()
, user, "NS_ACCESS_OUTRANKED");
+ reply(
textclient
, user, "NS_ACCESS_OUTRANKED");
return;
}
if(argv[0][0] == '*') {
return;
}
if(argv[0][0] == '*') {
@@
-54,7
+54,7
@@
CMD_BIND(global_cmd_setaccess) {
printf_mysql_query("SELECT `user_user` FROM `users` WHERE `user_user` = '%s'", escape_string(argv[0]));
res = mysql_use();
if ((row = mysql_fetch_row(res)) != NULL) {
printf_mysql_query("SELECT `user_user` FROM `users` WHERE `user_user` = '%s'", escape_string(argv[0]));
res = mysql_use();
if ((row = mysql_fetch_row(res)) != NULL) {
- global_cmd_setaccess_async1(client,
getTextBot()
, user, event, argv[0], row[0], caccess);
+ global_cmd_setaccess_async1(client,
textclient
, user, event, argv[0], row[0], caccess);
} else {
//we need to create a new user...
//but first lookup the auth to check if it really exists
} else {
//we need to create a new user...
//but first lookup the auth to check if it really exists
@@
-64,7
+64,7
@@
CMD_BIND(global_cmd_setaccess) {
return;
}
cache->client = client;
return;
}
cache->client = client;
- cache->textclient =
getTextBot()
;
+ cache->textclient =
textclient
;
cache->user = user;
cache->event = event;
cache->access = caccess;
cache->user = user;
cache->event = event;
cache->access = caccess;
@@
-76,13
+76,13
@@
CMD_BIND(global_cmd_setaccess) {
if(!cuser) {
cuser = createTempUser(argv[0]);
if(!cuser) {
if(!cuser) {
cuser = createTempUser(argv[0]);
if(!cuser) {
- reply(
getTextBot()
, user, "NS_USER_UNKNOWN", argv[0]);
+ reply(
textclient
, user, "NS_USER_UNKNOWN", argv[0]);
return;
}
cuser->flags |= USERFLAG_ISTMPUSER;
}
if(cuser->flags & USERFLAG_ISAUTHED) {
return;
}
cuser->flags |= USERFLAG_ISTMPUSER;
}
if(cuser->flags & USERFLAG_ISAUTHED) {
- global_cmd_setaccess_async1(client,
getTextBot()
, user, event, argv[0], cuser->auth, caccess);
+ global_cmd_setaccess_async1(client,
textclient
, user, event, argv[0], cuser->auth, caccess);
} else {
struct global_cmd_setaccess_cache *cache = malloc(sizeof(*cache));
if (!cache) {
} else {
struct global_cmd_setaccess_cache *cache = malloc(sizeof(*cache));
if (!cache) {
@@
-90,7
+90,7
@@
CMD_BIND(global_cmd_setaccess) {
return;
}
cache->client = client;
return;
}
cache->client = client;
- cache->textclient =
getTextBot()
;
+ cache->textclient =
textclient
;
cache->user = user;
cache->event = event;
cache->access = caccess;
cache->user = user;
cache->event = event;
cache->access = caccess;