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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Update the 2.1 employer field after importing/updating relationships
Pages: [1]

Author Topic: Update the 2.1 employer field after importing/updating relationships  (Read 1025 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Update the 2.1 employer field after importing/updating relationships
October 13, 2008, 08:41:40 am
Hi,

As said, the employer field isn't always properly updated (eg. when you import individuals and set the Current employer).

I wrote a quick and dirty php cron, that find them (rule: employer_id is null and there is a relationship of type employee of without an end date)

Question before I share it:

I don't want to run this cron from a webserver (eg. no wget http://?passwordinclear=xxx...), but from a php-cli, so I don't have memory or timeout problems

So far, I hacked civicrm.config.php (and passed the path to sivicrm.seetings.php), but I was wondering if they where a framework to do that properly ?

More specifically, what I'm looking for is to run :

php-cli bin/UpdateEmployer --site example.com --user admin

I've seen the Console pear that you use, so it takes care of the params.

What I'd like is :
1) Avoid to hack the civicrm.setting.php
2) a CRM_Utils_System::authenticateScript that doesn't need a password, but I can list on civicrm.config.php what linux user/drupal user can run scripts from the cli without having to put a password

Rationale:
a) I don't like having passwords hanging around in cleartext like that if I can avoid it
b) if I get access to the cli, that's really likely that I can read civicrm.config.php, so I can access the db, the password doesn't add any security


What do you think ? (btw, I'd love to have the same for the civimail crons so I can use the php-cli for them too)

X+

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Update the 2.1 employer field after importing/updating relationships
November 09, 2008, 04:09:50 am
Script uploaded. Works for our configuration, YMMV.

http://issues.civicrm.org/jira/browse/CRM-3820
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Update the 2.1 employer field after importing/updating relationships

This forum was archived on 2017-11-26.