• Print

Author Topic: Change name of default user group ('user')  (Read 10481 times)

0 Members and 1 Guest are viewing this topic.

Offline zassadgh

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Change name of default user group ('user')
« on: August 31, 2014, 11:12:32 am »
Hello, I am trying to change the group name of the default group named 'user' to something like 'guest', what is the correct way to do this?

Thank you in advance

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: Change name of default user group ('user')
« Reply #1 on: August 31, 2014, 02:35:22 pm »
Don't. If you really need to make another level, make one called "member" or something; but don't rename user.
Once you get to know me, you'll find you'll have never met me at all.

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Change name of default user group ('user')
« Reply #2 on: August 31, 2014, 03:49:49 pm »
You can't rename user through xgui anyway.
Out of the Garry's Mod business.

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: Change name of default user group ('user')
« Reply #3 on: August 31, 2014, 10:46:31 pm »
true that ^
Once you get to know me, you'll find you'll have never met me at all.

Offline zassadgh

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Change name of default user group ('user')
« Reply #4 on: September 01, 2014, 06:19:44 am »
You can't rename user through xgui anyway.
I know, I was thinking more of a hook/modifying files or would it that big of a problem to rename user? (does ulx even interact/grab any information by the group name 'user', it is only the Ulib that does anything with it, right. In that case what would be so bad by renaming it?)

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: Change name of default user group ('user')
« Reply #5 on: September 01, 2014, 06:34:34 am »
anything not admin or superadmin, ULX (and GMod) will assume it's user. If there's no user, the whole thing will blow up in your face. Literally 0_0.

Nah, jk. But don't edit user. Like Neku said, you can't anyway for that exact reason.
Once you get to know me, you'll find you'll have never met me at all.

Offline zassadgh

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Change name of default user group ('user')
« Reply #6 on: September 01, 2014, 07:24:46 am »
there will he users in the sense that it will be renamed guest (weird that the default group is not name guest, just to point that out.)
Does ULX anywhere in it's code request any group by the name 'user' or is it only Ulib I then have to modify?

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Change name of default user group ('user')
« Reply #7 on: September 01, 2014, 08:54:00 am »
Just make a group called guest and a hook to automatically add them to guest when they join.
Out of the Garry's Mod business.

Offline zassadgh

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Change name of default user group ('user')
« Reply #8 on: September 01, 2014, 09:04:45 am »
thats a solution I like, now some help how this would be done, would be just what I need.

Offline zassadgh

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Change name of default user group ('user')
« Reply #9 on: September 02, 2014, 12:14:51 pm »
I cannot seem to find the function that defaults add new users into 'user' group, any of you guys know it?

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: Change name of default user group ('user')
« Reply #10 on: September 02, 2014, 12:45:21 pm »
add a new user group. Call it "guest"

Set it to have permissions from: user
Once you get to know me, you'll find you'll have never met me at all.

Offline zassadgh

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Change name of default user group ('user')
« Reply #11 on: September 02, 2014, 01:28:15 pm »
Yearh , I know that, I assume you mean:
Code: [Select]
"guest"
{
"inherit_from" "user"
}
The problem is how to automatically add users that is not in a group to the new group, called 'guest'.

Offline bender180

  • Full Member
  • ***
  • Posts: 217
  • Karma: 42
    • Benders Villa
Re: Change name of default user group ('user')
« Reply #12 on: September 02, 2014, 02:09:16 pm »
you could do something like this

Code: Lua
  1. function addguest( ply )
  2.  
  3.     if ply:IsUserGroup( "user" ) then
  4.         ULib.ucl.addUser(ply:SteamID(), _, _, "guest")
  5.     end  
  6. end
  7.  
  8. hook.Add( "PlayerInitialSpawn", "playerInitialSpawnguest", addguest )

not tested at all just put together in about 2 minutes if you try it let me know how it goes.
Made community pool and community bowling and for the life of me couldn't tell you why they are popular.
Also made the ttt ulx commands.

Offline zassadgh

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Change name of default user group ('user')
« Reply #13 on: September 03, 2014, 07:52:54 am »
Thank you bender, was actually not sure if that InitialSpawn was only fired on actually spawn but it fires simply when the user connects and is in spectate, thank you, it works just like a charm.
located it under ulx / lua / ulx / modules / sh / playerinitguest.lua
Have a good day, +karma for you.
« Last Edit: September 03, 2014, 07:54:57 am by zassadgh »

  • Print