-
Notifications
You must be signed in to change notification settings - Fork 445
Login Failure: all versions below 4.1.4
(Some technical information follows - skip to "What now??" if you're not interested in this stuff)
The ChurchCRM development team became aware of a problem affecting some users being unable to login (#5357, #5364, #5362). After investigation it became evident the problem was a combination of our code, and a a recent update to PHP, which has been applied to all currently supported PHP releases. Long story short, our login session uses a character that this new PHP patch rejected which meant all logins were succeeding, but the session establishment failed.
- Manually apply a code change to restore logins, then use the in-app upgrade wizard.
- Manual upgrade to ChurchCRM 4.1.4 (or later version)
You will need to change one line in the Bootstrapper.php
file. Once this file is saved, logins should start working again.
-
Find the
ChurchCRM/Bootstrapper.php
in your existing ChurchCRM deployment. For example, if your ChurchCRM is deployed on your web server at/var/www/churchcrm
then the file will be in/var/www/churchcrm/ChurchCRM/Bootstrapper.php
. -
Open the
Bootstrapper.php
in a text editor. At or around line 217 there will be the following block of code:public static function initSession() { // Initialize the session $sessionName = 'CRM@'.SystemURLs::getRootPath(); session_cache_limiter('private_no_expire:'); session_name($sessionName); session_start(); self::$bootStrapLogger->debug("Session initialized: " . $sessionName); }
-
Modify the line
$sessionName = 'CRM@'.SystemURLs::getRootPath();
to read exactly as follows:$sessionName = 'CRM-'.hash("md5",SystemURLs::getDocumentRoot());
-
The corrected code block should now look like this:
public static function initSession() { // Initialize the session $sessionName = 'CRM-'.hash("md5",SystemURLs::getDocumentRoot()); // <--- ONLY this line was changed session_cache_limiter('private_no_expire:'); session_name($sessionName); session_start(); self::$bootStrapLogger->debug("Session initialized: " . $sessionName); }
-
Save the file and log in.
-
Once background tasks have been completed, you should see an automatic update task in the top right.
Manual upgrades assume a certain level of comfort on the command line and/or FTP. If this is NOT you, consider option #1. Always make sure you have a backup of your existing setup before attempting an upgrade. A simple backup for a once-off upgrade like this might be (replace /var/www/churchcrm
with your ChurchCRM installation path):
cp -a /var/www/churchcrm /var/www/churchcrm-old
mysqldump --user=youCCRMDBuser \
--password=yourCCRMDBpassword \
--add-drop-table \
--routines \
--triggers \
--single-transaction ChurchCRMDB_NAME > /var/www/churchcrm-old/ChurchCRM.sql
Note: the database connection information will be in the /var/www/churchcrm/Include/Config.php
file.
The steps involved in a manual upgrade are (replace /var/www/churchcrm
with your directory where ChurchCRM is deployed):
-
Download the Latest zip file (or at least 4.1.4+) from https://github.com/ChurchCRM/CRM/releases/latest into your "home" directory on your web host:
cd $HOME wget https://github.com/ChurchCRM/CRM/releases/download/4.1.4/ChurchCRM-4.1.4.zip
-
Unzip the release file:
unzip ChurchCRM-4.1.4.zip
This will create a
churchcrm
directory in your home directory. -
Update the files in the existing Church CRM directory using
rsync
if available, orcp
if not:rsync -a $HOME/churchcrm/* /var/www/churchcrm/
or
cp -r $HOME/churchcrm/* /var/www/churchcrm/
-
Update file permissions.
-
Go back to the main page, click the upgrade database button.
-
Log into your upgraded system.