]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Fixed bug #85
[user/henk/code/inspircd.git] / src / users.cpp
index 2c36a444c94dd301419bb7e5234b1349d3396629..1920e8dcdf9c070a7700fdf3877f8fddff412721 100644 (file)
@@ -27,6 +27,7 @@ using namespace std;
 #include <signal.h>
 #endif
 #include "inspstring.h"
+#include "commands.h"
 #include "helperfuncs.h"
 
 extern std::stringstream config_f;
@@ -66,13 +67,6 @@ userrec::userrec()
 
 userrec::~userrec()
 {
-#ifdef THREADED_DNS
-       // for local clients, clean up their dns thread
-       if (!strcmp(this->server,ServerName))
-       {
-               pthread_kill(this->dnsthread,9);
-       }
-#endif
 }
 
 void userrec::CloseSocket()
@@ -173,33 +167,26 @@ bool userrec::HasPermission(char* command)
        // are they even an oper at all?
        if (strchr(this->modes,'o'))
        {
-               log(DEBUG,"*** HasPermission: %s is an oper",this->nick);
                for (int j =0; j < ConfValueEnum("type",&config_f); j++)
                {
                        ConfValue("type","name",j,TypeName,&config_f);
                        if (!strcmp(TypeName,this->oper))
                        {
-                               log(DEBUG,"*** HasPermission: %s is an oper of type '%s'",this->nick,this->oper);
                                ConfValue("type","classes",j,Classes,&config_f);
                                char* myclass = strtok_r(Classes," ",&savept);
                                while (myclass)
                                {
-                                       log(DEBUG,"*** HasPermission: checking classtype '%s'",myclass);
                                        for (int k =0; k < ConfValueEnum("class",&config_f); k++)
                                        {
                                                ConfValue("class","name",k,ClassName,&config_f);
                                                if (!strcmp(ClassName,myclass))
                                                {
                                                        ConfValue("class","commands",k,CommandList,&config_f);
-                                                       log(DEBUG,"*** HasPermission: found class named %s with commands: '%s'",ClassName,CommandList);
-                                                       
-                                                       
                                                        mycmd = strtok_r(CommandList," ",&savept2);
                                                        while (mycmd)
                                                        {
-                                                               if (!strcasecmp(mycmd,command))
+                                                               if ((!strcasecmp(mycmd,command)) || (*mycmd == '*'))
                                                                {
-                                                                       log(DEBUG,"*** Command %s found, returning true",command);
                                                                        return true;
                                                                }
                                                                mycmd = strtok_r(NULL," ",&savept2);