public
Description: Git mirror of the CMS Made Simple 2.0 rewrite
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsmadesimple-2-0.git
Add a third tab to the site preferences for mail settings.  it works, 
they're just not used (yet).


git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@4424 
3d254a34-79dc-0310-9e5f-be208747d8a0
calguy1000 (author)
Wed Apr 09 18:20:11 -0700 2008
commit  a25e2159f33d91089c91ae347ba5b93d74931e84
tree    b6130b22e51a5b498813cf4225c3af66061685fb
parent  90f3b0d057bb8519d656a05ce8a20a78f4dd2957
...
1
 
 
 
 
 
 
2
3
4
...
1
2
3
4
5
6
7
8
9
10
0
@@ -1,4 +1,10 @@
0
 <?php
0
+$lang['admin']['edited_mail_preferences'] = 'Edited Mail Preferences';
0
+$lang['admin']['sendmail_short_help'] = 'This setting (the path to the sendmail binary on your host) is only used if mailer selected is \'sendmail\'';
0
+$lang['admin']['smtp_short_help'] = 'These settings only apply if the mailer selected is \'SMTP\'';
0
+$lang['admin']['smtp_mail_settings'] = 'SMTP Mail Settings';
0
+$lang['admin']['mail_settings_short_help'] = 'You may need to contact your host to correctly configure these settings so that CMS Made Simple can send emails.';
0
+
0
 $lang['admin']['disablesafemodewarning'] = 'Disable admin safe mode warning';
0
 $lang['admin']['allowparamcheckwarnings'] = 'Allow parameter checks to create warning messages';
0
 $lang['admin']['date_format_string'] = 'Date Format String';
...
197
198
199
200
201
 
...
197
198
199
 
200
201
0
@@ -197,4 +197,4 @@ if ($show_list)
0
 include_once("footer.php");
0
 
0
 # vim:ts=4 sw=4 noet
0
-?>
0
\ No newline at end of file
0
+?>
...
208
209
210
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
212
213
...
238
239
240
 
 
 
 
 
 
 
 
 
 
241
242
243
...
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
...
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
0
@@ -208,6 +208,37 @@ else if (isset($_POST["editsiteprefs"]))
0
     $error .= "<li>".lang('noaccessto', array('Modify Site Permissions'))."</li>";
0
   }
0
 }
0
+else if( isset($_POST['mailsettings']) )
0
+{
0
+ if( $access )
0
+ {
0
+ $mail_mailer = coalesce_key($_POST,'mail_mailer','mail');
0
+ $mail_host = coalesce_key($_POST,'mail_host','');
0
+ $mail_port = coalesce_key($_POST,'mail_port','');
0
+ $mail_smtpauth = coalesce_key($_POST,'mail_smtpauth',false);
0
+ $mail_smtpauthuser = coalesce_key($_POST,'mail_smtpauthuser','');
0
+ $mail_smtpauthpw = coalesce_key($_POST,'mail_smtpauthpw','');
0
+ $mail_sendmail = coalesce_key($_POST,'mail_sendmail','');
0
+ $mail_from = coalesce_key($_POST,'mail_from','');
0
+ $mail_fromuser = coalesce_key($_POST,'mail_fromuser','');
0
+
0
+ CmsApplication::set_preference('mail_mailer',$mail_mailer);
0
+ CmsApplication::set_preference('mail_host',$mail_host);
0
+ CmsApplication::set_preference('mail_port',$mail_port);
0
+ CmsApplication::set_preference('mail_smtpauth',$mail_smtpauth);
0
+ CmsApplication::set_preference('mail_smtpauthuser',$mail_smtpauthuser);
0
+ CmsApplication::set_preference('mail_smtpauthpw',$mail_smtpauthpw);
0
+ CmsApplication::set_preference('mail_sendmail',$mail_sendmail);
0
+ CmsApplication::set_preference('mail_from',$mail_from);
0
+ CmsApplication::set_preference('mail_fromuser',$mail_fromuser);
0
+ audit(-1, '', lang('edited_mail_preferences'));
0
+ $message .= lang('prefsupdated');
0
+ }
0
+ else
0
+ {
0
+ $error .= "<li>".lang('noaccessto', array('Modify Site Permissions'))."</li>";
0
+ }
0
+}
0
 else if (!isset($_POST["submit"]))
