From da08fd08011964b6ad2187061a89f720af20106a Mon Sep 17 00:00:00 2001 From: Chris Burgess Date: Tue, 28 Mar 2017 15:00:48 +1300 Subject: [PATCH] CRM-20346. Remove encryptDB.php --- bin/encryptDB.php | 110 ---------------------------------------------- 1 file changed, 110 deletions(-) delete mode 100644 bin/encryptDB.php diff --git a/bin/encryptDB.php b/bin/encryptDB.php deleted file mode 100644 index 84bf1ce196..0000000000 --- a/bin/encryptDB.php +++ /dev/null @@ -1,110 +0,0 @@ - array( - 'first_name' => CRM_ENCRYPT, - 'last_name' => CRM_ENCRYPT, - 'organization_name' => CRM_ENCRYPT, - 'household_name' => CRM_ENCRYPT, - 'sort_name' => CRM_ENCRYPT, - 'display_name' => CRM_ENCRYPT, - 'legal_name' => CRM_ENCRYPT, - ), - 'civicrm_address' => array( - 'street_address' => CRM_ENCRYPT, - 'supplemental_address_1' => CRM_ENCRYPT, - 'supplemental_address_2' => CRM_ENCRYPT, - 'city' => CRM_ENCRYPT, - 'postal_code' => CRM_SETNULL, - 'postal_code_suffix' => CRM_SETNULL, - 'geo_code_1' => CRM_SETNULL, - 'geo_code_2' => CRM_SETNULL, - ), - 'civicrm_website' => array( - 'url' => CRM_ENCRYPT, - ), - 'civicrm_email' => array( - 'email' => CRM_ENCRYPT, - ), - 'civicrm_phone' => array( - 'phone' => CRM_ENCRYPT, - ), - ); - - foreach ($tables as $tableName => $fields) { - $clauses = array(); - foreach ($fields as $fieldName => $action) { - if ($action == CRM_ENCRYPT) { - $clauses[] = "$fieldName = md5($fieldName)"; - } - elseif ($action == CRM_SETNULL) { - $clauses[] = "$fieldName = null"; - } - } - - if (!empty($clauses)) { - $clause = implode(',', $clauses); - $query = "UPDATE $tableName SET $clause"; - CRM_Core_DAO::executeQuery($query); - } - } -} - -function run() { - session_start(); - - require_once '../civicrm.config.php'; - require_once 'CRM/Core/Config.php'; - $config = CRM_Core_Config::singleton(); - - // 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(); -} - -run(); -- 2.25.1