Merge pull request #10946 from mattwire/CRM-21037_activity_sendsms_unittests
[civicrm-core.git] / bin / migrate / exportJSON.php
index 3012412b039a52b45db0d6ba4787af379ac78ee3..5737dbdf213a848ced93bc8520cda3b1ca8374f7 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.7                                                |
+ | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016                                |
+ | Copyright CiviCRM LLC (c) 2004-2017                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2017
  */
 function run() {
   session_start();
@@ -38,7 +38,11 @@ function run() {
   $config = CRM_Core_Config::singleton();
 
   // this does not return on failure
-  // CRM_Utils_System::authenticateScript( true );
+  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);
+  }
+
   $params = array();
 
   require_once 'CRM/Utils/Migrate/ExportJSON.php';