2

I am using drupal 7 with profile2 module, Created a profile type which is not filled up by user at registration time. after a user register they have a option to fill up the page . I need a way to restrict user from editing that custom profile page only if they have already submitted the information. Does anyone know how to accomplish this ?

thanks

3 Answers 3

1

You can use Field Permissions for this.

The Field Permissions module allows site administrators to set field-level permissions to edit, view and create fields on any entity.

Just set up the fields on the Profile page so that only authenticated users can fill them in. This will mean that when the anonymous user is registering they won't see the fields, however when they are registered (and therefore authenticated) they can edit them.

0

In ther permissions table there is an option calles 'edit own xxx profile'; ensure this is not checked and check the option for 'create own xxx profile'. This means they can initially create the profile content but would be unable to further edit.

2
  • Yes Tried that But There is No Option for Create Profile only Edit own profile , Under profile2 permission set
    – user80287
    Commented Sep 12, 2011 at 14:26
  • 1
    Ah, ok. Sorry, I stand corrected. I would, in that case, create a role called can-edit which would be allowed to edit the profile. Using the rules module I would create a rule that, on profile save (and any other rules/contexts you require) remove the role. That way they can edit it one time and then the role is removed thus the user has no permission to continue.
    – harry
    Commented Sep 12, 2011 at 16:44
0

I would do a hook_form_alter for the "user_profile_form". Then check all the fields if they are filled out and if they are show a message and hide the form fields.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.