Working with Drupal

Questions about modifications to Zuluru code, to add or change features
Post Reply
dyoung
Posts: 68
Joined: Mon Dec 09, 2013 5:33 pm

Working with Drupal

Post by dyoung »

So I have Zuluru working with Drupal. Thanks for the help.

When Drupal registers a new person Zuluru asks for the Name, Picture and other Zuluru related information. One problem I see is that the new user automatically has admin privileges in Zuluru by default.

My question is, Can you tell me where to change the default user privilege?

Thanks
GregS
Site Admin
Posts: 240
Joined: Thu Jan 06, 2011 4:58 pm

Re: Working with Drupal

Post by GregS »

dyoung wrote:When Drupal registers a new person Zuluru asks for the Name, Picture and other Zuluru related information. One problem I see is that the new user automatically has admin privileges in Zuluru by default.
That's very strange. The new user should certainly only have "player" privileges. The group_id should be set to the id of the Player group in the _approve function of PeopleController. If the names of things in the groups table get changed, then things could go wrong; there's a todo in the code to resolve this, as it currently uses a hard-coded group name. Those hard-coded group names are used again in the _setPermissions function of AppController. Can you tell me what the group_id is set to for a real admin, a user who has registered and filled out the Zuluru information but not yet been approved, and a user who has just been approved? It should be 3 for the admin and 1 for the approved account, and I think null for the unapproved one. Also, can you confirm that the group names in the database are 1 = Player, 2 = Volunteer and 3 = Administrator? Case and exact spelling is critical.
dyoung
Posts: 68
Joined: Mon Dec 09, 2013 5:33 pm

Re: Working with Drupal

Post by dyoung »

Just verifying:
GregS wrote: Can you tell me what the group_id is set to for a real admin, a user who has registered and filled out the Zuluru information but not yet been approved, and a user who has just been approved? It should be 3 for the admin and 1 for the approved account, and I think null for the unapproved one.
So you state here that admin is 3
GregS wrote:Also, can you confirm that the group names in the database are 1 = Administrator, 2 = Volunteer and 3 = Player? Case and exact spelling is critical.
But in the group table Administrator is 1?

Shouldn't the group_id's be 1 for both admins?
GregS
Site Admin
Posts: 240
Joined: Thu Jan 06, 2011 4:58 pm

Re: Working with Drupal

Post by GregS »

Apologies, I got admin and player backwards. I've edited the original post to correct them.
dyoung
Posts: 68
Joined: Mon Dec 09, 2013 5:33 pm

Re: Working with Drupal

Post by dyoung »

That makes sense now.
You were correct, I had an error in my group table.
After correcting the table, things work correctly.

I still don't see which line in people_controller that hard codes the group_id to 1. I will look for it another time, thanks for your help. I am looking for where it is hard coded because I have a youth league and would rather have new users as non-player.
GregS
Site Admin
Posts: 240
Joined: Thu Jan 06, 2011 4:58 pm

Re: Working with Drupal

Post by GregS »

It's not hard-coded to 1, it's hard-coded to read the id from the groups table where the name is Player.
dyoung
Posts: 68
Joined: Mon Dec 09, 2013 5:33 pm

Re: Working with Drupal

Post by dyoung »

I reordered the Group table and changed Administrator to 1 and Player to 3. When I added a new user I looked in the people table and the new user had a group_id of 1. This is why I thought it was hard coded somewhere.
GregS
Site Admin
Posts: 240
Joined: Thu Jan 06, 2011 4:58 pm

Re: Working with Drupal

Post by GregS »

It might well be hard-coded somewhere else... The permissions system in general needs an overhaul at some point, and this will be part of it. In general, probably safest not to change the groups table!
dyoung
Posts: 68
Joined: Mon Dec 09, 2013 5:33 pm

Re: Working with Drupal

Post by dyoung »

Sometimes it is the easiest way to learn. Change something, see what happens and learn.
Thank you for your patience. I have changed the group table back to it original settings.
Post Reply