Browse Source

make EmailLib return log + correct security measure for Email.live

euromark 11 years ago
parent
commit
9a3e752340
2 changed files with 11 additions and 4 deletions
  1. 11 2
      Lib/EmailLib.php
  2. 0 2
      View/Helper/TextExtHelper.php

+ 11 - 2
Lib/EmailLib.php

@@ -447,8 +447,8 @@ class EmailLib extends CakeEmail {
 			//$this->_headers['Importance'] = 'High';
 		}
 
-		// Security measure to not sent to the actual addressee in debug mode
-		if (Configure::read('debug') && !Configure::read('Email.live')) {
+		// Security measure to not sent to the actual addressee in debug mode while email sending is live
+		if (Configure::read('debug') && Configure::read('Email.live')) {
 			$adminEmail = Configure::read('Config.adminEmail');
 			if (!$adminEmail) {
 				$adminEmail = Configure::read('Config.systemEmail');
@@ -517,6 +517,15 @@ class EmailLib extends CakeEmail {
 	}
 
 	/**
+	 * Returns the log if existent
+	 *
+	 * @return string
+	 */
+	public function getLog() {
+		return $this->_log;
+	}
+
+	/**
 	 * Returns the debug content returned by send()
 	 *
 	 * @return string

+ 0 - 2
View/Helper/TextExtHelper.php

@@ -108,8 +108,6 @@ class TextExtHelper extends TextHelper {
 		}
 
 		$Html = new HtmlHelper(new View(null));
-		//$Html->tags = $Html->loadConfig();
-		//debug($Html->tags);
 		if (!$obfuscate) {
 			return $Html->link($email, "mailto:" . $email, $options);
 		}