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) »
  • Contribution form that requires logged in user?
Pages: [1]

Author Topic: Contribution form that requires logged in user?  (Read 1676 times)

mcgeehon

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 0
  • CiviCRM version: 4.x
  • CMS version: 7.x
  • MySQL version: 5.x
  • PHP version: 5.2.x
Contribution form that requires logged in user?
March 26, 2013, 07:22:06 pm

We currently have a contribution form that includes a profile for member signup.  We also use the same form for member renewal, however many members are confused by the form since we include the original profile that has a lot of extra fields.

Is there a way to have a profile only show up in a contribution when a user is not logged in?

Is there a way to create a contribution form that restricts access to logged in users or members of a specific group only?


Thanks

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Contribution form that requires logged in user?
March 27, 2013, 04:47:02 am
Have you tried looking into http://drupal.demo.civicrm.org/civicrm/acl?action=add&reset=1  CiviCRM ACLs can take a while to get your head around but I think you *might* be able to do what you need to by restricting access to the profile to a particular group.

Please post back your findings here so others know if this approach does / doesn't work.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

mcgeehon

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 0
  • CiviCRM version: 4.x
  • CMS version: 7.x
  • MySQL version: 5.x
  • PHP version: 5.2.x
Re: Contribution form that requires logged in user?
March 27, 2013, 01:06:17 pm

Thanks.  I'll take a look.  Part of the reason I have not used ACL's extensively yet is because Drupal Role's supercede them I think?   I will try it and get back to you.

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Contribution form that requires logged in user?
March 27, 2013, 05:33:10 pm
Depends what you mean by supercede! A good principle for working with both drupal and CiviCRM permissions is that you can only give permissions. So turn off any relevant drupal permissions and add permissions to civicrm contacts as you need to
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

mcgeehon

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 0
  • CiviCRM version: 4.x
  • CMS version: 7.x
  • MySQL version: 5.x
  • PHP version: 5.2.x
Re: Contribution form that requires logged in user?
March 28, 2013, 12:13:48 pm

By supercede I mean that Drupal Permissions Roles for Civi over-rule any ACL's that you may have in place.  So if I block a certain group from accessing a specific event but I also enable "edit all events" under Drupal for that same person, then I believe that the Drupal rule will win.  To get ACL's to work properly you have to remove the accounts in question from any possible Drupal rule conflicts.

At least that is my understanding.

mcgeehon

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 0
  • CiviCRM version: 4.x
  • CMS version: 7.x
  • MySQL version: 5.x
  • PHP version: 5.2.x
Re: Contribution form that requires logged in user?
April 01, 2013, 11:11:48 am

After looking into this, it appears that this works, but not in a way that is useful.   If I have a contribution or an event that uses a profile AND I block this profile using an ACL, it appears that Civi blocks access to the entire contribution or event because the requested profile cannot be displayed.

I was hoping that Civi would simply not render the restricted profile rather than spitting out an error message stating that the profile was restricted.

I guess there isn't a clean way to restrict a profile from being displayed in an event or contribution based on ACL?

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Contribution form that requires logged in user?
April 01, 2013, 01:09:05 pm
Have you ruled out having 2 contrib forms - one you direct people to when Joining, and the other for Renewing?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

mcgeehon

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 0
  • CiviCRM version: 4.x
  • CMS version: 7.x
  • MySQL version: 5.x
  • PHP version: 5.2.x
Re: Contribution form that requires logged in user?
April 07, 2013, 08:58:58 am
Pete,

That is what we originally wanted to do, however there is difficulty in restricting the second contrib form to members only.  Using ACL's is an option, however the ACL restriction doesn't send a nice 403 like in Drupal, instead you get an ugly access denied message.  Similarly, I think that ACL's are hard to work with at the moment as they dont support smart groups yet.

So, I am still looking for a way to restrict access to a contrib form that can gracefully error out if a non member attempts to access it.

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: Contribution form that requires logged in user?
April 07, 2013, 09:12:22 am

Thats a good idea :)

Maybe we should fix the code so all public pages throw a nice, CMS formatted error page rather than our current "fatal" error page

Any chance you can work on contributing a fix for this one. I suspect its fairly easy, and basically involves only modification of CiviCRM's fatal error handler

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

mcgeehon

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 0
  • CiviCRM version: 4.x
  • CMS version: 7.x
  • MySQL version: 5.x
  • PHP version: 5.2.x
Re: Contribution form that requires logged in user?
April 08, 2013, 02:43:15 pm
Sure,  let me take a look.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Contribution form that requires logged in user?

This forum was archived on 2017-11-26.