[geeklog-cvs] geeklog: Added an option to send a copy of the email to a user t...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Apr 19 04:36:45 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/f07d1ab4b996
changeset: 6967:f07d1ab4b996
user:      Dirk Haun <dirk at haun-online.de>
date:      Sun Apr 19 10:35:57 2009 +0200
description:
Added an option to send a copy of the email to a user to self (feature request #0000771, based on a patch by Roshan Singh)

diffstat:

6 files changed, 42 insertions(+), 14 deletions(-)
language/english.php                                           |    5 +
language/english_utf-8.php                                     |    5 +
public_html/docs/english/theme.html                            |    2 
public_html/docs/history                                       |    2 
public_html/layout/professional/profiles/contactuserform.thtml |    4 +
public_html/profiles.php                                       |   38 ++++++----

diffs (137 lines):

diff -r 1f89a4c2396a -r f07d1ab4b996 language/english.php
--- a/language/english.php	Sun Apr 19 09:20:39 2009 +0200
+++ b/language/english.php	Sun Apr 19 10:35:57 2009 +0200
@@ -451,7 +451,10 @@
     32 => 'Date',
     33 => 'Read the full article at',
     34 => 'End of Message',
-    35 => 'Sorry, this user prefers not to receive any emails.'
+    35 => 'Sorry, this user prefers not to receive any emails.',
+    36 => 'Copy:',
+    37 => 'Send me a copy of this email',
+    38 => "This is a copy of the email that you sent to %s from <{$_CONF['site_url']}>:"
 );
 
 ###############################################################################
diff -r 1f89a4c2396a -r f07d1ab4b996 language/english_utf-8.php
--- a/language/english_utf-8.php	Sun Apr 19 09:20:39 2009 +0200
+++ b/language/english_utf-8.php	Sun Apr 19 10:35:57 2009 +0200
@@ -451,7 +451,10 @@
     32 => 'Date',
     33 => 'Read the full article at',
     34 => 'End of Message',
-    35 => 'Sorry, this user prefers not to receive any emails.'
+    35 => 'Sorry, this user prefers not to receive any emails.',
+    36 => 'Copy:',
+    37 => 'Send me a copy of this email',
+    38 => "This is a copy of the email that you sent to %s from <{$_CONF['site_url']}>:"
 );
 
 ###############################################################################
diff -r 1f89a4c2396a -r f07d1ab4b996 public_html/docs/english/theme.html
--- a/public_html/docs/english/theme.html	Sun Apr 19 09:20:39 2009 +0200
+++ b/public_html/docs/english/theme.html	Sun Apr 19 10:35:57 2009 +0200
@@ -231,6 +231,8 @@
 <li>New template file <tt>admin/lists/inline.thtml</tt>, used when embedding
     lists into an existing HTML <code><form></code> (e.g. the new Groups
     editor).</li>
+<li>Added a "send copy to myself" option to
+    <tt>profiles/contactuserform.thtml</tt></li>
 </ul>
 
 <h3>Plugins</h3>
diff -r 1f89a4c2396a -r f07d1ab4b996 public_html/docs/history
--- a/public_html/docs/history	Sun Apr 19 09:20:39 2009 +0200
+++ b/public_html/docs/history	Sun Apr 19 10:35:57 2009 +0200
@@ -11,6 +11,8 @@
 + Comment moderation and editable comments, by Jared Wenerd
 
 Other changes:
