do not intanciate Email class if emailing is turned off

checking if email is on was removed from Email class
This commit is contained in:
Uwe Steinmann 2013-03-08 18:20:45 +01:00
parent b4ea1a922d
commit 5e87cb378d
2 changed files with 6 additions and 14 deletions

View File

@ -43,8 +43,12 @@ if (!is_object($user)) {
}
$dms->setUser($user);
$notifier = new SeedDMS_Email();
$notifier->setSender($user);
if($settings->_enableEmail) {
$notifier = new SeedDMS_Email();
$notifier->setSender($user);
} else {
$notifier = null;
}
/* Include the language file as specified in the session. If that is not
* available use the language from the settings

View File

@ -32,10 +32,6 @@ require_once("inc.ClassNotify.php");
class SeedDMS_Email extends SeedDMS_Notify {
function toIndividual($sender, $recipient, $subject, $message, $params=array()) { /* {{{ */
global $settings;
if ($settings->_enableEmail==FALSE) return 0;
if ($recipient->getEmail()=="") return 0;
if ((!is_object($sender) && strcasecmp(get_class($sender), "SeedDMS_Core_User")) ||
@ -59,10 +55,6 @@ class SeedDMS_Email extends SeedDMS_Notify {
} /* }}} */
function toGroup($sender, $groupRecipient, $subject, $message, $params=array()) { /* {{{ */
global $settings;
if (!$settings->_enableEmail) return 0;
if ((!is_object($sender) && strcasecmp(get_class($sender), "SeedDMS_Core_User")) ||
(!is_object($groupRecipient) && strcasecmp(get_class($groupRecipient), "SeedDMS_Core_Group"))) {
return -1;
@ -76,10 +68,6 @@ class SeedDMS_Email extends SeedDMS_Notify {
} /* }}} */
function toList($sender, $recipients, $subject, $message, $params) { /* {{{ */
global $settings;
if (!$settings->_enableEmail) return 0;
if ((!is_object($sender) && strcasecmp(get_class($sender), "SeedDMS_Core_User")) ||
(!is_array($recipients) && count($recipients)==0)) {
return -1;