CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • cron jobs stopped authenticating
Pages: 1 [2]

Author Topic: cron jobs stopped authenticating  (Read 3903 times)

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: cron jobs stopped authenticating
August 19, 2009, 06:33:19 am
Quote
Does it also contain ‘hash to cryptpass returned false’?

No, it does not.

To summarize what we know so far:
  • The membername/password combination properly logs into the backed of Joomla directly
  • The sql query retrieves the correct row for the membername
  • The password matches correctly

So I added debug code to the next section
Code: [Select]
<?php
            CRM_Core_BAO_UFMatch
::synchronizeUFMatch( $user, $row['id'], $row['email'], 'Joomla' );
            
$contactID = CRM_Core_BAO_UFMatch::getContactId( $row['id'] );
file_put_contents('/public/www/htdocs/administrator/debug.txt', "contactID = $contactID \n");
            if ( ! 
$contactID ) {
file_put_contents('/public/www/htdocs/administrator/debug.txt', "contactID returned false",FILE_APPEND);
                return 
false;
            }
            return array( 
$contactID, $row['id'], mt_rand() );
and found the following:
Quote
contactID = 
contactID returned false

So one of the first two lines of code in this final section is not working....
Lead Developer, C3 Design.
Twitter: @FatherShawn

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: cron jobs stopped authenticating
August 20, 2009, 01:54:10 am
Quote from: FatherShawn on August 19, 2009, 06:33:19 am
So I added debug code to the next section
Code: [Select]
<?php
            CRM_Core_BAO_UFMatch
::synchronizeUFMatch( $user, $row['id'], $row['email'], 'Joomla' );
            
$contactID = CRM_Core_BAO_UFMatch::getContactId( $row['id'] );
file_put_contents('/public/www/htdocs/administrator/debug.txt', "contactID = $contactID \n");
            if ( ! 
$contactID ) {
file_put_contents('/public/www/htdocs/administrator/debug.txt', "contactID returned false",FILE_APPEND);
                return 
false;
            }
            return array( 
$contactID, $row['id'], mt_rand() );
and found the following:
Quote
contactID = 
contactID returned false

This means that the related CiviCRM contact is missing. Can you add

Code: [Select]
<?php
file_put_contents
('/public/www/htdocs/administrator/debug.txt', print_r($row, true));

before the above lines? This should put the contents of the $row array in the log file, and you can see afterwards whether the associated CiviCRM contact really exists (in the civicrm_contact table).
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: cron jobs stopped authenticating
August 20, 2009, 08:23:22 am
Quote
This means that the related CiviCRM contact is missing.

That's it!!  All this debug code, and it's a documentation error!!  The documentation reads:
Quote
name - Valid username for an authorized Drupal or Joomla user.

For security, since the password is saved in the cron file, even though that's out of the web root and not world readable, I've always used a Joomla user created just for CiviMail processing with the lowest possible backend priviledges.  There wasn't a CiviCRM contact for that user.  Sycronize Users to Contacts created a record in UF_Match, but with a null ContactID.  I added the ContactID directly to the proper field, and "TA DA!"  It works again!

Thanks for stepping it through with me Piotr!!  I'm moving to a new church and really wanted to leave this installation fully functional!
Lead Developer, C3 Design.
Twitter: @FatherShawn

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: cron jobs stopped authenticating
August 21, 2009, 02:35:26 am
Quote from: FatherShawn on August 20, 2009, 08:23:22 am
Quote
This means that the related CiviCRM contact is missing.

That's it!!  All this debug code, and it's a documentation error!!

Ah, right. :) I fixed the documentation – I guess we missed this all this time because if you logged in with that credentials and accessed any CiviCRM page, the contact for that user would get created automatically.

Quote
For security, since the password is saved in the cron file, even though that's out of the web root and not world readable, I've always used a Joomla user created just for CiviMail processing with the lowest possible backend priviledges.

That’s definitely a good approach!

Quote
Thanks for stepping it through with me Piotr!!  I'm moving to a new church and really wanted to leave this installation fully functional!

I’m happy that we managed to track it down. :) All the best in your new church!
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • cron jobs stopped authenticating

This forum was archived on 2017-11-26.