X-Git-Url: https://git.p6c8.net/form-email.git/blobdiff_plain/50ef90786d4ad52706db03a000e486119cb977ce..193da7105bd4c70771bfd3560efcaf9dfba06315:/form-email/mailer.php diff --git a/form-email/mailer.php b/form-email/mailer.php index 93fd0cb..4d2e500 100644 --- a/form-email/mailer.php +++ b/form-email/mailer.php @@ -7,9 +7,9 @@ # geschrieben wurde. # # Autor: Patrick Canterino -# Letzte Aenderung: 27.12.2011 +# Letzte Aenderung: 05.02.2012 # -# Copyright (C) 2002-2011 Patrick Canterino +# Copyright (C) 2002-2012 Patrick Canterino # # Diese Datei kann unter den Bedingungen der "Artistic License 2.0" # weitergegeben und / oder veraendert werden. @@ -21,7 +21,7 @@ # Hauptteil # =========== -$VERSION = '3.5-dev'; +$VERSION = '3.5'; require('config.php'); require('functions.php'); @@ -241,8 +241,10 @@ $subject = preg_replace("/\015\012|\012|\015/",' ',$subject); # Uhrzeit formatieren +$timestamp = time(); + date_default_timezone_set($timezone); -$time = strftime($timeformat); +$time = strftime($timeformat,$timestamp); # Header der Mail @@ -345,7 +347,59 @@ if($recipient && is_array($aliases) && $aliases[$recipient]) { $mailto = semicolon_split($mailto); for($x=0;$x 0) { + $dp = opendir($store_mails_dir); + + while($stored_mail_file = readdir($dp)) { + if($stored_mail_file != '.' && $stored_mail_file != '..' && substr($stored_mail_file,0,strlen($store_mails_prefix)) == $store_mails_prefix) { + $stored_mail_files[$store_mails_dir.'/'.$stored_mail_file] = filemtime($store_mails_dir.'/'.$stored_mail_file); + } + } + + closedir($dp); + + arsort($stored_mail_files); + + $x = 0; + + foreach(array_keys($stored_mail_files) as $stored_mail_filename) { + $x++; + + if($x > $store_mails_max) { + unlink($stored_mail_filename); + } + } + } } if($captcha_enable) session_destroy(); @@ -410,6 +464,19 @@ else { $stpl->set_var('TEXT', plain($text)); $stpl->set_var('TIME', plain($time)); + reset($user_fields); + + while(list($user_field,$user_field_data) = each($user_fields)) { + if(isset($user_field_data['tpl_var']) && $user_field_data['tpl_var'] != '') { + $tpl_var = $user_field_data['tpl_var']; + } + else { + $tpl_var = 'USER_'.$user_field; + } + + $stpl->set_var($tpl_var,htmlspecialchars(formdata($user_field))); + } + $stpl->parse(); print $stpl->get_template();