Author Topic: Adduser Command  (Read 2988 times)

0 Members and 2 Guests are viewing this topic.

Offline Wrath

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Adduser Command
« 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!

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Adduser Command
« Reply #1 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.
Experiencing God's grace one day at a time.

Offline Wrath

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Adduser Command
« Reply #2 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!

Offline Wrath

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Adduser Command
« Reply #3 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

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Adduser Command
« Reply #4 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.
« Last Edit: December 05, 2014, 08:38:13 PM by Bite That Apple »
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Wrath

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Adduser Command
« Reply #5 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

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Adduser Command
« Reply #6 on: December 06, 2014, 12:00:40 PM »
You're welcome, and now I learned something myself too.
« Last Edit: December 07, 2014, 07:28:24 PM by JamminR »
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Adduser Command
« Reply #7 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.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming