You are here

function civicrm_cron_init in CiviCRM Cron 6

File

./civicrm_cron.module, line 18
Civicrm Cron Module Uses _cron for drupals cron job to trigger civicrm's new Consolidated Cron Jobs used by Visions Service Adventures website

Code

function civicrm_cron_init() {
  if ((arg(0) == 'admin' || arg(0) == 'civicrm') && user_access('administer CiviCRM')) {
    if (!($mail_process_user = user_load(array(
      'name' => variable_get('civicrm_cron_username', NULL),
    )))) {
      return;
    }
    if ($mail_process_user->status) {
      drupal_set_message("CiviCRM Cron Module Problem!! The mail user you have set up, \n     <a href = 'user/{$mail_process_user->uid}'>{$mail_process_user->name}</a>, is set as an <em>active</em> user. \nThe password for this user is stored in the clear in the database.  <p>\nTo greatly improve security, you should make this user blocked: " . l('Edit this user', 'user/' . $mail_process_user->uid . '/edit'), error);
    }
  }

  // end "if an administrator on an admin or civi page" ...
  return;
}