CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Add CMS user to a Drupal role
Pages: [1]

Author Topic: Add CMS user to a Drupal role  (Read 3337 times)

brantwinter

  • Guest
Add CMS user to a Drupal role
November 23, 2007, 07:52:01 am
Hi guys - I would like to know if there is anyway to give a newly created user account ( created with CiviMember and CiviContributions ) a specific role in the Drupal CMS system ?

My situation is that I have a site where people should be able to sign up and then get access to a newsletter. The newsletter is protected by a Drupal node ACL that limits by the role the CMS is a member of. I just can not find a way to achieve this ! Any help appreciated.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Add CMS user to a Drupal role
November 23, 2007, 08:15:18 am

no. You can hack the code to do this for your specific case at

CMS/Core/BAO/CMSUser.php, line 119

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

brantwinter

  • Guest
Re: Add CMS user to a Drupal role
November 23, 2007, 03:48:09 pm
Thanks for the reply, I was hoping more for a plugin or something. I had a look at the code, and then tried to scour through the Drupal API to see how I can get a role in there, I have even started looking through the ecommerce module to see how they manage to do it, but I think it is a bit over my head.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Add CMS user to a Drupal role
November 24, 2007, 07:51:11 am

check:

http://svn.civicrm.org/civicrm/trunk/drupal/api.php

function civicrm_modify_role_id( $op, $uid, $rid, $roleName = null )

if this does not help you, you might want to consider hiring someone to do the needful

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

brantwinter

  • Guest
Re: Add CMS user to a Drupal role
November 25, 2007, 04:32:13 am
Thanks - that made it clear, modification done, tested and working.

scottblitz

  • Guest
Re: Add CMS user to a Drupal role
December 06, 2007, 08:52:35 am
I think this is key functionality and something I have been looking to add for a while now.  I am not a coder so haven't had any luck but have even offered to hire to accomplish this or to update Gordon Heydon's Civicrm_role Module to 5.0 with no luck.

http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/gordon/civicrm_role/

Any ideas?  Care to offer back the specifics on how you accomplished this - I know there a bunch of folks looking for this.

Thanks
SB

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Add CMS user to a Drupal role
December 06, 2007, 12:36:25 pm

I suspect this project will take 40-80 hours (rough ballpark) to integrate civimember and drupal roles. If you can raise the needed funds to do so, we'd be happy to take it on. You can find our consulting contract and rate sheet on the wiki

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

brantwinter

  • Guest
Re: Add CMS user to a Drupal role
December 06, 2007, 02:39:48 pm
Thanks, but we have moved back to the idea of running Joomla with AEC. I couldn't get enough help from the guys in the forums, actually I was just treated like I knew nothing ! Anyway, we are battling along with the dreaded Joomla as the work was for a non-profit who have no money anyway, not even to pay me let alone software devs ! Thanks again.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Add CMS user to a Drupal role

This forum was archived on 2017-11-26.