• Print

Author Topic: Commands without category?  (Read 11465 times)

0 Members and 1 Guest are viewing this topic.

Offline TheNoobKid

  • Newbie
  • *
  • Posts: 25
  • Karma: -1
Commands without category?
« on: March 09, 2016, 08:27:49 am »
Hello.

Isn't it possible to make commands in ULX without making them into a category in ULX !menu.
I tried to remove the category code from the code, but it's screwing up.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Commands without category?
« Reply #1 on: March 09, 2016, 08:57:34 am »
Free-floating commands are unsupported, as far as i know. If you specify nil as the category name, they go into the section named "_UncategorizedCmds", if I recall correctly.
bw81@ulysses-forums ~ % whoami
Homepage

Offline TheNoobKid

  • Newbie
  • *
  • Posts: 25
  • Karma: -1
Re: Commands without category?
« Reply #2 on: March 09, 2016, 09:43:22 am »
Doesn't work.

The problem is that I have a undercover script, but everyone can use it and that is after I restrict it to superadmins only.
Quote
undercover:defaultAccess( ULib.ACCESS_SUPERADMIN )

When I remove admins access to it via ULX groups etc, then no one can use it..

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Commands without category?
« Reply #3 on: March 09, 2016, 10:12:32 am »
Doesn't work.

The problem is that I have a undercover script, but everyone can use it and that is after I restrict it to superadmins only.
When I remove admins access to it via ULX groups etc, then no one can use it..
Hang on... reword that, I'm confused.
Can you post your code? I'm not sure what exactly your issue is now.
bw81@ulysses-forums ~ % whoami
Homepage

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Commands without category?
« Reply #4 on: March 09, 2016, 10:19:09 am »
Categories are completely separate from permissions. Categories are just a way to organize things in the menu and help, they have no other purpose.

Otherwise, I agree with Bytewave in confusion as to what your underlying issue is.
Experiencing God's grace one day at a time.

Offline TheNoobKid

  • Newbie
  • *
  • Posts: 25
  • Karma: -1
Re: Commands without category?
« Reply #5 on: March 09, 2016, 10:27:26 am »
Sure.

Quote
function ulx.undercover( calling_ply )
 
   if calling_ply:IsUserGroup("owner") then
      calling_ply:SetUserGroup("undercover")
 
   elseif calling_ply:IsUserGroup("undercover") then
      calling_ply:SetUserGroup("owner")
   end
 
--ulx.fancyLogAdmin( calling_ply, true, "#A went undercover" )
end

local undercover = ulx.command( CATEGORY_NAME, "ulx owner", ulx.undercover, "!under1", true )
undercover:addParam{ type=ULib.cmds.PlayerArg }
undercover:defaultAccess( ULib.ACCESS_SUPERADMIN )
undercover:help( "UNDERCOVER BIIIIACH!!" )

If I remove CATEGORY_NAME or add nil there, I'm getting lua errors. I want to remove it completely from the category list in ULX.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Commands without category?
« Reply #6 on: March 09, 2016, 02:43:42 pm »
You want to remove it from ULX help and XGUI? Only those with permission to use it can see it. Sounds like you may just have it configured for open access right now. Default access is only a default, servers can override that.
Experiencing God's grace one day at a time.

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Commands without category?
« Reply #7 on: March 10, 2016, 04:35:54 am »
If this is the FULL code you're trying, CATEGORY_NAME is not defined/declared.

Code: Lua
  1. function ulx.undercover( calling_ply )
  2.  
  3.    if calling_ply:IsUserGroup("owner") then
  4.       calling_ply:SetUserGroup("undercover")
  5.  
  6.    elseif calling_ply:IsUserGroup("undercover") then
  7.       calling_ply:SetUserGroup("owner")
  8.    end
  9.  
  10. --ulx.fancyLogAdmin( calling_ply, true, "#A went undercover" )
  11. end
  12.  
  13. local undercover = ulx.command( CATEGORY_NAME, "ulx owner", ulx.undercover, "!under1", true )
  14. undercover:addParam{ type=ULib.cmds.PlayerArg }
  15. undercover:defaultAccess( ULib.ACCESS_SUPERADMIN )
  16. undercover:help( "UNDERCOVER BIIIIACH!!" )
  17.  

Code: Lua
  1. local CATEGORY_NAME = "Undercover"
  2.  
  3. -- code
  4.  
  5.  

Offline TheNoobKid

  • Newbie
  • *
  • Posts: 25
  • Karma: -1
Re: Commands without category?
« Reply #8 on: March 10, 2016, 07:27:00 am »
Yeah but I don't want this code to be part of a category.
And if I remove CATEGORY_NAME, the code doesnt work.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Commands without category?
« Reply #9 on: March 10, 2016, 07:37:27 am »
Yeah but I don't want this code to be part of a category.
And if I remove CATEGORY_NAME, the code doesnt work.
I'm still not sure what you're trying to accomplish here.
This command is a security hole waiting to happen. Anyone with enough know-how could probably find out about the existence of a ulx owner command and, if you're giving users access to that command, you're essentially leaving an account with root without a password.

I think something like Fakename might execute it better, but I've never tried it, so I can't say.
bw81@ulysses-forums ~ % whoami
Homepage

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: Commands without category?
« Reply #10 on: March 10, 2016, 07:47:09 am »
Again, like others have said, I don't think that changing or hiding the category will do what you want it to. The command will still show up in ULX Menu regardless- there's no way to "hide" it from people who have access to it.

The problem is that I have a undercover script, but everyone can use it and that is after I restrict it to superadmins only.

Code: [Select]
undercover:defaultAccess( ULib.ACCESS_SUPERADMIN )When I remove admins access to it via ULX groups etc, then no one can use it..

So, "defaultAccess" will set up the INITIAL permissions the FIRST time the command has been run. It sounds like this was set to Admins when you first ran your code, so ULX gave your admins group access to "ulx undercover". Then, you changed it to Superadmin, which has no effect for you now because the permissions have already been set up. (Superadmins have access to the command through inheritance, which means removing it from admins causes superadmins not to be able to use it.)

In order to reset this, you should open your data/ulib/groups.txt file, and remove any lines that that give access to "ulx undercover". Then, find the misc_registered.txt file in the same group, and also remove the line that says "ulx undercover". Once you've done this, restart your server, and the command should be given access to Superadmins by default.
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline TheNoobKid

  • Newbie
  • *
  • Posts: 25
  • Karma: -1
Re: Commands without category?
« Reply #11 on: March 12, 2016, 01:36:21 pm »
Yes okay.

I have dropped the idea to remove this from the category.
But does any of you know why the script gonna be removed if I remove admins access to use this?

If 'admin' rank have access to this script. Then all ranks except user and donators can see it in ULX menu.
But if I remove 'admin' ranks access to use this script, then no one can see it in ULX. ?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Commands without category?
« Reply #12 on: March 12, 2016, 10:56:45 pm »
Your other groups are inheriting from 'admin' and getting access to the command. What groups do you want to have access?
Experiencing God's grace one day at a time.

Offline TheNoobKid

  • Newbie
  • *
  • Posts: 25
  • Karma: -1
Re: Commands without category?
« Reply #13 on: March 12, 2016, 11:46:08 pm »
I only want rank 'owner' to have access to this.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Commands without category?
« Reply #14 on: March 13, 2016, 10:06:30 am »
Give the owner group access and no other group.
Experiencing God's grace one day at a time.

  • Print