projects
/
NeonServV5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** VERSION 5.6.0 ***
[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 8d1ffe20225da4e6ee8daccce6dd3b3d47ec88c1..f568ff0004e9d7e479b8ebacf9f100d7955b6948 100644
(file)
--- a/
src/modules/global.mod/cmd_global_setaccess.c
+++ b/
src/modules/global.mod/cmd_global_setaccess.c
@@
-1,4
+1,4
@@
-/* cmd_global_setaccess.c - NeonServ v5.
3
+/* cmd_global_setaccess.c - NeonServ v5.
6
* Copyright (C) 2011-2012 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
* Copyright (C) 2011-2012 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
@@
-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;