4

Using on line registration in CiviEvent, I can check the box 'Register multiple participants'. For an specific event I don't want that so I don't check that box.

when I log in before registration, I get the notice above the registration fields:

Welcome Betty Dolfing. (Not Betty Dolfing, or want to register a different person?)

and then I can click on the link to register a different person.

Question: I don't want this option that participants can register others as well and even have the opportunity to 'look up' people in CiviCMR. How can I get rid of that? It seems a default thing for logged in accounts. I'm using Drupal 7 with CiviCRM 4.6.22. I tried to switch on and off several permissions in Drupal but haven't found the solution yet.

2
  • Enabling logged in users to register another person can be really useful, for example in the scenario where an assistant is asked to register their boss for a conference, or a team member registers not just themselves but also the rest of their team. If you are sure you don't want this message displayed I guess the simplest fix would be to hide it with CSS.
    – Graham
    Commented Nov 29, 2016 at 20:53
  • mostly sounds like the above should be managed by Permissions and perhaps your users have more civicrm permissions than is ideal since if they can 'search' others via the Event registration then they would be able to do so in other scenarios
    – petednz - fuzion
    Commented May 15, 2022 at 0:27

3 Answers 3

3

To do the same, I use 2 Webforms :

  • one public (authenticated users) which is limited to their own registration (existing contact hidden)
  • one, almost identical, reserved to an administrative role which enables different persons registration.

You may need the permission per webform Module (https://www.drupal.org/project/permissions_per_webform)

2
  • 1
    With the help of a technical guy I changed the template and excluded the phrase 'Not XXXX or want to register a different person?' from the template. You can find the template here: sites/all/modules/civicrm/templates/CRM/Event/Form/Registration/Register.tpl. Commented Dec 7, 2016 at 8:21
  • More info on the overriding templates method: docs.civicrm.org/dev/en/latest/framework/templates/customizing Commented May 13, 2021 at 8:05
2

I did found a different approach for removing option to registered additional member

I did by creating a Page run hook (civicrm Extension) with the below condition

function example_civicrm_pageRun(&$page){
$pageName = $page->getVar('_name');
if ($pageName == 'CRM_Event_Page_EventInfo') {
     $allStatus = CRM_Core_Session::singleton()->getStatus();
     foreach ($allStatus as $key => $status) {
         if (str_contains($status['text'], 'already registered for this event') && $status['type'] == 'alert') {
CRM_Core_Session::singleton()->getStatus(TRUE);
CRM_Core_Session::singleton()->setStatus("<h3'>It looks like you are already registered for this event.</h3>");
}}}}

I hope this helps !!!

1
  • Assuming you could do something similar when the user isn't already registered, this would only work on the info page, and I suspect the register page would be classified as a form and not invoke this hook.
    – Aiden
    Commented Aug 17, 2023 at 10:36
2

This won't prevent the link from being offered, but you can deny permission once it's clicked (and use your own conditional logic) by implementing hook_civicrm_permission_check and checking for the cid=0 parameter:

function your_module_civicrm_permission_check($permission, &$granted) {
  if ($permission == 'register for events' && CRM_Utils_System::currentPath() == 'civicrm/event/register') {
    $decodedUrl = urldecode($_SERVER['REQUEST_URI']);
    $queryString = parse_url($decodedUrl, PHP_URL_QUERY);
    parse_str($queryString, $params);
    if (isset($params['cid']) && $params['cid'] == 0) {
      CRM_Core_Session::setStatus('Registering on behalf of others is not supported for this event');
      $granted = false;
    }
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.