Answers.Body: <p>To do the same, I use 2 Webforms : </p>
  
  <ul>
  <li>one public (authenticated users) which is limited to their own registration (existing contact hidden)</li>
  <li>one, almost identical, reserved to an administrative role which enables different persons registration.</li>
  </ul>
  
  <p>You may need the permission per webform Module (<a href="https://www.drupal.org/project/permissions_per_webform" rel="nofollow noreferrer">https://www.drupal.org/project/permissions_per_webform</a>)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-07T08:21:07.440Z
Answers.Text: 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.
Answers.UserDisplayName: Betty Dolfing
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-13T08:05:33.913Z
Answers.Text: More info on the overriding templates method: https://docs.civicrm.org/dev/en/latest/framework/templates/customizing/
Answers.UserDisplayName: Hans Rossel
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-30T17:04:16.753Z
Answers.LastActivityDate: 2016-11-30T17:04:16.753Z
Answers.UserDisplayName: Jacques-Marie Moranne
Answers.Body: <p>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:</p>
  <pre><code>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;
      }
    }
  }</code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-18T11:49:09.773Z
Answers.LastActivityDate: 2023-08-18T11:49:09.773Z
Answers.UserDisplayName: Aiden
Answers.Body: <p>I did found a different approach for removing option to registered additional member</p>
  <p>I did by creating a Page run hook (civicrm Extension) with the below condition</p>
  <pre><code>function example_civicrm_pageRun(&amp;$page){
  $pageName = $page-&gt;getVar('_name');
  if ($pageName == 'CRM_Event_Page_EventInfo') {
       $allStatus = CRM_Core_Session::singleton()-&gt;getStatus();
       foreach ($allStatus as $key =&gt; $status) {
           if (str_contains($status['text'], 'already registered for this event') &amp;&amp; $status['type'] == 'alert') {
  CRM_Core_Session::singleton()-&gt;getStatus(TRUE);
  CRM_Core_Session::singleton()-&gt;setStatus(&quot;&lt;h3'&gt;It looks like you are already registered for this event.&lt;/h3&gt;&quot;);
  }}}}
  </code></pre>
  <p>I hope this helps !!!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-17T10:36:52.557Z
Answers.Text: 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.
Answers.UserDisplayName: Aiden
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-14T18:23:49.497Z
Answers.LastActivityDate: 2022-05-14T18:23:49.497Z
Answers.UserDisplayName: Ramesh - ARTECH Consultancy
Body: <p>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. </p>
  
  <p>when I <strong>log in</strong> before registration, I get the notice above the registration fields: </p>
  
  <p><em>Welcome Betty Dolfing. (Not Betty Dolfing, or want to register a different person?)</em> </p>
  
  <p>and then I can click on the link to register a different person. </p>
  
  <p>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. </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-29T20:53:29.597Z
Comments.Text: 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.
Comments.UserDisplayName: Graham
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-15T00:27:01.670Z
Comments.Text: 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
Comments.UserDisplayName: petednz - fuzion
Tags: <civievent><registration>
Title: Blocking Registration of other participant
ThreadText: # Blocking Registration of other participant
  
  (Asked by: username_0 on 2016-11-28)
  
  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 username_0 username_0. (Not username_0 username_0, 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.
  
  **Tags:** civievent, registration
  
  > **Comments:**
  > **username_1**: 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.  
  > **username_2**: 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  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_3 on 2016-11-30. Score: 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>)
  
  > **Comments:**
  > **username_0**: 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.  
  > **username_4**: More info on the overriding templates method: https://docs.civicrm.org/dev/en/latest/framework/templates/customizing/  
  
  ---
  
  ### Answer by username_5 on 2023-08-18. Score: 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;
      }
    }
  }
  ```
  
  
  ---
  
  ### Answer by username_6 on 2022-05-14. Score: 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 !!!
  
  > **Comments:**
  > **username_5**: 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.  
  
  ---
  
  