+- Added an option to send a copy of the email to a user to self (feature request
+  #0000771, based on a patch by Roshan Singh)
 - COM_checkList would use the table name for the name of the checkbox array in
   the HTML(!) - added a new parameter for the name (pointed out by Bookoo in
   the exploit for usersettings.php, cf. Geeklog 1.5.2sr4) [Dirk]
diff -r 1f89a4c2396a -r f07d1ab4b996 public_html/layout/professional/profiles/contactuserform.thtml
--- a/public_html/layout/professional/profiles/contactuserform.thtml	Sun Apr 19 09:20:39 2009 +0200
+++ b/public_html/layout/professional/profiles/contactuserform.thtml	Sun Apr 19 10:35:57 2009 +0200
@@ -10,6 +10,10 @@
         <tr>
             <td>{lang_useremail}</td>
             <td><input type="text" name="authoremail" size="32" value="{useremail}" maxlength="96"{xhtml}></td>
+        </tr>
+        <tr>
+            <td>{lang_cc}</td>
+            <td><input type="checkbox" name="cc" checked="checked"{xhtml}> {lang_cc_description}</td>
         </tr>
         <tr>
             <td>{lang_subject}</td>
diff -r 1f89a4c2396a -r f07d1ab4b996 public_html/profiles.php
--- a/public_html/profiles.php	Sun Apr 19 09:20:39 2009 +0200
+++ b/public_html/profiles.php	Sun Apr 19 10:35:57 2009 +0200
@@ -2,7 +2,7 @@
 
 /* Reminder: always indent with 4 spaces (no tabs). */
 // +---------------------------------------------------------------------------+
-// | Geeklog 1.5                                                               |
+// | Geeklog 1.6                                                               |
 // +---------------------------------------------------------------------------+
 // | profiles.php                                                              |
 // |                                                                           |
@@ -33,6 +33,9 @@
 // |                                                                           |
 // +---------------------------------------------------------------------------+
 
+/**
+* Geeklog common function library
+*/
 require_once 'lib-common.php';
 
 /**
@@ -125,6 +128,15 @@
             $from = COM_formatEmailAddress ($author, $authoremail);
 
             $sent = COM_mail($to, $subject, $message, $from);
+
+            if ($sent && isset($_POST['cc']) && ($_POST['cc'] == 'on')) {
+                $ccmessage = sprintf($LANG08[38], COM_getDisplayName($uid,
+                                            $A['username'], $A['fullname']));
+                $ccmessage .= "\n------------------------------------------------------------\n\n" . $message;
+
+                $sent = COM_mail($from, $subject, $ccmessage, $from);
+            }
+
             COM_updateSpeedlimit('mail');
 
             $retval .= COM_refresh($_CONF['site_url']
@@ -228,17 +240,19 @@
             } else {
                 $mail_template->set_var ('useremail', $_USER['email']);
             }
-            $mail_template->set_var ('lang_subject', $LANG08[13]);
-            $mail_template->set_var ('subject', $subject);
-            $mail_template->set_var ('lang_message', $LANG08[14]);
-            $mail_template->set_var ('message', $message);
-            $mail_template->set_var ('lang_nohtml', $LANG08[15]);
-            $mail_template->set_var ('lang_submit', $LANG08[16]);
-            $mail_template->set_var ('uid', $uid);
-            PLG_templateSetVars ('contact', $mail_template);
-            $mail_template->parse ('output', 'form');
-            $retval .= $mail_template->finish ($mail_template->get_var ('output'));
-            $retval .= COM_endBlock ();
+            $mail_template->set_var('lang_cc', $LANG08[36]);
+            $mail_template->set_var('lang_cc_description', $LANG08[37]);
+            $mail_template->set_var('lang_subject', $LANG08[13]);
+            $mail_template->set_var('subject', $subject);
+            $mail_template->set_var('lang_message', $LANG08[14]);
+            $mail_template->set_var('message', $message);
+            $mail_template->set_var('lang_nohtml', $LANG08[15]);
+            $mail_template->set_var('lang_submit', $LANG08[16]);
+            $mail_template->set_var('uid', $uid);
+            PLG_templateSetVars('contact', $mail_template);
+            $mail_template->parse('output', 'form');
+            $retval .= $mail_template->finish($mail_template->get_var('output'));
+            $retval .= COM_endBlock();
         } else {
             $retval = COM_startBlock ($LANG08[10] . ' ' . $displayname, '',
                               COM_getBlockTemplate ('_msg_block', 'header'));



More information about the geeklog-cvs mailing list