This commit has been accessed 687 times via Git panel.
commit ab11a97af1959c7cb686e3ee3ebf28615fabe00a
tree 73d46de4900ba7e96b4e76e3d1c0ce51d9e8d1d5
parent f0af01aa38ff14385de35469036b0e111add6271
author Engels Antonio <engels@majcms.org> 1335902044 +0800
committer Engels Antonio <engels@majcms.org> 1335902044 +0800
Fix mail headers
diff --git a/add.php b/add.php
index 1f5d8ca..baaffd8 100644
--- a/add.php
+++ b/add.php
@@ -618,9 +618,9 @@ if (isset($_FILES['file_input']) and !empty($_FILES['file_input'])) {
$ml_to = '"' . "$ml_to_firstname $ml_to_lastname" . '" <' . $ml_to . '>';
if (file_exists("$maj_data_directory/ml-reply2.txt")) {
- mb_send_mail($ml_to, $ml_subject, $ml_body, "From: $ml_from\r\n" . "Reply-To: $ml_reply2\r\n" . "References: $entry\r\n" . "X-Mailer: $maj_mailer");
+ mb_send_mail($ml_to, $ml_subject, $ml_body, "From: $ml_from\n" . "Reply-To: $ml_reply2\n" . "References: $entry\n" . "X-Mailer: $maj_mailer");
} else {
- mb_send_mail($ml_to, $ml_subject, $ml_body, "From: $ml_from\r\n" . "References: $entry\r\n" . "X-Mailer: $maj_mailer");
+ mb_send_mail($ml_to, $ml_subject, $ml_body, "From: $ml_from\n" . "References: $entry\n" . "X-Mailer: $maj_mailer");
}
}
}
@@ -706,7 +706,7 @@ if (isset($_POST['notify']) and !empty($_POST['notify']) and file_exists("$maj_d
continue;
}
- mb_send_mail($notify_to, $title_write_content, $body_write_content, "From: $notify_from\r\n" . "References: $entry\r\n" . "X-Mailer: $maj_mailer");
+ mb_send_mail($notify_to, $title_write_content, $body_write_content, "From: $notify_from\n" . "References: $entry\n" . "X-Mailer: $maj_mailer");
}
}
}
diff --git a/css.php b/css.php
index ac9aa96..33531e2 100644
--- a/css.php
+++ b/css.php
@@ -121,7 +121,8 @@ body {
echo "\n\tbackground-repeat: ";
if (file_exists("data/bg-repeat.txt")) {
- readfile("data/bg-repeat.txt");
+ $get_bg_repeat = file_get_contents("data/bg-repeat.txt");
+ echo $get_bg_repeat;
}
else {
echo "repeat";
@@ -139,6 +140,10 @@ body {
}
echo ";";
+
+ if (($get_bg_repeat == "no-repeat") and file_exists("data/bg-stretch.txt")) {
+ echo "\n\tbackground-size: 100%;";
+ }
}
echo "\n";
diff --git a/index.php b/index.php
index 42ca206..50d1c81 100644
--- a/index.php
+++ b/index.php
@@ -242,15 +242,15 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
if (file_exists("$maj_data_directory/ml-reply2.txt")) {
mb_send_mail($maj_ml_to,$maj_ml_subject,$maj_ml_body,
- "From: $maj_ml_from\r\n" .
- "Reply-To: $maj_ml_reply2\r\n" .
- "References: $maj_req_entry\r\n" .
+ "From: $maj_ml_from\n" .
+ "Reply-To: $maj_ml_reply2\n" .
+ "References: $maj_req_entry\n" .
"X-Mailer: $maj_ml_mailer");
}
else {
mb_send_mail($maj_ml_to,$maj_ml_subject,$maj_ml_body,
- "From: $maj_ml_from\r\n" .
- "References: $maj_req_entry\r\n" .
+ "From: $maj_ml_from\n" .
+ "References: $maj_req_entry\n" .
"X-Mailer: $maj_ml_mailer");
}
}
@@ -438,8 +438,8 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
//$maj_comment_thanks = wordwrap($maj_comment_thanks);
mb_send_mail($maj_email_to,"Thanks for sharing your thoughts!",$maj_comment_thanks,
- "From: $maj_from_email\r\n" .
- "Reply-To: $maj_from_email\r\n" .
+ "From: $maj_from_email\n" .
+ "Reply-To: $maj_from_email\n" .
"X-Mailer: $maj_mailer");
}
@@ -449,8 +449,8 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
//$maj_comment_notice = wordwrap($maj_comment_notice);
mb_send_mail($maj_from_email,"Pending Comment",$maj_comment_notice,
- "From: $maj_from_email\r\n" .
- "Reply-To: $maj_from_email\r\n" .
+ "From: $maj_from_email\n" .
+ "Reply-To: $maj_from_email\n" .
"X-Mailer: $maj_mailer");
}
diff --git a/options.php b/options.php
index 19b25a6..8b1d167 100644
--- a/options.php
+++ b/options.php
@@ -94,8 +94,8 @@ if (isset($_POST['email']) and !empty($_POST['email']) and (file_get_contents("$
$email_from = '"' . $sig_author . '" <' . $from_email . '>';
mb_send_mail($email_to, "confirm $key_email", $confirm_change,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
+ "From: $email_from\n" .
+ "Reply-To: $email_from\n" .
"X-Mailer: $maj_mailer");
echo "Confirmation request sent. Check your $email_write_content inbox for details.";
diff --git a/reg.php b/reg.php
index ec62e66..97c5b5e 100644
--- a/reg.php
+++ b/reg.php
@@ -111,13 +111,13 @@ if (isset($_REQUEST['username']) and !empty($_REQUEST['username']) and isset($_R
$email_to = '"' . "$firstname $lastname" . '" <' . $email . '>';
mb_send_mail($email_from, "registration notice ($email)", $registered_notice,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
+ "From: $email_from\n" .
+ "Reply-To: $email_from\n" .
"X-Mailer: $maj_mailer");
mb_send_mail($email_to, "password notice ($username)", $password_notice,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
+ "From: $email_from\n" .
+ "Reply-To: $email_from\n" .
"X-Mailer: $maj_mailer");
$fp_new_txt = fopen("$maj_data_directory/bb-new.txt","w");
@@ -183,8 +183,8 @@ if (isset($_REQUEST['username']) and !empty($_REQUEST['username']) and isset($_R
$email_from = '"' . $sig_author . '" <' . $from_email . '>';
mb_send_mail($email_from, "confirmation notice ($email)", $confirmation_notice,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
+ "From: $email_from\n" .
+ "Reply-To: $email_from\n" .
"X-Mailer: $maj_mailer");
}
else {
@@ -198,8 +198,8 @@ if (isset($_REQUEST['username']) and !empty($_REQUEST['username']) and isset($_R
$email_from = '"' . $sig_author . '" <' . $from_email . '>';
mb_send_mail($email_from, "registration notice ($email)", $registered_notice,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
+ "From: $email_from\n" .
+ "Reply-To: $email_from\n" .
"X-Mailer: $maj_mailer");
$password = str_rand(16);
@@ -231,8 +231,8 @@ if (isset($_REQUEST['username']) and !empty($_REQUEST['username']) and isset($_R
$email_to = '"' . "$firstname $lastname" . '" <' . $email . '>';
mb_send_mail($email_to, "password notice ($username)", $password_notice,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
+ "From: $email_from\n" .
+ "Reply-To: $email_from\n" .
"X-Mailer: $maj_mailer");
$fp_new_txt = fopen("$maj_data_directory/bb-new.txt","w");
@@ -590,8 +590,8 @@ if ($_POST['submit'] == "1") {
$email_to = '"' . "$firstname $lastname" . '" <' . $email . '>';
mb_send_mail($email_to, "confirm $key", $confirm_thanks,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
+ "From: $email_from\n" .
+ "Reply-To: $email_from\n" .
"X-Mailer: $maj_mailer");
unset($err_username);
diff --git a/reset.php b/reset.php
index 7fa1ace..6dd8e26 100644
--- a/reset.php
+++ b/reset.php
@@ -94,13 +94,13 @@ if (isset($_POST['username']) and !empty($_POST['username']) and isset($_POST['a
//$password_notice = wordwrap($password_notice);
mb_send_mail($from_email, "password reset notice ($username)", $reset_notice,
- "From: $from_email\r\n" .
- "Reply-To: $from_email\r\n" .
+ "From: $from_email\n" .
+ "Reply-To: $from_email\n" .
"X-Mailer: $maj_mailer");
mb_send_mail($email, "password reset notice ($username)", $password_notice,
- "From: $from_email\r\n" .
- "Reply-To: $from_email\r\n" .
+ "From: $from_email\n" .
+ "Reply-To: $from_email\n" .
"X-Mailer: $maj_mailer");
if (file_exists("$maj_data_directory/members/active/$username/bb-lockout.txt")) {
diff --git a/settings.php b/settings.php
index 17adee3..8159804 100644
--- a/settings.php
+++ b/settings.php
@@ -955,10 +955,29 @@ if (isset($_POST['bg_repeat']) and !empty($_POST['bg_repeat']) and (file_get_con
$fp_bg_repeat_txt = fopen("data/bg-repeat.txt","w");
fwrite($fp_bg_repeat_txt,$_POST['bg_repeat']);
fclose($fp_bg_repeat_txt);
+
+ if (file_exists("data/bg-stretch.txt") and ($_POST['bg_repeat'] != "no-repeat")) {
+ unlink("data/bg-stretch.txt");
+ }
}
if (isset($_POST['bg_repeat']) and !empty($_POST['bg_repeat']) and (file_get_contents("data/bg-repeat.txt") != $_POST['bg_repeat']) and ($_POST['bg_repeat'] == "repeat") and file_exists("data/bg-repeat.txt")) {
unlink("data/bg-repeat.txt");
+ if (file_exists("data/bg-stretch.txt")) {
+ unlink("data/bg-stretch.txt");
+ }
+}
+
+if (isset($_POST['bg_stretch']) and !empty($_POST['bg_stretch']) and ($_POST['bg_stretch'] == "on") and (file_get_contents("data/bg-repeat.txt") == "no-repeat") and !file_exists("data/bg-stretch.txt")) {
+ touch("data/bg-stretch.txt");
+}
+
+if (!isset($_POST['bg_stretch']) or empty($_POST['bg_stretch'])) {
+ if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
+ if (file_exists("data/bg-stretch.txt")) {
+ unlink("data/bg-stretch.txt");
+ }
+ }
}
if (isset($_POST['bg_position']) and !empty($_POST['bg_position']) and (file_get_contents("data/bg-position.txt") != $_POST['bg_position']) and ($_POST['bg_position'] != "top left")) {
@@ -1412,7 +1431,19 @@ if (file_exists("images/background.gif") or file_exists("images/background.jpg")
if (file_exists("data/bg-scroll.txt")) {
echo " checked";
}
- echo '> Background image scrolls with the rest of the page.</td></tr>';
+ echo '> Background image will scroll with the rest of the page.</td></tr>';
+
+ if (file_exists("data/bg-repeat.txt") and (file_get_contents("data/bg-repeat.txt") == "no-repeat")) {
+
+ echo "<tr><td></td><td><input type=\"checkbox\" name=\"bg_stretch\"";
+
+ if (file_exists("data/bg-stretch.txt")) {
+ echo " checked";
+ }
+
+ echo "> Background image will be stretched across the page.</td></tr>";
+ }
+
echo '<tr><td rowspan=4>background repeat</td><td><input type="radio" name="bg_repeat" value="repeat"
style="background : #ffffff; color : #666666"';
if (!file_exists("data/bg-repeat.txt")) {
tree 73d46de4900ba7e96b4e76e3d1c0ce51d9e8d1d5
parent f0af01aa38ff14385de35469036b0e111add6271
author Engels Antonio <engels@majcms.org> 1335902044 +0800
committer Engels Antonio <engels@majcms.org> 1335902044 +0800
Fix mail headers
diff --git a/add.php b/add.php
index 1f5d8ca..baaffd8 100644
--- a/add.php
+++ b/add.php
@@ -618,9 +618,9 @@ if (isset($_FILES['file_input']) and !empty($_FILES['file_input'])) {
$ml_to = '"' . "$ml_to_firstname $ml_to_lastname" . '" <' . $ml_to . '>';
if (file_exists("$maj_data_directory/ml-reply2.txt")) {
- mb_send_mail($ml_to, $ml_subject, $ml_body, "From: $ml_from\r\n" . "Reply-To: $ml_reply2\r\n" . "References: $entry\r\n" . "X-Mailer: $maj_mailer");
+ mb_send_mail($ml_to, $ml_subject, $ml_body, "From: $ml_from\n" . "Reply-To: $ml_reply2\n" . "References: $entry\n" . "X-Mailer: $maj_mailer");
} else {
- mb_send_mail($ml_to, $ml_subject, $ml_body, "From: $ml_from\r\n" . "References: $entry\r\n" . "X-Mailer: $maj_mailer");
+ mb_send_mail($ml_to, $ml_subject, $ml_body, "From: $ml_from\n" . "References: $entry\n" . "X-Mailer: $maj_mailer");
}
}
}
@@ -706,7 +706,7 @@ if (isset($_POST['notify']) and !empty($_POST['notify']) and file_exists("$maj_d
continue;
}
- mb_send_mail($notify_to, $title_write_content, $body_write_content, "From: $notify_from\r\n" . "References: $entry\r\n" . "X-Mailer: $maj_mailer");
+ mb_send_mail($notify_to, $title_write_content, $body_write_content, "From: $notify_from\n" . "References: $entry\n" . "X-Mailer: $maj_mailer");
}
}
}
diff --git a/css.php b/css.php
index ac9aa96..33531e2 100644
--- a/css.php
+++ b/css.php
@@ -121,7 +121,8 @@ body {
echo "\n\tbackground-repeat: ";
if (file_exists("data/bg-repeat.txt")) {
- readfile("data/bg-repeat.txt");
+ $get_bg_repeat = file_get_contents("data/bg-repeat.txt");
+ echo $get_bg_repeat;
}
else {
echo "repeat";
@@ -139,6 +140,10 @@ body {
}
echo ";";
+
+ if (($get_bg_repeat == "no-repeat") and file_exists("data/bg-stretch.txt")) {
+ echo "\n\tbackground-size: 100%;";
+ }
}
echo "\n";
diff --git a/index.php b/index.php
index 42ca206..50d1c81 100644
--- a/index.php
+++ b/index.php
@@ -242,15 +242,15 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
if (file_exists("$maj_data_directory/ml-reply2.txt")) {
mb_send_mail($maj_ml_to,$maj_ml_subject,$maj_ml_body,
- "From: $maj_ml_from\r\n" .
- "Reply-To: $maj_ml_reply2\r\n" .
- "References: $maj_req_entry\r\n" .
+ "From: $maj_ml_from\n" .
+ "Reply-To: $maj_ml_reply2\n" .
+ "References: $maj_req_entry\n" .
"X-Mailer: $maj_ml_mailer");
}
else {
mb_send_mail($maj_ml_to,$maj_ml_subject,$maj_ml_body,
- "From: $maj_ml_from\r\n" .
- "References: $maj_req_entry\r\n" .
+ "From: $maj_ml_from\n" .
+ "References: $maj_req_entry\n" .
"X-Mailer: $maj_ml_mailer");
}
}
@@ -438,8 +438,8 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
//$maj_comment_thanks = wordwrap($maj_comment_thanks);
mb_send_mail($maj_email_to,"Thanks for sharing your thoughts!",$maj_comment_thanks,
- "From: $maj_from_email\r\n" .
- "Reply-To: $maj_from_email\r\n" .
+ "From: $maj_from_email\n" .
+ "Reply-To: $maj_from_email\n" .
"X-Mailer: $maj_mailer");
}
@@ -449,8 +449,8 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
//$maj_comment_notice = wordwrap($maj_comment_notice);
mb_send_mail($maj_from_email,"Pending Comment",$maj_comment_notice,
- "From: $maj_from_email\r\n" .
- "Reply-To: $maj_from_email\r\n" .
+ "From: $maj_from_email\n" .
+ "Reply-To: $maj_from_email\n" .
"X-Mailer: $maj_mailer");
}
diff --git a/options.php b/options.php
index 19b25a6..8b1d167 100644
--- a/options.php
+++ b/options.php
@@ -94,8 +94,8 @@ if (isset($_POST['email']) and !empty($_POST['email']) and (file_get_contents("$
$email_from = '"' . $sig_author . '" <' . $from_email . '>';
mb_send_mail($email_to, "confirm $key_email", $confirm_change,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
+ "From: $email_from\n" .
+ "Reply-To: $email_from\n" .
"X-Mailer: $maj_mailer");
echo "Confirmation request sent. Check your $email_write_content inbox for details.";
diff --git a/reg.php b/reg.php
index ec62e66..97c5b5e 100644
--- a/reg.php
+++ b/reg.php
@@ -111,13 +111,13 @@ if (isset($_REQUEST['username']) and !empty($_REQUEST['username']) and isset($_R
$email_to = '"' . "$firstname $lastname" . '" <' . $email . '>';
mb_send_mail($email_from, "registration notice ($email)", $registered_notice,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
+ "From: $email_from\n" .
+ "Reply-To: $email_from\n" .
"X-Mailer: $maj_mailer");
mb_send_mail($email_to, "password notice ($username)", $password_notice,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
+ "From: $email_from\n" .
+ "Reply-To: $email_from\n" .
"X-Mailer: $maj_mailer");
$fp_new_txt = fopen("$maj_data_directory/bb-new.txt","w");
@@ -183,8 +183,8 @@ if (isset($_REQUEST['username']) and !empty($_REQUEST['username']) and isset($_R
$email_from = '"' . $sig_author . '" <' . $from_email . '>';
mb_send_mail($email_from, "confirmation notice ($email)", $confirmation_notice,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
+ "From: $email_from\n" .
+ "Reply-To: $email_from\n" .
"X-Mailer: $maj_mailer");
}
else {
@@ -198,8 +198,8 @@ if (isset($_REQUEST['username']) and !empty($_REQUEST['username']) and isset($_R
$email_from = '"' . $sig_author . '" <' . $from_email . '>';
mb_send_mail($email_from, "registration notice ($email)", $registered_notice,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
+ "From: $email_from\n" .
+ "Reply-To: $email_from\n" .
"X-Mailer: $maj_mailer");
$password = str_rand(16);
@@ -231,8 +231,8 @@ if (isset($_REQUEST['username']) and !empty($_REQUEST['username']) and isset($_R
$email_to = '"' . "$firstname $lastname" . '" <' . $email . '>';
mb_send_mail($email_to, "password notice ($username)", $password_notice,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
+ "From: $email_from\n" .
+ "Reply-To: $email_from\n" .
"X-Mailer: $maj_mailer");
$fp_new_txt = fopen("$maj_data_directory/bb-new.txt","w");
@@ -590,8 +590,8 @@ if ($_POST['submit'] == "1") {
$email_to = '"' . "$firstname $lastname" . '" <' . $email . '>';
mb_send_mail($email_to, "confirm $key", $confirm_thanks,
- "From: $email_from\r\n" .
- "Reply-To: $email_from\r\n" .
+ "From: $email_from\n" .
+ "Reply-To: $email_from\n" .
"X-Mailer: $maj_mailer");
unset($err_username);
diff --git a/reset.php b/reset.php
index 7fa1ace..6dd8e26 100644
--- a/reset.php
+++ b/reset.php
@@ -94,13 +94,13 @@ if (isset($_POST['username']) and !empty($_POST['username']) and isset($_POST['a
//$password_notice = wordwrap($password_notice);
mb_send_mail($from_email, "password reset notice ($username)", $reset_notice,
- "From: $from_email\r\n" .
- "Reply-To: $from_email\r\n" .
+ "From: $from_email\n" .
+ "Reply-To: $from_email\n" .
"X-Mailer: $maj_mailer");
mb_send_mail($email, "password reset notice ($username)", $password_notice,
- "From: $from_email\r\n" .
- "Reply-To: $from_email\r\n" .
+ "From: $from_email\n" .
+ "Reply-To: $from_email\n" .
"X-Mailer: $maj_mailer");
if (file_exists("$maj_data_directory/members/active/$username/bb-lockout.txt")) {
diff --git a/settings.php b/settings.php
index 17adee3..8159804 100644
--- a/settings.php
+++ b/settings.php
@@ -955,10 +955,29 @@ if (isset($_POST['bg_repeat']) and !empty($_POST['bg_repeat']) and (file_get_con
$fp_bg_repeat_txt = fopen("data/bg-repeat.txt","w");
fwrite($fp_bg_repeat_txt,$_POST['bg_repeat']);
fclose($fp_bg_repeat_txt);
+
+ if (file_exists("data/bg-stretch.txt") and ($_POST['bg_repeat'] != "no-repeat")) {
+ unlink("data/bg-stretch.txt");
+ }
}
if (isset($_POST['bg_repeat']) and !empty($_POST['bg_repeat']) and (file_get_contents("data/bg-repeat.txt") != $_POST['bg_repeat']) and ($_POST['bg_repeat'] == "repeat") and file_exists("data/bg-repeat.txt")) {
unlink("data/bg-repeat.txt");
+ if (file_exists("data/bg-stretch.txt")) {
+ unlink("data/bg-stretch.txt");
+ }
+}
+
+if (isset($_POST['bg_stretch']) and !empty($_POST['bg_stretch']) and ($_POST['bg_stretch'] == "on") and (file_get_contents("data/bg-repeat.txt") == "no-repeat") and !file_exists("data/bg-stretch.txt")) {
+ touch("data/bg-stretch.txt");
+}
+
+if (!isset($_POST['bg_stretch']) or empty($_POST['bg_stretch'])) {
+ if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
+ if (file_exists("data/bg-stretch.txt")) {
+ unlink("data/bg-stretch.txt");
+ }
+ }
}
if (isset($_POST['bg_position']) and !empty($_POST['bg_position']) and (file_get_contents("data/bg-position.txt") != $_POST['bg_position']) and ($_POST['bg_position'] != "top left")) {
@@ -1412,7 +1431,19 @@ if (file_exists("images/background.gif") or file_exists("images/background.jpg")
if (file_exists("data/bg-scroll.txt")) {
echo " checked";
}
- echo '> Background image scrolls with the rest of the page.</td></tr>';
+ echo '> Background image will scroll with the rest of the page.</td></tr>';
+
+ if (file_exists("data/bg-repeat.txt") and (file_get_contents("data/bg-repeat.txt") == "no-repeat")) {
+
+ echo "<tr><td></td><td><input type=\"checkbox\" name=\"bg_stretch\"";
+
+ if (file_exists("data/bg-stretch.txt")) {
+ echo " checked";
+ }
+
+ echo "> Background image will be stretched across the page.</td></tr>";
+ }
+
echo '<tr><td rowspan=4>background repeat</td><td><input type="radio" name="bg_repeat" value="repeat"
style="background : #ffffff; color : #666666"';
if (!file_exists("data/bg-repeat.txt")) {