CC setting is now an admin option. Original patch provided by Rouslan Placella. (feature request #0001259) HEAD tip
authorTom <websitemaster@cogeco.net>
Wed Feb 01 20:35:07 2012 -0500 (2 days ago)
branchHEAD
changeset 8487e61a1038595a
parent 8486 bdff7ced627a
CC setting is now an admin option. Original patch provided by Rouslan Placella. (feature request #0001259)
language/english.php
language/english_utf-8.php
public_html/admin/install/config-install.php
public_html/docs/english/config.html
public_html/layout/professional/profiles/contactauthorform.thtml
public_html/layout/professional/profiles/contactuserform.thtml
public_html/layout/professional_css/profiles/contactauthorform.thtml
public_html/layout/professional_css/profiles/contactuserform.thtml
public_html/profiles.php
sql/updates/mssql_1.8.1_to_1.9.0.php
sql/updates/mysql_1.8.1_to_1.9.0.php
sql/updates/pgsql_1.8.1_to_1.9.0.php
     1.1 --- a/language/english.php	Wed Feb 01 10:45:33 2012 -0500
     1.2 +++ b/language/english.php	Wed Feb 01 20:35:07 2012 -0500
     1.3 @@ -1780,6 +1780,8 @@
     1.4      'site_admin_url' => "Admin URL",
     1.5      'site_mail' => "Site E-Mail",
     1.6      'noreply_mail' => "No-Reply E-Mail",
     1.7 +    'mail_cc_enabled' => 'Allow to Send Carbon Copies',
     1.8 +    'mail_cc_default' => '"Carbon Copy" on by Default',
     1.9      'site_name' => "Site Name",
    1.10      'site_slogan' => "Slogan",
    1.11      'owner_name' => "Owner Name",
     2.1 --- a/language/english_utf-8.php	Wed Feb 01 10:45:33 2012 -0500
     2.2 +++ b/language/english_utf-8.php	Wed Feb 01 20:35:07 2012 -0500
     2.3 @@ -1780,6 +1780,8 @@
     2.4      'site_admin_url' => "Admin URL",
     2.5      'site_mail' => "Site E-Mail",
     2.6      'noreply_mail' => "No-Reply E-Mail",
     2.7 +    'mail_cc_enabled' => 'Allow to Send Carbon Copies',
     2.8 +    'mail_cc_default' => '"Carbon Copy" on by Default',    
     2.9      'site_name' => "Site Name",
    2.10      'site_slogan' => "Slogan",
    2.11      'owner_name' => "Owner Name",
     3.1 --- a/public_html/admin/install/config-install.php	Wed Feb 01 10:45:33 2012 -0500
     3.2 +++ b/public_html/admin/install/config-install.php	Wed Feb 01 20:35:07 2012 -0500
     3.3 @@ -65,6 +65,8 @@
     3.4      $c->add('site_mail','','text',0,1,NULL,40,TRUE, $me, 1);
     3.5      $c->add('noreply_mail','','text',0,1,NULL,50,TRUE, $me, 1);
     3.6      $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);
     3.7 +    $c->add('mail_cc_enabled', 1, 'select', 0, 1, 0, 180, TRUE, $me, 1);
     3.8 +    $c->add('mail_cc_default', 0, 'select', 0, 1, 0, 190, TRUE, $me, 1);
     3.9  
    3.10      $c->add('tab_syndication', NULL, 'tab', 0, 2, NULL, 0, TRUE, $me, 2);
    3.11      $c->add('fs_syndication', NULL, 'fieldset', 0, 2, NULL, 0, TRUE, $me, 2);
     4.1 --- a/public_html/docs/english/config.html	Wed Feb 01 10:45:33 2012 -0500
     4.2 +++ b/public_html/docs/english/config.html	Wed Feb 01 20:35:07 2012 -0500
     4.3 @@ -170,6 +170,12 @@
     4.4      <td valign="top">smtp-password</td>
     4.5      <td valign="top">If you chose 'smtp' for the backend setting, this is the
     4.6          password for your SMTP account.</td></tr>
     4.7 +<tr><td valign="top"><a name="desc_mail_cc_enabled">cc_enabled</a></td>
     4.8 +    <td valign="top">True</td>
     4.9 +    <td valign="top">Whether to allow users to send a copy of an email to themselves.</td></tr>
    4.10 +<tr><td valign="top"><a name="desc_mail_cc_default">cc_default</a></td>
    4.11 +    <td valign="top">False</td>
    4.12 +    <td valign="top">Whether the carbon copy checkbox in the email form is ticked by default.</td></tr>
    4.13  </table>
    4.14  
    4.15  <h3><a name="site_syndication">Site: Syndication</a></h3>
     5.1 --- a/public_html/layout/professional/profiles/contactauthorform.thtml	Wed Feb 01 10:45:33 2012 -0500
     5.2 +++ b/public_html/layout/professional/profiles/contactauthorform.thtml	Wed Feb 01 20:35:07 2012 -0500
     5.3 @@ -25,7 +25,7 @@
     5.4              <td class="alignright" style="vertical-align:top;"><b>{lang_shortmessage}:</b></td>
     5.5              <td><textarea name="shortmsg" rows="10" style="width:100%">{shortmsg}</textarea></td>
     5.6          </tr>
     5.7 -        <tr>
     5.8 +        <tr{cc_enabled}>
     5.9              <td class="alignright"><b>{lang_cc}</b></td>
    5.10              <td><input type="checkbox" name="cc"{cc}{xhtml}>&nbsp;{lang_cc_description}</td>
    5.11          </tr>
     6.1 --- a/public_html/layout/professional/profiles/contactuserform.thtml	Wed Feb 01 10:45:33 2012 -0500
     6.2 +++ b/public_html/layout/professional/profiles/contactuserform.thtml	Wed Feb 01 20:35:07 2012 -0500
     6.3 @@ -17,7 +17,7 @@
     6.4              <td class="alignright" style="vertical-align:top;"><b>{lang_message}</b></td>
     6.5              <td><textarea name="message" rows="10" style="width:100%">{message}</textarea></td>
     6.6          </tr>
     6.7 -        <tr>
     6.8 +        <tr{cc_enabled}>
     6.9              <td class="alignright"><b>{lang_cc}</b></td>
    6.10              <td><input type="checkbox" name="cc"{cc}{xhtml}>&nbsp;{lang_cc_description}</td>
    6.11          </tr>
     7.1 --- a/public_html/layout/professional_css/profiles/contactauthorform.thtml	Wed Feb 01 10:45:33 2012 -0500
     7.2 +++ b/public_html/layout/professional_css/profiles/contactauthorform.thtml	Wed Feb 01 20:35:07 2012 -0500
     7.3 @@ -23,8 +23,8 @@
     7.4  
     7.5          <dt><label for="contactauthorform-shortmsg">{lang_shortmessage}</label></dt>
     7.6          <dd><textarea rows="8" cols="50" name="shortmsg" id="contactauthorform-shortmsg">{shortmsg}</textarea></dd>
     7.7 -        <dt><label for="contactauthorform-cc">{lang_cc}</label></dt>
     7.8 -        <dd><input type="checkbox" name="cc" id="contactauthorform-cc" checked="checked"{xhtml}>&nbsp;{lang_cc_description}</dd>
     7.9 +        <dt{cc_enabled}><label for="contactauthorform-cc">{lang_cc}</label></dt>
    7.10 +        <dd{cc_enabled}><input type="checkbox" name="cc" id="contactauthorform-cc"{cc}{xhtml}>&nbsp;{lang_cc_description}</dd>
    7.11  
    7.12        </dl>
    7.13  
     8.1 --- a/public_html/layout/professional_css/profiles/contactuserform.thtml	Wed Feb 01 10:45:33 2012 -0500
     8.2 +++ b/public_html/layout/professional_css/profiles/contactuserform.thtml	Wed Feb 01 20:35:07 2012 -0500
     8.3 @@ -19,8 +19,8 @@
     8.4        <dt><label for="contactuserform-message">{lang_message}</label></dt>
     8.5        <dd><textarea rows="10" cols="50" name="message" id="contactuserform-message">{message}</textarea></dd>
     8.6  
     8.7 -      <dt><label for="contactuserform-cc">{lang_cc}</label></dt>
     8.8 -      <dd><input type="checkbox" name="cc" id="contactuserform-cc" checked="checked"{xhtml}>&nbsp;{lang_cc_description}</dd>
     8.9 +      <dt{cc_enabled}><label for="contactuserform-cc">{lang_cc}</label></dt>
    8.10 +      <dd{cc_enabled}><input type="checkbox" name="cc" id="contactuserform-cc"{cc}{xhtml}>&nbsp;{lang_cc_description}</dd>
    8.11  
    8.12        <dd class="description">{lang_nohtml}</dd>
    8.13      </dl>
     9.1 --- a/public_html/profiles.php	Wed Feb 01 10:45:33 2012 -0500
     9.2 +++ b/public_html/profiles.php	Wed Feb 01 20:35:07 2012 -0500
     9.3 @@ -138,7 +138,7 @@
     9.4  
     9.5              $sent = COM_mail($to, $subject, $message, $from);
     9.6  
     9.7 -            if ($sent && isset($_POST['cc']) && ($_POST['cc'] == 'on')) {
     9.8 +            if ($sent && $_CONF['mail_cc_enabled'] && isset($_POST['cc']) && ($_POST['cc'] == 'on')) {
     9.9                  $ccmessage = sprintf($LANG08[38], COM_getDisplayName($uid,
    9.10                                              $A['username'], $A['fullname']));
    9.11                  $ccmessage .= "\n------------------------------------------------------------\n\n" . $message;
    9.12 @@ -238,9 +238,13 @@
    9.13              } else {
    9.14                  $mail_template->set_var ('useremail', $_USER['email']);
    9.15              }
    9.16 -            $mail_template->set_var('cc', $cc);
    9.17 -            $mail_template->set_var('lang_cc', $LANG08[36]);
    9.18 -            $mail_template->set_var('lang_cc_description', $LANG08[37]);
    9.19 +            if (!$_CONF['mail_cc_enabled']) {
    9.20 +                $mail_template->set_var('cc_enabled', ' style="display: none"');
    9.21 +            } else {
    9.22 +                $mail_template->set_var('cc', $cc);
    9.23 +                $mail_template->set_var('lang_cc', $LANG08[36]);
    9.24 +                $mail_template->set_var('lang_cc_description', $LANG08[37]);
    9.25 +            }
    9.26              $mail_template->set_var('lang_subject', $LANG08[13]);
    9.27              $mail_template->set_var('subject', $subject);
    9.28              $mail_template->set_var('lang_message', $LANG08[14]);
    9.29 @@ -376,7 +380,7 @@
    9.30  
    9.31      $sent = COM_mail($mailto, $subject, $mailtext, $mailfrom);
    9.32  
    9.33 -    if ($sent && isset($_POST['cc']) && ($_POST['cc'] == 'on')) {
    9.34 +    if ($sent && $_CONF['mail_cc_enabled'] && isset($_POST['cc']) && ($_POST['cc'] == 'on')) {
    9.35          $ccmessage = sprintf($LANG08[38], $to);
    9.36          $ccmessage .= "\n------------------------------------------------------------\n\n" . $mailtext;
    9.37  
    9.38 @@ -469,9 +473,13 @@
    9.39      $mail_template->set_var('toname', $to);
    9.40      $mail_template->set_var('lang_toemailaddress', $LANG08[19]);
    9.41      $mail_template->set_var('toemail', $toemail);
    9.42 -    $mail_template->set_var('cc', $cc);
    9.43 -    $mail_template->set_var('lang_cc', $LANG08[36]);
    9.44 -    $mail_template->set_var('lang_cc_description', $LANG08[37]);
    9.45 +    if (!$_CONF['mail_cc_enabled']) {
    9.46 +        $mail_template->set_var('cc_enabled', ' style="display: none"');
    9.47 +    } else {
    9.48 +        $mail_template->set_var('cc', $cc);
    9.49 +        $mail_template->set_var('lang_cc', $LANG08[36]);
    9.50 +        $mail_template->set_var('lang_cc_description', $LANG08[37]);
    9.51 +    }
    9.52      $mail_template->set_var('lang_shortmessage', $LANG08[27]);
    9.53      $mail_template->set_var('shortmsg', htmlspecialchars($shortmsg));
    9.54      $mail_template->set_var('lang_warning', $LANG08[22]);
    9.55 @@ -524,7 +532,7 @@
    9.56                                      . '/article.php?story=' . $sid));
    9.57          } else {
    9.58              $display .= COM_siteHeader ('menu', $LANG08[17])
    9.59 -                     . mailstoryform ($sid, true)
    9.60 +                     . mailstoryform ($sid, $_CONF['mail_cc_default'])
    9.61                       . COM_siteFooter ();
    9.62          }
    9.63          break;
    9.64 @@ -589,7 +597,7 @@
    9.65                  $subject = htmlspecialchars (trim ($subject), ENT_QUOTES);
    9.66              }
    9.67              $display .= COM_siteHeader ('menu', $LANG04[81])
    9.68 -                     . contactform ($uid, true, $subject)
    9.69 +                     . contactform ($uid, $_CONF['mail_cc_default'], $subject)
    9.70                       . COM_siteFooter ();
    9.71          } else {
    9.72              $display .= COM_refresh ($_CONF['site_url'] . '/index.php');
    10.1 --- a/sql/updates/mssql_1.8.1_to_1.9.0.php	Wed Feb 01 10:45:33 2012 -0500
    10.2 +++ b/sql/updates/mssql_1.8.1_to_1.9.0.php	Wed Feb 01 20:35:07 2012 -0500
    10.3 @@ -101,6 +101,10 @@
    10.4      // Max Link Text
    10.5      $c->add('linktext_maxlen',50,'text',7,31,NULL,1754,TRUE, $me,31);   
    10.6      
    10.7 +    // Email CC settings
    10.8 +    $c->add('mail_cc_enabled', 1, 'select', 0, 1, 0, 180, TRUE, $me, 1);
    10.9 +    $c->add('mail_cc_default', 0, 'select', 0, 1, 0, 190, TRUE, $me, 1);    
   10.10 +    
   10.11      return true;
   10.12  }
   10.13  
    11.1 --- a/sql/updates/mysql_1.8.1_to_1.9.0.php	Wed Feb 01 10:45:33 2012 -0500
    11.2 +++ b/sql/updates/mysql_1.8.1_to_1.9.0.php	Wed Feb 01 20:35:07 2012 -0500
    11.3 @@ -98,6 +98,10 @@
    11.4      
    11.5      // Max Link Text
    11.6      $c->add('linktext_maxlen',50,'text',7,31,NULL,1754,TRUE, $me,31);    
    11.7 +
    11.8 +    // Email CC settings
    11.9 +    $c->add('mail_cc_enabled', 1, 'select', 0, 1, 0, 180, TRUE, $me, 1);
   11.10 +    $c->add('mail_cc_default', 0, 'select', 0, 1, 0, 190, TRUE, $me, 1);
   11.11      
   11.12      return true;
   11.13  }
    12.1 --- a/sql/updates/pgsql_1.8.1_to_1.9.0.php	Wed Feb 01 10:45:33 2012 -0500
    12.2 +++ b/sql/updates/pgsql_1.8.1_to_1.9.0.php	Wed Feb 01 20:35:07 2012 -0500
    12.3 @@ -99,7 +99,11 @@
    12.4      $c->add('disable_breadcrumbs_plugins', 0, 'select', 7, 45, 0, 2020, TRUE, $me, 45);
    12.5  
    12.6      // Max Link Text
    12.7 -    $c->add('linktext_maxlen',50,'text',7,31,NULL,1754,TRUE, $me,31); 
    12.8 +    $c->add('linktext_maxlen',50,'text',7,31,NULL,1754,TRUE, $me,31);
    12.9 +    
   12.10 +    // Email CC settings
   12.11 +    $c->add('mail_cc_enabled', 1, 'select', 0, 1, 0, 180, TRUE, $me, 1);
   12.12 +    $c->add('mail_cc_default', 0, 'select', 0, 1, 0, 190, TRUE, $me, 1);    
   12.13      
   12.14      return true;
   12.15  }