Working with Drupal

Questions about modifications to Zuluru code, to add or change features

Working with Drupal

Postby dyoung » Sat Mar 22, 2014 12:08 pm

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
dyoung
 
Posts: 68
Joined: Mon Dec 09, 2013 5:33 pm

Re: Working with Drupal

Postby GregS » Sat Mar 22, 2014 6:52 pm

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.
GregS
Site Admin
 
Posts: 236
Joined: Thu Jan 06, 2011 4:58 pm

Re: Working with Drupal

Postby dyoung » Sat Mar 22, 2014 10:50 pm

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?
dyoung
 
Posts: 68
Joined: Mon Dec 09, 2013 5:33 pm

Re: Working with Drupal

Postby GregS » Sat Mar 22, 2014 11:26 pm

Apologies, I got admin and player backwards. I've edited the original post to correct them.
GregS
Site Admin
 
Posts: 236
Joined: Thu Jan 06, 2011 4:58 pm

Re: Working with Drupal

Postby dyoung » Sun Mar 23, 2014 11:31 am

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.
dyoung
 
Posts: 68
Joined: Mon Dec 09, 2013 5:33 pm

Re: Working with Drupal

Postby GregS » Sun Mar 23, 2014 1:48 pm

It's not hard-coded to 1, it's hard-coded to read the id from the groups table where the name is Player.
GregS
Site Admin
 
Posts: 236
Joined: Thu Jan 06, 2011 4:58 pm

Re: Working with Drupal

Postby dyoung » Sun Mar 23, 2014 2:55 pm

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.
dyoung
 
Posts: 68
Joined: Mon Dec 09, 2013 5:33 pm

Re: Working with Drupal

Postby GregS » Sun Mar 23, 2014 3:44 pm

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!
GregS
Site Admin
 
Posts: 236
Joined: Thu Jan 06, 2011 4:58 pm

Re: Working with Drupal

Postby dyoung » Sun Mar 23, 2014 5:15 pm

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.
dyoung
 
Posts: 68
Joined: Mon Dec 09, 2013 5:33 pm


Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron