Merge pull request #782 from dlobo/FormattingFixes
authordlobo <lobo@civicrm.org>
Fri, 17 May 2013 00:45:47 +0000 (17:45 -0700)
committerdlobo <lobo@civicrm.org>
Fri, 17 May 2013 00:45:47 +0000 (17:45 -0700)
fix formatting

CRM/Utils/System.php
CRM/Utils/System/Drupal.php

index 13d73224253d040e0c937399684236c9ffdb9df6..4d8d541c8440ba3dc76b9deaceea2a67a8a98ae3 100644 (file)
@@ -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
         );
       }
index 0a7a78d056f0c3d3cda1a1ee6a7a845063f3cd23..9f746990e2f5afb34aeda35d64d21b0f76466ef6 100644 (file)
@@ -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 '<br />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
   ) {