From 5c6ebf4cde90423c21e48a0bf722a0957c07b333 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 15 Dec 2015 15:35:53 -0800 Subject: [PATCH] CRM_*_Backdrop - Fix enough to run setup.sh --- CRM/Core/Permission/Backdrop.php | 11 +++++++++-- CRM/Utils/System/Backdrop.php | 32 +++++++++++++++++++++++--------- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/CRM/Core/Permission/Backdrop.php b/CRM/Core/Permission/Backdrop.php index 74846786db..fdf979459d 100644 --- a/CRM/Core/Permission/Backdrop.php +++ b/CRM/Core/Permission/Backdrop.php @@ -126,10 +126,13 @@ class CRM_Core_Permission_Backdrop extends CRM_Core_Permission_DrupalBase { if (empty($permissions)) { throw new CRM_Core_Exception("Cannot upgrade permissions: permission list missing"); } + // FIXME!!!! + /* $query = db_delete('role_permission') - ->condition('module', 'civicrm') - ->condition('permission', array_keys($permissions), 'NOT IN'); + ->condition('module', 'civicrm') + ->condition('permission', array_keys($permissions), 'NOT IN'); $query->execute(); + */ } /** @@ -148,6 +151,8 @@ class CRM_Core_Permission_Backdrop extends CRM_Core_Permission_DrupalBase { return $_cache[$permissionName]; } + // FIXME!!!! + /** $uids = array(); $sql = " SELECT {users}.uid, {role_permission}.permission @@ -167,6 +172,8 @@ class CRM_Core_Permission_Backdrop extends CRM_Core_Permission_DrupalBase { $_cache[$permissionName] = self::getContactEmails($uids); return $_cache[$permissionName]; + */ + return array(); } } diff --git a/CRM/Utils/System/Backdrop.php b/CRM/Utils/System/Backdrop.php index 9e1760b5eb..1b0a3c1f50 100644 --- a/CRM/Utils/System/Backdrop.php +++ b/CRM/Utils/System/Backdrop.php @@ -343,8 +343,8 @@ class CRM_Utils_System_Backdrop extends CRM_Utils_System_DrupalBase { // Contact CiviSMTP folks if we run into issues with this :) $cmsPath = $config->userSystem->cmsRootPath($realPath); - require_once "$cmsPath/includes/bootstrap.inc"; - require_once "$cmsPath/includes/password.inc"; + require_once "$cmsPath/core/includes/bootstrap.inc"; + require_once "$cmsPath/core/includes/password.inc"; $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower'; $name = $dbDrupal->escapeSimple($strtolower($name)); @@ -465,7 +465,7 @@ AND u.status = 1 //take the cms root path. $cmsPath = $this->cmsRootPath($realPath); - if (!file_exists("$cmsPath/includes/bootstrap.inc")) { + if (!file_exists("$cmsPath/core/includes/bootstrap.inc")) { if ($throwError) { echo '
Sorry, could not locate bootstrap.inc\n'; exit(); @@ -474,7 +474,7 @@ AND u.status = 1 } // load drupal bootstrap chdir($cmsPath); - define('DRUPAL_ROOT', $cmsPath); + define('BACKDROP_ROOT', $cmsPath); // For drupal multi-site CRM-11313 if ($realPath && strpos($realPath, 'sites/all/modules/') === FALSE) { @@ -483,9 +483,9 @@ AND u.status = 1 $_SERVER['HTTP_HOST'] = $matches[1]; } } - require_once 'includes/bootstrap.inc'; + require_once 'core/includes/bootstrap.inc'; // @ to suppress notices eg 'DRUPALFOO already defined'. - @drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); + @backdrop_bootstrap(BACKDROP_BOOTSTRAP_FULL); // explicitly setting error reporting, since we cannot handle drupal related notices error_reporting(1); @@ -597,9 +597,8 @@ AND u.status = 1 // work for multisite installation. do { $cmsRoot = $firstVar . '/' . implode('/', $pathVars); - $cmsIncludePath = "$cmsRoot/includes"; - // Stop if we find bootstrap. - if (file_exists("$cmsIncludePath/bootstrap.inc")) { + // Stop if we find backdrop signature file. + if (file_exists("$cmsRoot/core/misc/backdrop.js")) { $valid = TRUE; break; } @@ -831,4 +830,19 @@ AND u.status = 1 ); } + + /** + * Get all the contact emails for users that have a specific permission. + * + * @param string $permissionName + * Name of the permission we are interested in. + * + * @return string + * a comma separated list of email addresses + */ + public function permissionEmails($permissionName) { + // FIXME!!!! + return array(); + } + } -- 2.25.1