bugfixes in command "oset"
authorNurPech <nurpech@nurpech.de>
Mon, 7 Jan 2013 20:56:06 +0000 (21:56 +0100)
committerNurPech <nurpech@nurpech.de>
Mon, 7 Jan 2013 20:56:06 +0000 (21:56 +0100)
update example configuration file

src/mod-hostserv.c
srvx.conf.example

index 234d6100a028cb08bcd1f418fc541cb1b7394a75..a652043519c83565eb9ad0b22d53ab89eee6fa96 100644 (file)
@@ -29,6 +29,8 @@
  *         "manager_can_del_toplevel" "0"; //managers of a toplevel group may delete the whole group
  *         "manager_can_rename_secondlevel" "0"; //managers of a secondlevel group may rename the whole group
  *         "manager_can_del_secondlevel" "0"; //managers of a secondlevel group may delete the whole group
+ *                "manager_toplevel_can_oset" "0"; //managers of a toplevel group can set other user's fakehosts
+ *         "manager_secondlevel_can_oset" "0"; //managers of a secondlevel group can set other user's fakehosts
  *     };
  *  };
  *
@@ -1165,7 +1167,7 @@ static MODCMD_FUNC(cmd_unassign) {
 static MODCMD_FUNC(cmd_oset) {
     struct handle_info *hi;
     char *fakehost;
-       struct hs_assignment *assgn;
+       struct hs_assignment *assignment;
     if(!strchr(argv[1], '.')) {
         if (!(hi = modcmd_get_handle_info(user, argv[1])))
             return 0;
@@ -1179,8 +1181,9 @@ static MODCMD_FUNC(cmd_oset) {
         reply("NSMSG_MUST_AUTH");
         return 0;
     }
+       struct hs_user *hs_user = hs_get_user(hi, 1);
        if(!strcmp(argv[1], "*")) {
-               if(!check_management_access(user->handle_info)) {
+               if(!check_management_access(user->handle_info, NULL, NULL)) {
             reply("HSMSG_ACCESS_DENIED");
             return 0;
         }
@@ -1195,11 +1198,12 @@ static MODCMD_FUNC(cmd_oset) {
            reply("HSMSG_UNKNOWN_FAKEHOST", fhinfo.slfh_name, fhinfo.tlfh_name);
            return 0;
         }
-        struct hs_user *hs_user = hs_get_user(hi, 1);
         if(!check_management_access(user->handle_info, (hostserv_conf.manager_toplevel_can_oset ? fhinfo.tlfh : NULL), (hostserv_conf.manager_secondlevel_can_oset ? fhinfo.slfh : NULL))) {
             reply("HSMSG_ACCESS_DENIED");
             return 0;
         }
+               struct hs_toplevel *tlfh;
+               struct hs_secondlevel *slfh;
         for(assignment = hs_user->assignments; assignment; assignment = assignment->unext) {
             slfh = assignment->secondlevel;
             tlfh = slfh->toplevel;
index f8acd0d752205da2da800ee868b9328d6d99b346..84409edc0479db95737f784eee4730566c922ed1 100644 (file)
         "gline_duration" "1h";
         "punishment_reason" "Your message contained a forbidden word.";
     };
+       
+       "hostserv" {
+           "nick" "HostServ";
+           "modes" "+iokSD";
+           "toplevel_access" "600";
+           "fallback_other_assignment" "1";
+           "manager_can_del_toplevel" "0";
+           "manager_can_del_secondlevel" "0";
+           "manager_can_rename_toplevel" "0";
+           "manager_can_rename_secondlevel" "0";
+           "manager_toplevel_can_oset" "0";
+           "manager_secondlevel_can_oset" "0";
+    };
 };
 
 "policers" {