From ddc6c74bd050334537808c2418d2246055716562 Mon Sep 17 00:00:00 2001
From: Urban Müller
Date: Tue, 17 Feb 2009 14:57:36 +0000
Subject: send no mails from devel/twin, treat missing severtype.cfg as live
---
it.class | 2 +-
it_mail.class | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/it.class b/it.class
index 029f7e5..ee110dc 100644
--- a/it.class
+++ b/it.class
@@ -256,7 +256,7 @@ function bail($message = "Bailed.\n")
*/
function is_live()
{
- return (preg_match("/^live/", $GLOBALS['ULTRASERVERTYPE']) || EDC('aslive')) && !EDC('asdevel');
+ return (preg_match("/^live/", $GLOBALS['ULTRASERVERTYPE']) || !$GLOBALS['ULTRASERVERTYPE'] || EDC('aslive')) && !EDC('asdevel');
}
diff --git a/it_mail.class b/it_mail.class
index 0eb7643..0995e49 100644
--- a/it_mail.class
+++ b/it_mail.class
@@ -32,6 +32,7 @@ define('IT_MAIL_CHECKEMAIL_OK', 10);
/**
* Construct an email message with headers, body (plaintext and/or HTML) and
* send it. Also provides utility function to check email address validity.
+ * On devel/twin machines, will output mail instead of sending it.
* Example:
*
* if (!it_mail::check_email($to))
@@ -285,7 +286,7 @@ function send()
$text .= "--$boundary1--\n";
}
- $func = EDC('nomail') ? "ED" : "mail";
+ $func = it::is_live() ? "mail" : "ED";
return $func($to, $this->header_escape($this->subject), $text, join("\n", $headers), $this->flags);
}
--
cgit v1.2.3