added "nowho" parameter to debug userlist and fixed memory leak in DBHelper.c
[NeonServV5.git] / src / cmd_global_command.c
index 1382296a841f06f4672f45cb8a034d7b7452c222..594ea1bc4002f27672e8e708e013813fa2c5b0c4 100644 (file)
@@ -1,5 +1,5 @@
-/* cmd_global_command.c - NeonServ v5.2
- * Copyright (C) 2011  Philipp Kreil (pk910)
+/* cmd_global_command.c - NeonServ v5.3
+ * Copyright (C) 2011-2012  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@ CMD_BIND(global_cmd_command) {
     char *ident;
     MYSQL_RES *res;
     MYSQL_ROW row;
-    struct cmd_binding *cbind = find_cmd_binding(client->botid, argv[0]);
+    struct cmd_binding *cbind = find_botwise_cmd_binding(client->botid, client->clientid, argv[0]);
     if (!cbind) {
         reply(getTextBot(), user, "NS_UNBIND_NOT_FOUND", argv[0]);
         return;
@@ -138,6 +138,10 @@ static int global_cmd_command_chanaccess(struct cmd_binding *cbind, struct ChanN
                 *str_b = '\0';
                 str_b++;
             }
+            if(*str_a == '@' || *str_a == '+') {
+                //privs can override this access requirement
+                str_a++;
+            }
             if(*str_a == '#') {
                 str_a++;
                 access_pos += sprintf(access_list+access_pos, (access_pos ? ", `%s`" : "`%s`"), str_a);