[development] Hello from another developer/Want to add some features

Sammy Spets sammys-drupal at synerger.com
Mon Jan 30 03:09:18 UTC 2006


On 28-Jan-06 15:50, Adrian Rossouw wrote:
> function mymodule_form_alter($form_id, &$form) {
> 
> 	if ($form_id == 'user_edit') { // might have to double check the  
> form id
>            if (/* check that the user is not allowed to edit  
> things*/) {
>                 $form['name']['#type'] = 'value';
> 		// whatever the password requires. might have to make it 
> 		hidden
>            }
>       }
> 
>     return $form;
> }
> 
> This will remove those fields from the form if the user isn't allowed  
> to edit them.

Yep. Thanks for the suggestion Adrian. I'll implement it this way to
leave the hierarchical roles business till later in the game.

-- 
Sammy Spets
Synerger Pty Ltd
http://www.synerger.com/



More information about the development mailing list