* @param $loadFromDB boolean whether to load from the database
* @param $force boolean whether to force a reconstruction
*
- * @return object
+ * @return CRM_Core_Config
* @static
*/
static function &singleton($loadFromDB = TRUE, $force = FALSE) {
array(1 => array($userID, 'Integer'))
);
}
+
+ // initialize authentication source
+ self::$_singleton->initAuthSrc();
}
return self::$_singleton;
}
}
/**
- * retrieve a mailer to send any mail from the applciation
+ * Retrieve a mailer to send any mail from the application
*
* @param boolean $persist open a persistent smtp connection, should speed up mailings
- *
* @access private
- *
* @return object
*/
static function &getMailer($persist = FALSE) {
CRM_Core_Error::debug_log_message(ts('Outbound mail has been disabled. Click <a href=\'%1\'>Administer >> System Setting >> Outbound Email</a> to set the OutBound Email.', array(1 => CRM_Utils_System::url('civicrm/admin/setting/smtp', 'reset=1'))));
CRM_Core_Session::setStatus(ts('Outbound mail has been disabled. Click <a href=\'%1\'>Administer >> System Setting >> Outbound Email</a> to set the OutBound Email.', array(1 => CRM_Utils_System::url('civicrm/admin/setting/smtp', 'reset=1'))));
}
- else{
+ else {
CRM_Core_Error::debug_log_message(ts('There is no valid SMTP server Setting Or SendMail path setting. Click <a href=\'%1\'>Administer >> System Setting >> Outbound Email</a> to set the OutBound Email.', array(1 => CRM_Utils_System::url('civicrm/admin/setting/smtp', 'reset=1'))));
CRM_Core_Session::setStatus(ts('There is no valid SMTP server Setting Or sendMail path setting. Click <a href=\'%1\'>Administer >> System Setting >> Outbound Email</a> to set the OutBound Email.', array(1 => CRM_Utils_System::url('civicrm/admin/setting/smtp', 'reset=1'))));
CRM_Core_Error::debug_var('mailing_info', $mailingInfo);
}
/**
+ * Create a new instance of a PEAR Mail driver
+ *
* @param string $driver 'CRM_Mailing_BAO_Spool' or a name suitable for Mail::factory()
* @param array $params
- * @return Mail|NULL
+ * @return Mail (More specifically, a class which implements the "send()" function)
*/
public static function _createMailer($driver, $params) {
if ($driver == 'CRM_Mailing_BAO_Spool') {
$mailer = new CRM_Mailing_BAO_Spool($params);
- } else {
+ }
+ else {
$mailer = Mail::factory($driver, $params);
}
- CRM_Utils_Hook::hook_civicrm_alterMailer($mailer, $driver, $params);
+ CRM_Utils_Hook::alterMail($mailer, $driver, $params);
return $mailer;
}
CRM_Core_DAO::executeQuery($query);
}
+ // This method should initialize auth sources
+ function initAuthSrc() {
+ $session = CRM_Core_Session::singleton();
+ if ($session->get('userID') && !$session->get('authSrc')) {
+ $session->set('authSrc', CRM_Core_Permission::AUTH_SRC_LOGIN);
+ }
+
+ // checksum source
+ CRM_Contact_BAO_Contact_Permission::initChecksumAuthSrc();
+ }
+
/**
* one function to get domain ID
*/