CRM-19594 fix line item memberships for price sets with multiple memberships
[civicrm-core.git] / bin / encryptDB.php
index acbc7457d976d532ddf7fd20dc8a320234fa4ec2..30698d63e9838f2e10e3df65626eaa32fd2a2647 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015                                |
+ | Copyright CiviCRM LLC (c) 2004-2016                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  +--------------------------------------------------------------------+
  */
 
+die("This script is disabled because it is dangerous. If you need it, please duplicate it elsewhere and provide your own secure workflow. This example file will be removed in the future.");
+
+// TIP: If/when we do delete this file, take care to affirmatively check for
+// deletion as part of the status-check infrastructure. Some upgrade workflows
+// don't clear out old files properly, and there's no telling the history
+// of upgrades that have been performed.
+
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2016
  */
 
 define('CRM_ENCRYPT', 1);
@@ -93,6 +100,9 @@ function run() {
 
   // this does not return on failure
   CRM_Utils_System::authenticateScript(TRUE);
+  if (!CRM_Core_Permission::check('administer CiviCRM')) {
+    CRM_Utils_System::authenticateAbort("User does not have required permission (administer CiviCRM).\n", TRUE);
+  }
 
   encryptDB();
 }