CRM-15928. Rename variable to be more descriptive, update inline docs.
authorChris Burgess <chris@giantrobot.co.nz>
Tue, 23 Aug 2016 23:54:29 +0000 (11:54 +1200)
committerSeamus Lee <seamuslee001@gmail.com>
Thu, 25 Aug 2016 06:49:11 +0000 (16:49 +1000)
CRM/Admin/Form/Setting/Miscellaneous.php
CRM/Profile/Page/Router.php
CRM/UF/Page/Group.php
CRM/Upgrade/Incremental/php/FourSeven.php
settings/Core.setting.php
templates/CRM/Admin/Form/Setting/Miscellaneous.tpl

index 8ad66345c20a1bf48823ce9d6e9ee6c5dbf08987..7252e404c8197e478fb8fbcd3db65ec450b45db2 100644 (file)
@@ -52,7 +52,7 @@ class CRM_Admin_Form_Setting_Miscellaneous extends CRM_Admin_Form_Setting {
     'recentItemsMaxCount' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
     'recentItemsProviders' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
     'dedupe_default_limit' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-    'allow_profile_html_snippet' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
+    'remote_profile_submissions_allowed' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
   );
 
   public $_uploadMaxSize;
index 4d3288842af71bdfb045b2a04d02f631a23db115..8d3ff09abba317a01230313803aeaee8b3958d38 100644 (file)
@@ -98,11 +98,11 @@ class CRM_Profile_Page_Router extends CRM_Core_Page {
 
     if ($secondArg == 'edit' || $secondArg == 'create') {
       if ($secondArg == 'edit') {
-        $allowHtmlSnippet = Civi::settings()->get('allow_profile_html_snippet');
+        $allowRemoteSubmit = Civi::settings()->get('remote_profile_submissions_allowed');
         $controller = new CRM_Core_Controller_Simple('CRM_Profile_Form_Edit',
           ts('Create Profile'),
           CRM_Core_Action::UPDATE,
-          FALSE, FALSE, $allowHtmlSnippet
+          FALSE, FALSE, $allowRemoteSubmit
         );
         $controller->set('edit', 1);
         $controller->process();
index facff57a4f9ac37b06e7065f545916b54648c624..0949bc2f7fd4be4a800be7e989050269690f09d0 100644 (file)
@@ -126,8 +126,8 @@ class CRM_UF_Page_Group extends CRM_Core_Page {
           'extra' => 'onclick = "return confirm(\'' . $copyExtra . '\');"',
         ),
       );
-      $allowHtmlSnippet = Civi::settings()->get('allow_profile_html_snippet');
-      if ($allowHtmlSnippet) {
+      $allowRemoteSubmit = Civi::settings()->get('remote_profile_submissions_allowed');
+      if ($allowRemoteSubmit) {
         self::$_actionLinks[CRM_Core_Action::PROFILE] = array(
           'name' => ts('HTML Form Snippet'),
           'url' => 'civicrm/admin/uf/group',
index d1d2bce59e3c00c76ba99f496cc9af607de85f60..f609a26edadcf9d984b7e652fa57c60e1ac88a22 100644 (file)
@@ -99,8 +99,8 @@ class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base
 
       $postUpgradeMessage .= '<p>' . ts('The custom fatal error template setting has been removed.') . '</p>';
     }
-    if ($rev == '4.7.9') {
-      $postUpgradeMessage .= '<br /><br />' . ts("WARNING: To improve security, HTML snippets for profiles are no longer allowed to create or edit data by default. If you need to allow users to submit profiles using HTML snippets, you can enable by going to Administer > System Settings > Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.) and clicking to enable 'Override security by accepting unauthenticated posts from other sites?");
+    if ($rev == '4.7.21') {
+      $postUpgradeMessage .= '<br /><br />' . ts("WARNING: For increased security, profile submissions embedded in remote sites are no longer allowed to create or edit data by default. If you need to allow users to submit profiles from external sites, you can restore this at Administer > System Settings > Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.) > 'Accept profile submissions from external sites'");
     }
   }
 
index de65a3e91fe82e1bb93b333a3e290118093df8d1..ac7ead14af9909d5238ebc4b044ed56131fe1d96 100644 (file)
@@ -32,7 +32,8 @@
  * $Id$
  *
  */
-/*
+
+/**
  * Settings metadata file
  */
 return array(
@@ -176,19 +177,19 @@ return array(
     'description' => NULL,
     'help_text' => NULL,
   ),
-  'allow_profile_html_snippet' => array(
+  'remote_profile_submissions_allowed' => array(
     'group_name' => 'CiviCRM Preferences',
     'group' => 'core',
-    'name' => 'allow_profile_html_snippet',
+    'name' => 'remote_profile_submissions_allowed',
     'type' => 'Boolean',
     'quick_form_type' => 'YesNo',
     'default' => FALSE,
     'html_type' => 'radio',
     'add' => '4.7',
-    'title' => 'Allow Profile Html Snippet',
+    'title' => 'Accept profile submissions from external sites',
     'is_domain' => 1,
     'is_contact' => 0,
-    'description' => 'This settings allows to enable HTML snippet for profile.',
+    'description' => 'If enabled, CiviCRM will permit submissions from external sites to profiles. This is disabled by default to limit abuse.',
     'help_text' => NULL,
   ),
   'editor_id' => array(
index 234f6a95369366ef6491cb7fcf9e98e5b23ec7c1..9c886b12c3293b48463ec846f6c11d12d3df0a43 100644 (file)
             <td>{$form.recentItemsProviders.html}<br />
                 <span class="description">{$recentItemsProviders_description}</span></td>
         </tr>
-        <tr class="crm-miscellaneous-form-block-allow_profile_html_snippet">
-          <td class="label">{$form.allow_profile_html_snippet.label}</td>
-          <td>{$form.allow_profile_html_snippet.html}<br />
-            <p class="description">{ts}If enabled, CiviCRM will allow users to submit profiles using HTML snippets.{/ts}</p>
+        <tr class="crm-miscellaneous-form-block-remote_profile_submissions_allowed">
+          <td class="label">{$form.remote_profile_submissions_allowed.label}</td>
+          <td>{$form.remote_profile_submissions_allowed.html}<br />
+            <p class="description">{ts}If enabled, CiviCRM will allow users to submit profiles from external sites. This is disabled by default to limit abuse.{/ts}</p>
           </td>
         </tr>