Drupal 7: Разные профили пользователей для разных ролей

Тема эта уже многократно поднималась в интернетах, но, как говорится, то-ли лыжи не едут, толи еще что… В общем, для моей задачи мне пришлось перебрать довольно много информации, поэтому я решил собрать все здесь, в одном месте.

Итак, задача стоит следующая: на сайте www.carhelpinfo.ru есть две роли: обычный зарегистрированный пользователь и магазин.  В профиле магазина находится информация о его месторасположении (поле с Google Maps), краткое описание магазина (текстовое поле) и название магазина.

Необходимо всех регистрирующихся по умолчанию считать обычными зарегистрированными пользователями. Роль магазина присваивает администратор. 

К сожалению, я не нашел, как штатными средствами Drupal 7 сделать разные профили для разных ролей, и в форме регистрации всем подряд предлагалось указать название и описание магазина, а так же его местоположение. Помог мне в решении этой проблемы доп. модуль Profile 2

После установки этого модуля в разделе "Структура" появится пункт "Тип профиля" (см скриншот)


В этом разделе можно завести несколько разных профилей и определить для каждого свой набор полей. Для своей задачи я сделал "Основной профиль", где определил стандартные для всех пользователей поля, и профиль "магазин", в котором определил поля для магазинов.

Теперь, чтобы при нажатии кнопки "регистрация" пользователю предлагалось заполнить "Основной профиль", нужно лишь установить флажок "Show during user account registration.":


Теперь остался последний штрих. Необходимо, чтобы профиль "магазин" был только у пользователей с соответствующей ролью. Для этого просто идем в "разрешения ролей" и указываем параметры так, как нам надо.