0
 {
0
   $global_umask = CmsApplication::get_preference('global_umask',$global_umask);
0
@@ -238,6 +269,16 @@ $smarty->assign('logintheme', $logintheme);
0
 $smarty->assign('metadata', $metadata);
0
 $smarty->assign('sitename', $sitename);
0
 
0
+$smarty->assign('mail_mailer',CmsApplication::get_preference('mail_mailer','mail'));
0
+$smarty->assign('mail_host',CmsApplication::get_preference('mail_host',''));
0
+$smarty->assign('mail_port',CmsApplication::get_preference('mail_port',''));
0
+$smarty->assign('mail_smtpauth',CmsApplication::get_preference('mail_smtpauth',''));
0
+$smarty->assign('mail_smtpauthuser',CmsApplication::get_preference('mail_smtpauthuser',''));
0
+$smarty->assign('mail_smtpauthpw',CmsApplication::get_preference('mail_smtpauthpw',''));
0
+$smarty->assign('mail_sendmail',CmsApplication::get_preference('mail_sendmail',''));
0
+$smarty->assign('mail_from',CmsApplication::get_preference('mail_from',''));
0
+$smarty->assign('mail_fromuser',CmsApplication::get_preference('mail_fromuser',''));
0
+
0
 $templates = array();
0
 $templates['-1'] = 'None';
0
 
...
18
19
20
 
21
22
23
 
24
25
26
...
71
72
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
75
76
77
...
18
19
20
21
22
23
24
25
26
27
28
...
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
0
@@ -18,9 +18,11 @@
0
 
0
   <div id="page_tabs">
0
 
0
+ {* tab headers *}
0
     <ul class="anchors">
0
       <li><a href="#general"><span>{tr}General{/tr}</span></a></li>
0
       <li><a href="#languages"><span>{tr}Languages{/tr}</span></a></li>
0
+ <li><a href="#mail"><span>{tr}Mail Settings{/tr}</span></a></li>
0
     </ul>
0
 
0
     <div id="general" class="fragment">
0
@@ -71,6 +73,34 @@
0
       </form>
0
 
0
     </div>
0
+
0
+ <div id="mail" class="fragment">
0
+ <form method="post" name="mailform" id="mailform" action="siteprefs.php">
0
+ <p>{lang string='mail_settings_short_help'}</p>
0
+ {assign var='tmp1' value=','|explode:"mail,sendmail,smtp"}
0
+ {assign var='tmp2' value=','|explode:"Mail,Sendmail,Smtp"}
0
+ {admin_input type='select' label='Mailer' name='mail_mailer' id='mail_mailer' options=$tmp2 values=$tmp1 selected=$mail_mailer}
0
+ <fieldset>
0
+ <legend>&nbsp;{lang string='smtp_mail_settings'}&nbsp;</legend>
0
+ <p>{lang string='smtp_short_help'}</p>
0
+ {admin_input type='input' label='SMTP Host' name='mail_host' id='mail_host' value=$mail_host}
0
+ {admin_input type='input' label='SMTP Port' name='mail_port' id='mail_port' value=$mail_port}
0
+ {admin_input type='checkbox' label='Use SMTP Auth' name='mail_smtpauth' id='mail_smtpauth' value=$mail_smtpauth}
0
+ {admin_input type='input' label='SMTP Auth Username' name='mail_smtpauthuser' id='mail_smtpauthuser' value=$mail_smtpauthuser}
0
+ {admin_input type='input' label='SMTP Auth Password' name='mail_smtpauthpw' id='mail_smtpauthpw' value=$mail_smtpauthpw}
0
+ </fieldset>
0
+ <fieldset>
0
+ <legend>&nbsp;{lang string='sendmail_settings'}&nbsp;</legend>
0
+ <p>{lang string='sendmail_short_help'}</p>
0
+ {admin_input type='input' label='Sendmail Path' name='mail_sendmail' id='mail_sendmail' value=$mail_sendmail}
0
+ </fieldset>
0
+ {admin_input type='input' label='Default From Address' name='mail_from' id='mail_from' value=$mail_from}
0
+ {admin_input type='input' label='Default From Name' name='mail_fromname' id='mail_fromname' value=$mail_fromname}
0
+
0
+ <input type="hidden" name="mailsettings" value="true" />
0
+ {include file='elements/buttons.tpl'}
0
+ </form>
0
+ </div>
0
   </div>
0
 </div>
0
 {literal}<script>$('#page_tabs').tabs({fxAutoHeight: false});</script>{/literal}
0
\ No newline at end of file

Comments

    No one has commented yet.