Hello people any time of day!
Can somebody tell or give some advice how you can implement or create a following.

There is a content type. Simple registered user can fill just two fields of this content type (name of website and some one more).
But there could be a real owner of the website. I need that real owner of website could confirm that it is his website. And after he do it more field will be available for him. This is something like google, piniterest etc are doing.
How to create such a verification. Is there some ready solutions, any modules or any thing that can at least implement some part of this task. Maybe, Can somebody share some code or give some step by step instruction!
I use Drupal 7.
I will so much appreciate any help.


paulhudson’s picture

You can try the Field Permissions module: https://drupal.org/project/field_permissions

Or a code solution would be to implement hook_form_alter() and check the users role.

errev’s picture

But how the user can prove that he is the site owner?
It is the main point..

paulhudson’s picture

Will your site owner be the Drupal admin user? Or perhaps you could create a user role called 'site owner'.

You can then target your Field Permissions to that user role.

errev’s picture

Yes, I will create a user role called 'site owner'.
But still how to verify that he is the site owner?
I guess it should be system like in google when site owner add the website for verification .
But I need the help with the code.

paulhudson’s picture

I see, I can't write the code for you but you might try:

- Asking the visitors to add a html page with a name such as verify-YOURSITENAME-ACCOUNTID.html
- Create a custom Drupal module that builds a form and implements hook_form_submit()
- In hook_form_submit use drupal_http_request('verify-YOURSITENAME-ACCOUNTID.html') to check the page exists.

You'll need to look at the docs around the functions and hooks I've mentioned. This is a bit of a large scope for one support request and unfortunately I don't know of an code snippets of libraries that you might be able to use... except Drupal API :-)

Perhaps someone else has a easier idea or you can try the above and submit more specific support requests if you need further help.

Good luck! :-)

errev’s picture

Thank you, Sir!