500 комментариев

  1. Thanks for finally writing about > Drupal 7 разные роли и профили пользователей | CharmLab Multimedia < Liked it!

  2. I have been xploring for a bit for any high-quality articles or weblog posts on this kind of space
    . Exploring in Yahoo I finally stumbled upon this web site.
    Reading this info So i’m haappy tto express thaat I have a very excellent uncanny feeping I came
    upon just what I needed. I so muhch nno doubt will make
    sure to do not overlook this site and provides it a glance regularly.

    Visit my webpage :: click here

  3. hey there and thank you for your information – I have definitely picked up smething new from right here.
    I did however expertise some technical issues using this
    web site, as I experienced to relooad the website many times previous to I copuld get it to load correctly.
    I had been wondering if your hosting is OK?
    Not that I’m complaining, but slow loading instances times will often affect your placement in google and can damage your
    high quality score if ads and marketing with Adwords.
    Anyway I am adding this RSS to my email and can look out for a
    lot more of your reespective intriguing content. Ensure that you update this
    gain soon.

    Also vist my web blog … check here

  4. Good day! Do you know if they make any plugins
    to safeguard against hackers? I’m kinda paranoid about losing everything I’ve worked hard
    on. Any recommendations?

  5. Asking questions are in fact fastidious thing if you are not understanding anything entirely, however this article gives fastidious understanding yet.

  6. I don’t even understand how I stopped up here, however I thought this put up used to be good.

    I do not recognise who you’re but definitely you are going to a well-known blogger should you are not already.

  7. Nice blog! Is your theme custom made or did you download it from somewhere?

    A design lik yours withh a few simple tweeks would realy make my blog
    stand out. Please let me know where you got
    your theme. Bless you

    Here is my blog post; here

  8. I used to be suggested this blog by my cousin. I’m now nnot positive whether
    or not this submit is written through hiim
    as no one else knoww suych targetd approximately my trouble.
    You’re wonderful! Thank you!

    My website: get more info

  9. What i don’t realize is in truth how you are not really
    much more smartly-liked than you may be right now.

    You’re soo intelligent. You recognize thus significantly in terms of this topic, produced
    me individually imagine iit from numerous
    numerous angles. Its like menn and women don’t seem to be fascinated unless it’s something to do
    wwith Woman gaga! Your individual stuffs nice. Alwaqys handle it up!

    My weeb site :: get more info

  10. I was very happy to discover this web site. I wanted to thank you for your time for this wonderful
    read!! I definitely really liked every bit of it and I have you bookmarked to check out neew
    information inn your blog.

    Also visit mmy web page — more info

  11. Perjudian, toto [1] atau totalisator[2] merupakan permainan di
    mana pemain bertaruh untuk memilih satu opsi di antara sebagian opsi
    di mana cuma satu opsi saja yang benar dan menjadi jawara. Pemain yang keok taruhan akan memberikan taruhannya terhadap si jawara.
    Tertib dan jumlah taruhan ditetapkan sebelum laga diawali.

    Undian bisa diperhatikan sebagai perjudian di mana undang-undang mainnya
    yaitu dengan sistem memastikan suatu keputusan dengan pemilihan acak.
    Undian umumnya diadakan untuk mempertimbangkan kampiun suatu hadiah.

    Semisal merupakan undian di mana peserta wajib membeli sepotong karcis yang diberikan nomor.
    Nomor karcis-karcis ini langsung secara acak ditarik
    dan nomor yang ditarik yaitu nomor jawara. Pemegang karcis dengan nomor kampiun ini memiliki
    hak atas hadiah tertentu.

  12. I really love your site.. Pleasant colors & theme.
    Did you buld this website yourself? Please reply back as I’m trying
    to create my very own bpog and would like to know where you got this from or what the theme is named.
    Appreciate it!

    my webpage — read more

  13. You’ve made some good points there. I checked on the web to learn more about the issue and found
    most people will go along with your views on this site.

    my page; more info

  14. Banks, a former NYPD chief off division and lose private friend of Adams, announced his new job in aan op-ed column in tthe Daily News Friday morning.

    Also visit my web-site; Aileen

  15. Betting can be of many forms, with each type requiring its
    legal arrangement. In Nevada, for instance, there is what is called a»suit.»
    A suit is an agreement or a contract between a individual placing a wager and the person or group putting the money at stake.
    In certain states, a»betting account» is made in which money deposited into the account is
    kept by a bookmaker and isn’t accessible to players; others allow online gambling but do not permit offline gaming.
    In the end, there are»rollover» trades where the money in a player’s account is removed before it is
    used. In this way, the expression gaming covers a vast selection of trades and can refer to all of them,
    as each has its own set of circumstances under which it may take place.

  16. Howdy! Someone in my Facebook group shared thiis website with us so I came to look it over.

    I’m definitely loving the information. I’m bookmarking and
    will bee tweeting this to my followers! Superb blog and brilliant style and design.

    Here is my webpage :: read more

  17. hey there and thank you for your information – I’ve certainly picked up something new
    from right here. I did however expertise several technical points using this web site,
    as I experiencd to relooad the web site many times prvious to I could get it to load correctly.
    I haad been wondering if yoyr hosting is OK? Not that
    I am complaining, but sluggish lading instances times will sometimes affect yojr placement in google and can damage your quality score if
    adertising and marketing with Adwords. Anyway I’m adding this RSS too my email and can look outt for
    much more oof your respective fascinatinng content. Make sure you update this
    again soon.

    Have a look at my website more info

  18. Hody jyst wanted to give you a quick heads up. The text in your post
    seem to be runjing off the screen in Internet explorer. I’m not sure if tyis is a
    format issue or something tto do with internet browser compatibility but I figured
    I’d post to let you know. The design and style liok grteat though!
    Hope you get the issue fixed soon. Many thanks

    Feel free too visit my blog … more info

  19. certainly like your web site however you have to tesdt
    the spelling on quite a few of your posts. A number of them are
    rife with spelling issues and I to find it very troubllesome to telll the truth on tthe other hand I ill
    definitely come agajn again.

    my blog post — get more info

  20. Simply wish to say your article is as amazing. The clearness for your
    post is simply excellent and that i can assume you’re an expertt
    on this subject. Fine with your permission let me to seize your RSS
    ffeed to kedp up to date with drawing close post.
    Thans one million and please carry on the rewarding work.

    Here is my web site — click here

  21. Wonderful blog! I found it while surfing around on Yahoo News.

    Do yyou have any suggestions on how to get listed in Yahoo News?
    I’ve been trying for a while but I ever sseem to get there!

    my website get more info

  22. Right now it looks ike WordPress is the preferred blogging platform out there right
    now. (from what I’ve read) Is thhat what yoou are using on your blog?

    Look into my website :: more info

  23. Howdy! I just want to give you a huge tthumbs uup for your great
    info you’ve got right here on this post. I will be returning tto youir web site for
    more soon.

    Feel free to surf to my blog :: check here

  24. We are professional wholesale dealer of jerseys, specialized in supplying General Jerseys and custom-made jerseys.
    Jerseys using 100% stitched authentic quality, all
    Amounts, Logos and Titles are sewn upon and embroidered.
    cheap nfl jerseys

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *