[geeklog-cvs] geeklog: CC setting is now an admin option. Original patch provi...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Wed Feb 1 20:36:03 EST 2012


changeset 8487:e61a1038595a
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/e61a1038595a
user: Tom <websitemaster at cogeco.net>
date: Wed Feb 01 20:35:07 2012 -0500
description:
CC setting is now an admin option. Original patch provided by Rouslan Placella. (feature request #0001259)

diffstat:

 language/english.php                                                 |   2 +
 language/english_utf-8.php                                           |   2 +
 public_html/admin/install/config-install.php                         |   2 +
 public_html/docs/english/config.html                                 |   6 ++
 public_html/layout/professional/profiles/contactauthorform.thtml     |   2 +-
 public_html/layout/professional/profiles/contactuserform.thtml       |   2 +-
 public_html/layout/professional_css/profiles/contactauthorform.thtml |   4 +-
 public_html/layout/professional_css/profiles/contactuserform.thtml   |   4 +-
 public_html/profiles.php                                             |  28 ++++++---
 sql/updates/mssql_1.8.1_to_1.9.0.php                                 |   4 +
 sql/updates/mysql_1.8.1_to_1.9.0.php                                 |   4 +
 sql/updates/pgsql_1.8.1_to_1.9.0.php                                 |   6 +-
 12 files changed, 49 insertions(+), 17 deletions(-)

diffs (221 lines):

diff -r bdff7ced627a -r e61a1038595a language/english.php
--- a/language/english.php	Wed Feb 01 10:45:33 2012 -0500
+++ b/language/english.php	Wed Feb 01 20:35:07 2012 -0500
@@ -1780,6 +1780,8 @@
     'site_admin_url' => "Admin URL",
     'site_mail' => "Site E-Mail",
     'noreply_mail' => "No-Reply E-Mail",
+    'mail_cc_enabled' => 'Allow to Send Carbon Copies',
+    'mail_cc_default' => '"Carbon Copy" on by Default',
     'site_name' => "Site Name",
     'site_slogan' => "Slogan",
     'owner_name' => "Owner Name",
diff -r bdff7ced627a -r e61a1038595a language/english_utf-8.php
--- a/language/english_utf-8.php	Wed Feb 01 10:45:33 2012 -0500
+++ b/language/english_utf-8.php	Wed Feb 01 20:35:07 2012 -0500
@@ -1780,6 +1780,8 @@
     'site_admin_url' => "Admin URL",
     'site_mail' => "Site E-Mail",
     'noreply_mail' => "No-Reply E-Mail",
+    'mail_cc_enabled' => 'Allow to Send Carbon Copies',
+    'mail_cc_default' => '"Carbon Copy" on by Default',    
     'site_name' => "Site Name",
     'site_slogan' => "Slogan",
     'owner_name' => "Owner Name",
diff -r bdff7ced627a -r e61a1038595a public_html/admin/install/config-install.php
--- a/public_html/admin/install/config-install.php	Wed Feb 01 10:45:33 2012 -0500
+++ b/public_html/admin/install/config-install.php	Wed Feb 01 20:35:07 2012 -0500
@@ -65,6 +65,8 @@
     $c->add('site_mail','','text',0,1,NULL,40,TRUE, $me, 1);
     $c->add('noreply_mail','','text',0,1,NULL,50,TRUE, $me, 1);
     $c->add('mail_settings',array ('backend' => 'mail', 'sendmail_path' => '/usr/bin/sendmail', 'sendmail_args' => '', 'host' => 'smtp.example.com','port' => '25', 'auth' => false, 'username' => 'smtp-username','password' => 'smtp-password'),'@text',0,1,NULL,160,TRUE, $me, 1);
+    $c->add('mail_cc_enabled', 1, 'select', 0, 1, 0, 180, TRUE, $me, 1);
+    $c->add('mail_cc_default', 0, 'select', 0, 1, 0, 190, TRUE, $me, 1);
 
     $c->add('tab_syndication', NULL, 'tab', 0, 2, NULL, 0, TRUE, $me, 2);
     $c->add('fs_syndication', NULL, 'fieldset', 0, 2, NULL, 0, TRUE, $me, 2);
diff -r bdff7ced627a -r e61a1038595a public_html/docs/english/config.html
--- a/public_html/docs/english/config.html	Wed Feb 01 10:45:33 2012 -0500
+++ b/public_html/docs/english/config.html	Wed Feb 01 20:35:07 2012 -0500
@@ -170,6 +170,12 @@
     <td valign="top">smtp-password</td>
     <td valign="top">If you chose 'smtp' for the backend setting, this is the
         password for your SMTP account.</td></tr>
+<tr><td valign="top"><a name="desc_mail_cc_enabled">cc_enabled</a></td>
+    <td valign="top">True</td>
+    <td valign="top">Whether to allow users to send a copy of an email to themselves.</td></tr>
+<tr><td valign="top"><a name="desc_mail_cc_default">cc_default</a></td>
+    <td valign="top">False</td>
+    <td valign="top">Whether the carbon copy checkbox in the email form is ticked by default.</td></tr>
 </table>
 
 <h3><a name="site_syndication">Site: Syndication</a></h3>
diff -r bdff7ced627a -r e61a1038595a public_html/layout/professional/profiles/contactauthorform.thtml
--- a/public_html/layout/professional/profiles/contactauthorform.thtml	Wed Feb 01 10:45:33 2012 -0500
+++ b/public_html/layout/professional/profiles/contactauthorform.thtml	Wed Feb 01 20:35:07 2012 -0500
@@ -25,7 +25,7 @@
             <td class="alignright" style="vertical-align:top;"><b>{lang_shortmessage}:</b></td>
             <td><textarea name="shortmsg" rows="10" style="width:100%">{shortmsg}</textarea></td>
         </tr>
-        <tr>
+        <tr{cc_enabled}>
             <td class="alignright"><b>{lang_cc}</b></td>
             <td><input type="checkbox" name="cc"{cc}{xhtml}> {lang_cc_description}</td>
         </tr>
diff -r bdff7ced627a -r e61a1038595a public_html/layout/professional/profiles/contactuserform.thtml
--- a/public_html/layout/professional/profiles/contactuserform.thtml	Wed Feb 01 10:45:33 2012 -0500
+++ b/public_html/layout/professional/profiles/contactuserform.thtml	Wed Feb 01 20:35:07 2012 -0500
@@ -17,7 +17,7 @@
             <td class="alignright" style="vertical-align:top;"><b>{lang_message}</b></td>
             <td><textarea name="message" rows="10" style="width:100%">{message}</textarea></td>
         </tr>
-        <tr>
+        <tr{cc_enabled}>
             <td class="alignright"><b>{lang_cc}</b></td>
             <td><input type="checkbox" name="cc"{cc}{xhtml}> {lang_cc_description}</td>
         </tr>
diff -r bdff7ced627a -r e61a1038595a public_html/layout/professional_css/profiles/contactauthorform.thtml
--- a/public_html/layout/professional_css/profiles/contactauthorform.thtml	Wed Feb 01 10:45:33 2012 -0500
+++ b/public_html/layout/professional_css/profiles/contactauthorform.thtml	Wed Feb 01 20:35:07 2012 -0500
@@ -23,8 +23,8 @@
 
         <dt><label for="contactauthorform-shortmsg">{lang_shortmessage}</label></dt>
         <dd><textarea rows="8" cols="50" name="shortmsg" id="contactauthorform-shortmsg">{shortmsg}</textarea></dd>
-        <dt><label for="contactauthorform-cc">{lang_cc}</label></dt>
-        <dd><input type="checkbox" name="cc" id="contactauthorform-cc" checked="checked"{xhtml}> {lang_cc_description}</dd>
+        <dt{cc_enabled}><label for="contactauthorform-cc">{lang_cc}</label></dt>
+        <dd{cc_enabled}><input type="checkbox" name="cc" id="contactauthorform-cc"{cc}{xhtml}> {lang_cc_description}</dd>
 
       </dl>
 
diff -r bdff7ced627a -r e61a1038595a public_html/layout/professional_css/profiles/contactuserform.thtml
--- a/public_html/layout/professional_css/profiles/contactuserform.thtml	Wed Feb 01 10:45:33 2012 -0500
+++ b/public_html/layout/professional_css/profiles/contactuserform.thtml	Wed Feb 01 20:35:07 2012 -0500
@@ -19,8 +19,8 @@
       <dt><label for="contactuserform-message">{lang_message}</label></dt>
       <dd><textarea rows="10" cols="50" name="message" id="contactuserform-message">{message}</textarea></dd>
 
-      <dt><label for="contactuserform-cc">{lang_cc}</label></dt>
-      <dd><input type="checkbox" name="cc" id="contactuserform-cc" checked="checked"{xhtml}> {lang_cc_description}</dd>
+      <dt{cc_enabled}><label for="contactuserform-cc">{lang_cc}</label></dt>
+      <dd{cc_enabled}><input type="checkbox" name="cc" id="contactuserform-cc"{cc}{xhtml}> {lang_cc_description}</dd>
 
       <dd class="description">{lang_nohtml}</dd>
     </dl>
diff -r bdff7ced627a -r e61a1038595a public_html/profiles.php
--- a/public_html/profiles.php	Wed Feb 01 10:45:33 2012 -0500
+++ b/public_html/profiles.php	Wed Feb 01 20:35:07 2012 -0500
@@ -138,7 +138,7 @@
 
             $sent = COM_mail($to, $subject, $message, $from);
 
-            if ($sent && isset($_POST['cc']) && ($_POST['cc'] == 'on')) {
+            if ($sent && $_CONF['mail_cc_enabled'] && isset($_POST['cc']) && ($_POST['cc'] == 'on')) {
                 $ccmessage = sprintf($LANG08[38], COM_getDisplayName($uid,
                                             $A['username'], $A['fullname']));
                 $ccmessage .= "\n------------------------------------------------------------\n\n" . $message;
@@ -238,9 +238,13 @@
             } else {
                 $mail_template->set_var ('useremail', $_USER['email']);
             }
-            $mail_template->set_var('cc', $cc);
-            $mail_template->set_var('lang_cc', $LANG08[36]);
-            $mail_template->set_var('lang_cc_description', $LANG08[37]);
+            if (!$_CONF['mail_cc_enabled']) {
+                $mail_template->set_var('cc_enabled', ' style="display: none"');
+            } else {
+                $mail_template->set_var('cc', $cc);
+                $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]);
@@ -376,7 +380,7 @@
 
     $sent = COM_mail($mailto, $subject, $mailtext, $mailfrom);
 
-    if ($sent && isset($_POST['cc']) && ($_POST['cc'] == 'on')) {
+    if ($sent && $_CONF['mail_cc_enabled'] && isset($_POST['cc']) && ($_POST['cc'] == 'on')) {
         $ccmessage = sprintf($LANG08[38], $to);
         $ccmessage .= "\n------------------------------------------------------------\n\n" . $mailtext;
 
@@ -469,9 +473,13 @@
     $mail_template->set_var('toname', $to);
     $mail_template->set_var('lang_toemailaddress', $LANG08[19]);
     $mail_template->set_var('toemail', $toemail);
-    $mail_template->set_var('cc', $cc);
-    $mail_template->set_var('lang_cc', $LANG08[36]);
-    $mail_template->set_var('lang_cc_description', $LANG08[37]);
+    if (!$_CONF['mail_cc_enabled']) {
+        $mail_template->set_var('cc_enabled', ' style="display: none"');
+    } else {
+        $mail_template->set_var('cc', $cc);
+        $mail_template->set_var('lang_cc', $LANG08[36]);
+        $mail_template->set_var('lang_cc_description', $LANG08[37]);
+    }
     $mail_template->set_var('lang_shortmessage', $LANG08[27]);
     $mail_template->set_var('shortmsg', htmlspecialchars($shortmsg));
     $mail_template->set_var('lang_warning', $LANG08[22]);
@@ -524,7 +532,7 @@
                                     . '/article.php?story=' . $sid));
         } else {
             $display .= COM_siteHeader ('menu', $LANG08[17])
-                     . mailstoryform ($sid, true)
+                     . mailstoryform ($sid, $_CONF['mail_cc_default'])
                      . COM_siteFooter ();
         }
         break;
@@ -589,7 +597,7 @@
                 $subject = htmlspecialchars (trim ($subject), ENT_QUOTES);
             }
             $display .= COM_siteHeader ('menu', $LANG04[81])
-                     . contactform ($uid, true, $subject)
+                     . contactform ($uid, $_CONF['mail_cc_default'], $subject)
                      . COM_siteFooter ();
         } else {
             $display .= COM_refresh ($_CONF['site_url'] . '/index.php');
diff -r bdff7ced627a -r e61a1038595a sql/updates/mssql_1.8.1_to_1.9.0.php
--- a/sql/updates/mssql_1.8.1_to_1.9.0.php	Wed Feb 01 10:45:33 2012 -0500
+++ b/sql/updates/mssql_1.8.1_to_1.9.0.php	Wed Feb 01 20:35:07 2012 -0500
@@ -101,6 +101,10 @@
     // Max Link Text
     $c->add('linktext_maxlen',50,'text',7,31,NULL,1754,TRUE, $me,31);   
     
+    // Email CC settings
+    $c->add('mail_cc_enabled', 1, 'select', 0, 1, 0, 180, TRUE, $me, 1);
+    $c->add('mail_cc_default', 0, 'select', 0, 1, 0, 190, TRUE, $me, 1);    
+    
     return true;
 }
 
diff -r bdff7ced627a -r e61a1038595a sql/updates/mysql_1.8.1_to_1.9.0.php
--- a/sql/updates/mysql_1.8.1_to_1.9.0.php	Wed Feb 01 10:45:33 2012 -0500
+++ b/sql/updates/mysql_1.8.1_to_1.9.0.php	Wed Feb 01 20:35:07 2012 -0500
@@ -98,6 +98,10 @@
     
     // Max Link Text
     $c->add('linktext_maxlen',50,'text',7,31,NULL,1754,TRUE, $me,31);    
+
+    // Email CC settings
+    $c->add('mail_cc_enabled', 1, 'select', 0, 1, 0, 180, TRUE, $me, 1);
+    $c->add('mail_cc_default', 0, 'select', 0, 1, 0, 190, TRUE, $me, 1);
     
     return true;
 }
diff -r bdff7ced627a -r e61a1038595a sql/updates/pgsql_1.8.1_to_1.9.0.php
--- a/sql/updates/pgsql_1.8.1_to_1.9.0.php	Wed Feb 01 10:45:33 2012 -0500
+++ b/sql/updates/pgsql_1.8.1_to_1.9.0.php	Wed Feb 01 20:35:07 2012 -0500
@@ -99,7 +99,11 @@
     $c->add('disable_breadcrumbs_plugins', 0, 'select', 7, 45, 0, 2020, TRUE, $me, 45);
 
     // Max Link Text
-    $c->add('linktext_maxlen',50,'text',7,31,NULL,1754,TRUE, $me,31); 
+    $c->add('linktext_maxlen',50,'text',7,31,NULL,1754,TRUE, $me,31);
+    
+    // Email CC settings
+    $c->add('mail_cc_enabled', 1, 'select', 0, 1, 0, 180, TRUE, $me, 1);
+    $c->add('mail_cc_default', 0, 'select', 0, 1, 0, 190, TRUE, $me, 1);    
     
     return true;
 }



More information about the geeklog-cvs mailing list