$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
);
}
// 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
);
}
$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
);
}
// 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
);
}
CRM_Core_Error::fatal("Cannot connect to drupal db via $config->userFrameworkDSN, " . $dbDrupal->getMessage());
}
+
+
$account = $userUid = $userMail = NULL;
if ($loadCMSBootstrap) {
$bootStrapParams = array();
* @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);
// 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();
// 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');
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');
* @return string $url, formatted url.
* @static
*/
- function languageNegotiationURL($url,
+ function languageNegotiationURL(
+ $url,
$addLanguagePart = TRUE,
$removeLanguagePart = FALSE
) {