From 0af0e4c9492ae427bd878326599308f6a1f3371b Mon Sep 17 00:00:00 2001 From: "Donald A. Lobo" Date: Thu, 16 May 2013 17:44:23 -0700 Subject: [PATCH] fix formatting --- CRM/Utils/System.php | 26 +++++++++++++++----------- CRM/Utils/System/Drupal.php | 18 +++++++++--------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/CRM/Utils/System.php b/CRM/Utils/System.php index 13d7322425..4d8d541c84 100644 --- a/CRM/Utils/System.php +++ b/CRM/Utils/System.php @@ -494,29 +494,31 @@ class CRM_Utils_System { $docAdd = "More info at:" . CRM_Utils_System::docURL2("Managing Scheduled Jobs", TRUE, NULL, NULL, NULL, "wiki"); if (!$key) { - return self::authenticateAbort("ERROR: You need to send a valid key to execute this file. " . $docAdd . "\n", + return self::authenticateAbort( + "ERROR: You need to send a valid key to execute this file. " . $docAdd . "\n", $abort ); } $siteKey = defined('CIVICRM_SITE_KEY') ? CIVICRM_SITE_KEY : NULL; - if (!$siteKey || - empty($siteKey) - ) { - return self::authenticateAbort("ERROR: You need to set a valid site key in civicrm.settings.php. " . $docAdd . "\n", + if (!$siteKey || empty($siteKey)) { + return self::authenticateAbort( + "ERROR: You need to set a valid site key in civicrm.settings.php. " . $docAdd . "\n", $abort ); } if (strlen($siteKey) < 8) { - return self::authenticateAbort("ERROR: Site key needs to be greater than 7 characters in civicrm.settings.php. " . $docAdd . "\n", + return self::authenticateAbort( + "ERROR: Site key needs to be greater than 7 characters in civicrm.settings.php. " . $docAdd . "\n", $abort ); } if ($key !== $siteKey) { - return self::authenticateAbort("ERROR: Invalid key value sent. " . $docAdd . "\n", + return self::authenticateAbort( + "ERROR: Invalid key value sent. " . $docAdd . "\n", $abort ); } @@ -535,7 +537,8 @@ class CRM_Utils_System { // its ok to have an empty password if (!$name) { - return self::authenticateAbort("ERROR: You need to send a valid user name and password to execute this file\n", + return self::authenticateAbort( + "ERROR: You need to send a valid user name and password to execute this file\n", $abort ); } @@ -546,7 +549,8 @@ class CRM_Utils_System { $result = CRM_Utils_System::authenticate($name, $pass, $loadCMSBootstrap); if (!$result) { - return self::authenticateAbort("ERROR: Invalid username and/or password\n", + return self::authenticateAbort( + "ERROR: Invalid username and/or password\n", $abort ); } @@ -554,12 +558,12 @@ class CRM_Utils_System { // lets store contact id and user id in session list($userID, $ufID, $randomNumber) = $result; if ($userID && $ufID) { - $config = CRM_Core_Config::singleton(); $config->userSystem->setUserSession( array($userID, $ufID) ); } else { - return self::authenticateAbort("ERROR: Unexpected error, could not match userID and contactID", + return self::authenticateAbort( + "ERROR: Unexpected error, could not match userID and contactID", $abort ); } diff --git a/CRM/Utils/System/Drupal.php b/CRM/Utils/System/Drupal.php index 0a7a78d056..9f746990e2 100644 --- a/CRM/Utils/System/Drupal.php +++ b/CRM/Utils/System/Drupal.php @@ -567,6 +567,8 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_Base { CRM_Core_Error::fatal("Cannot connect to drupal db via $config->userFrameworkDSN, " . $dbDrupal->getMessage()); } + + $account = $userUid = $userMail = NULL; if ($loadCMSBootstrap) { $bootStrapParams = array(); @@ -721,8 +723,8 @@ AND u.status = 1 * @param $loadUser boolean load cms user? * @param $throwError throw error on failure? */ - function loadBootStrap($params = array( - ), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) { + + function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) { //take the cms root path. $cmsPath = $this->cmsRootPath($realPath); @@ -749,9 +751,7 @@ AND u.status = 1 // explicitly setting error reporting, since we cannot handle drupal related notices error_reporting(1); - if (!function_exists('module_exists') || - !module_exists('civicrm') - ) { + if (!function_exists('module_exists') || !module_exists('civicrm')) { if ($throwError) { echo '
Sorry, could not load drupal bootstrap.'; exit(); @@ -762,8 +762,6 @@ AND u.status = 1 // seems like we've bootstrapped drupal $config = CRM_Core_Config::singleton(); - - // lets also fix the clean url setting // CRM-6948 $config->cleanURL = (int) variable_get('clean_url', '0'); @@ -810,7 +808,8 @@ AND u.status = 1 exit(); } - // CRM-6948: When using loadBootStrap, it's implicit that CiviCRM has already loaded its settings, which means that define(CIVICRM_CLEANURL) was correctly set. + // CRM-6948: When using loadBootStrap, it's implicit that CiviCRM has already loaded its settings + // which means that define(CIVICRM_CLEANURL) was correctly set. // So we correct it $config = CRM_Core_Config::singleton(); $config->cleanURL = (int)variable_get('clean_url', '0'); @@ -908,7 +907,8 @@ AND u.status = 1 * @return string $url, formatted url. * @static */ - function languageNegotiationURL($url, + function languageNegotiationURL( + $url, $addLanguagePart = TRUE, $removeLanguagePart = FALSE ) { -- 2.25.1