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 Multi-Site functionality »
  • Multi-Org segregation failures: Events
Pages: [1]

Author Topic: Multi-Org segregation failures: Events  (Read 2052 times)

davej

  • Ask me questions
  • ****
  • Posts: 404
  • Karma: 21
Multi-Org segregation failures: Events
February 17, 2010, 10:55:44 am
Elaborating on issue discussed in Multi-Org: Summary of data segregation failures:

Feb 17 16:19:31 <davej_>   I've had a go at multisite_civicrm_aclGroup for events...
Feb 17 16:20:03 <davej_>   .. seems to work in that it's called and sets correct $currentGroups
Feb 17 16:20:39 <davej_>   - but has no effect, e.g. civicrm/event?reset=1 still shows all events.
Feb 17 16:21:02 <davej_>   - likewise civicrm/event/ical?reset=1&page=1
Feb 17 16:21:19 <dlobo>   davej_: this is in 3.1.2?
Feb 17 16:21:29 <dlobo>   can u post on forum, and we'll check and potentially fix in 3.1.3
Feb 17 16:21:39 <davej_>   Yes, 3.1.2
Feb 17 16:21:40 <dlobo>   seems like  a bug if that is happening
Feb 17 16:21:59 <dlobo>   also that code goes in the multisite module eventually right
Feb 17 16:22:30 <davej_>   dlobo: yes, I put it in multisite.module
Feb 17 16:22:46 <dlobo>   cool, you might also want to attach the code there
Feb 17 16:22:54 <dlobo>   did u commit it?
Feb 17 16:22:57 <dlobo>   into svn?
Feb 17 16:23:04 <dlobo>   not sure if u have svn access
Feb 17 16:23:23 <davej_>   dlobo: no, I meant our local copy.

Attached file civi-multisite.patch shows my changes to our local multisite.module. With this code in place, when I visit civicrm/event?reset=1 on site A the debug statements show:

Code: [Select]
    * multisite_civicrm_aclGroup: allGroups: Array ( [1] => [2] => [3] => Manchester Civi event test2 [5] => Manchester CiviEvent Test 3 [4] => Manchester test civi event 1 [6] => Rochdale Test CiviEvent )
    * multisite_civicrm_aclGroup: initial currentGroups: Array ( [0] => 5 )
    * multisite_civicrm_aclGroup: final currentGroups: Array ( [0] => 5 )

And on site B:

Code: [Select]
    * multisite_civicrm_aclGroup: allGroups: Array ( [1] => [2] => [3] => Manchester Civi event test2 [5] => Manchester CiviEvent Test 3 [4] => Manchester test civi event 1 [6] => Rochdale Test CiviEvent )
    * multisite_civicrm_aclGroup: initial currentGroups: Array ( [0] => 6 )
    * multisite_civicrm_aclGroup: final currentGroups: Array ( [0] => 6 )

(Event ids 1 to 4 don't have a created_id, I assume because they were created before the code that sets created_id was added.)

However in both cases, all events are shown (except ids 1 & 2 which have no titles).

So: in each case, $currentGroups already has the correct events at the outset, before my code gets called. My code arrives at the same set of events by other means. But then all events are shown.

civicrm/event/ical?reset=1&page=1 also shows all events.

Dave J

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Multi-Org segregation failures: Events
February 19, 2010, 01:20:22 am
Davej,

Can you apply this patch - http://fisheye2.atlassian.com/changelog/CiviCRM?cs=26318 and check.

Note the patch doesn't require any change to multisite.module.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

davej

  • Ask me questions
  • ****
  • Posts: 404
  • Karma: 21
Re: Multi-Org segregation failures: Events
February 19, 2010, 03:58:17 am
Hi Deepak,

The patch is looking good, you are a star. We'll give it some more rigorous testing but seems to do the trick on the pages I've tried:

civicrm/event?reset=1
civicrm/event/ical?reset=1&page=1
civicrm/event/info?reset=1&id=N

Many thanks for addressing this so quickly. My patch to multisite.module seems to be doing the right thing too, so once we've done more testing, maybe we could get that committed.

Thanks,

Dave J

davej

  • Ask me questions
  • ****
  • Posts: 404
  • Karma: 21
Re: Multi-Org segregation failures: Events
February 22, 2010, 10:20:39 am
Hi Deepak,

We've found one oddity: for a superuser with Administer Multiple Orgs and view/edit all contacts & events, the set of events shown at Manage Events ( /civicrm/event/manage?reset=1 ) is different from the set of events shown at CiviEvent Dashboard ( /civicrm/event?reset=1 ).

At CiviEvent Dashboard ( /civicrm/event?reset=1 ):
Non-superuser sees only events created by a contact in the site's parent group (correct).
Superuser sees all events regardless of creator (correct?).

At Manage Events ( /civicrm/event/manage?reset=1 ):
Non-superuser sees only events created by a contact in the site's parent group (correct).
Superuser sees only events created by a contact in the site's parent group (incorrect?).

Is there a reason for superusers being shown a different set of events in CiviEvent Dashboard versus Manage Events?

Thanks,

Dave J

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Multi-Org segregation failures: Events
February 22, 2010, 10:52:26 am
Just verified that the permission checks are same for both dashboard and manage-event screen.

Difference might be due to the fact that dashboard doesn't list events older than a week:
Code: [Select]
WHERE  ..civicrm_event.start_date >= DATE_SUB( NOW(), INTERVAL 7 day )
Or if that's not the case lets chat on irc and figure out the problem.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

davej

  • Ask me questions
  • ****
  • Posts: 404
  • Karma: 21
Re: Multi-Org segregation failures: Events
February 23, 2010, 02:42:24 am
Discussed on IRC, resolved by http://fisheye2.atlassian.com/changelog/CiviCRM?cs=26358

Thanks Deepak!

Dave J

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Multi-Site functionality »
  • Multi-Org segregation failures: Events

This forum was archived on 2017-11-26.