Ulysses

General => Developers Corner => Topic started by: Wrath on November 28, 2014, 11:00:11 AM

Title: Adduser Command
Post by: Wrath on November 28, 2014, 11:00:11 AM
Hi, before I begin, I'd like to apologize if this is in the wrong section or has already been asked. I have used to search feature to look for a similar thread, but I was unable to find anything.

Anyway, I was looking for a command that would add a user to a specific group. For example, I want a command called 'ulx addadmin' and this command could be used to change a user to the Admin user group. Of course, I know ULX already has a 'ulx adduser' command, but this is a bit different. I have looked at the code, but I wasn't sure what to change to suit my needs. Thanks for anyone who is able to help!
Title: Re: Adduser Command
Post by: Megiddo on November 28, 2014, 11:35:55 AM
What's the underlying reason? Are you looking to restrict people to only being able to promote users to certain groups? If so, you can just restrict them using the permission system.
Title: Re: Adduser Command
Post by: Wrath on November 28, 2014, 11:44:56 AM
What's the underlying reason? Are you looking to restrict people to only being able to promote users to certain groups? If so, you can just restrict them using the permission system.
Oh, I was unaware of that. Thanks!
Title: Re: Adduser Command
Post by: Wrath on December 05, 2014, 07:20:27 PM
It's been a while since I've owned a Gmod server. Please refresh my memory on how to restrict this command? Thanks. xD
Title: Re: Adduser Command
Post by: Bite That Apple on December 05, 2014, 08:09:13 PM
It's been a while since I've owned a Gmod server. Please refresh my memory on how to restrict this command? Thanks. xD

Well, from what I understand he's saying you can restrict certain groups from being allowed to promoted in ulx adduser, but as far as I know that's not possible. Though I'm going to check again, but I've never seen anything like that before. I know some commands can be restricted when you click on them, and another box opens on the right, but I'll get back to you if he doesn't first.

Edit:
Actually, after further inquiry, I found that you can restrict (whitelist)  adduser. So this is how you do it, !menu -> Groups, so in there you then select a group that you want to be able to give adduser to w/e they want another player to do. Then you click "Restrict Group" and add the name of a group you want that selected group to be able to addusers to. So because I may have not explained it correctly, I'll say an example.

Lets say I have five groups (from least power to most power): Regular -> Senior -> Moderator -> Administrator -> Super Administrator
So lets say you want Moderators to be able to adduser to Senior, but not to be able to add users to Admin or Super admin usergroup, you then select Moderator group, click under "Manage Permissions", then find "Cmds - User Management", then turn on ulx adduser for the Moderator usergroup. Now that its on, click (or highlight) the actual command, and a new box will appear on the right, saying "Restrict Group", turn that on, and type the name "Senior" (when I say name, I also mean the actual group name, not the team name), then click "Add". Then we repeat, and do the same thing for "Regular", so when you're done, you should see in the "Whitelist String Value", two names, one being; "Senior", and the other being "Regular", if you see that, then you can hit "Apply Restrictions".

If you've done that all correctly, Moderator should only be able to add any user who is not above their rank, to any rank below theirs.
Title: Re: Adduser Command
Post by: Wrath on December 05, 2014, 10:35:49 PM
Thanks so much for the reply! I now have the groups restricted as I want them. Thanks again for the good explanation!
:D
Title: Re: Adduser Command
Post by: Bite That Apple on December 06, 2014, 12:00:40 PM
You're welcome, and now I learned something myself too.
Title: Re: Adduser Command
Post by: JamminR on December 07, 2014, 07:27:57 PM
You both know better.
Don't say anything else.
I was ignoring it...now I've had to do something about it.