1 |
1420
|
Luisehahne
|
<?php
|
2 |
|
|
/**
|
3 |
|
|
*
|
4 |
|
|
* @category modules
|
5 |
|
|
* @package output_filter
|
6 |
|
|
* @author WebsiteBaker Project
|
7 |
|
|
* @copyright 2004-2009, Ryan Djurovich
|
8 |
|
|
* @copyright 2009-2011, Website Baker Org. e.V.
|
9 |
|
|
* @link http://www.websitebaker2.org/
|
10 |
|
|
* @license http://www.gnu.org/licenses/gpl.html
|
11 |
|
|
* @platform WebsiteBaker 2.8.x
|
12 |
|
|
* @requirements PHP 5.2.2 and higher
|
13 |
|
|
* @version $Id$
|
14 |
|
|
* @filesource $HeadURL$
|
15 |
|
|
* @lastmodified $Date$
|
16 |
|
|
*
|
17 |
|
|
*/
|
18 |
|
|
|
19 |
|
|
// Must include code to stop this file being access directly
|
20 |
|
|
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
|
21 |
|
|
|
22 |
|
|
// check if module language file exists for the language set by the user (e.g. DE, EN)
|
23 |
|
|
$MOD_MAIL_FILTER['WARNING'] = '<p style="color: red; line-height:1.5em;"><strong>Warning: </strong>This function is now available as a Droplet. The next major release of website baker will not include this filter anymore. Please concider using the <a href="?tool=droplets">Droplet</a> [[EmailFilter]]</p>';
|
24 |
|
|
if(!file_exists(WB_PATH .'/modules/output_filter/languages/'.LANGUAGE .'.php')) {
|
25 |
|
|
// no module language file exists for the language set by the user, include default module language file EN.php
|
26 |
|
|
require_once(WB_PATH .'/modules/output_filter/languages/EN.php');
|
27 |
|
|
} else {
|
28 |
|
|
// a module language file exists for the language defined by the user, load it
|
29 |
|
|
require_once(WB_PATH .'/modules/output_filter/languages/'.LANGUAGE .'.php');
|
30 |
|
|
}
|
31 |
|
|
// check if data was submitted
|
32 |
|
|
if(isset($_POST['save_settings'])) {
|
33 |
|
|
|
34 |
|
|
if (!$admin->checkFTAN())
|
35 |
|
|
{
|
36 |
1460
|
Luisehahne
|
if(!$admin_header) { $admin->print_header(); }
|
37 |
1425
|
Luisehahne
|
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'],$_SERVER['REQUEST_URI'],false);
|
38 |
1420
|
Luisehahne
|
}
|
39 |
|
|
// get overall output filter settings
|
40 |
1475
|
Luisehahne
|
$sys_rel = (isset($_POST['sys_rel']) && $_POST['sys_rel'] == '1') ? '1' : '0';
|
41 |
1420
|
Luisehahne
|
$email_filter = (isset($_POST['email_filter']) && $_POST['email_filter'] == '1') ? '1' : '0';
|
42 |
|
|
$mailto_filter = (isset($_POST['mailto_filter']) && $_POST['mailto_filter'] == '1') ? '1' : '0';
|
43 |
|
|
|
44 |
|
|
// get email replacement settings
|
45 |
|
|
$at_replacement = isset($_POST['at_replacement']) ?strip_tags($_POST['at_replacement']) : '';
|
46 |
|
|
$at_replacement = (strlen(trim($at_replacement)) > 0) ? $admin->add_slashes($at_replacement) : '(at)';
|
47 |
|
|
$dot_replacement = isset($_POST['dot_replacement']) ?strip_tags($_POST['dot_replacement']) : '';
|
48 |
|
|
$dot_replacement = (strlen(trim($dot_replacement)) > 0) ? $admin->add_slashes($dot_replacement) : '(dot)';
|
49 |
|
|
|
50 |
|
|
// update database settings
|
51 |
1475
|
Luisehahne
|
$database->query("UPDATE " .TABLE_PREFIX ."mod_output_filter SET email_filter = '$email_filter',
|
52 |
|
|
sys_rel = '$sys_rel', mailto_filter = '$mailto_filter', at_replacement = '$at_replacement', dot_replacement = '$dot_replacement'");
|
53 |
1420
|
Luisehahne
|
|
54 |
|
|
// check if there is a database error, otherwise say successful
|
55 |
1460
|
Luisehahne
|
if(!$admin_header) { $admin->print_header(); }
|
56 |
1420
|
Luisehahne
|
if($database->is_error()) {
|
57 |
|
|
$admin->print_error($database->get_error(), $js_back);
|
58 |
|
|
} else {
|
59 |
|
|
$admin->print_success($MESSAGE['PAGES']['SAVED'], ADMIN_URL.'/admintools/tool.php?tool=output_filter');
|
60 |
|
|
}
|
61 |
|
|
|
62 |
|
|
} else {
|
63 |
1460
|
Luisehahne
|
}
|
64 |
1420
|
Luisehahne
|
// write out heading
|
65 |
|
|
echo '<h2>' .$MOD_MAIL_FILTER['HEADING'] .'</h2>';
|
66 |
|
|
|
67 |
|
|
// include filter functions
|
68 |
|
|
require_once(WB_PATH .'/modules/output_filter/filter-routines.php');
|
69 |
|
|
|
70 |
1457
|
Luisehahne
|
// read the mail filter settings from the database
|
71 |
1420
|
Luisehahne
|
$data = get_output_filter_settings();
|
72 |
|
|
|
73 |
|
|
// output the form with values from the database
|
74 |
|
|
echo '<p>' .$MOD_MAIL_FILTER['HOWTO'] .'</p>';
|
75 |
|
|
echo $MOD_MAIL_FILTER['WARNING'];
|
76 |
|
|
?>
|
77 |
|
|
<form name="store_settings" action="<?php echo $_SERVER['REQUEST_URI'];?>" method="post">
|
78 |
|
|
<?php echo $admin->getFTAN(); ?>
|
79 |
|
|
<table width="98%" cellspacing="0" cellpadding="5px" class="row_a">
|
80 |
|
|
<tr><td colspan="2"><strong><?php echo $MOD_MAIL_FILTER['BASIC_CONF'];?>:</strong></td></tr>
|
81 |
|
|
<tr>
|
82 |
1475
|
Luisehahne
|
<td width="35%"><?php echo $MOD_MAIL_FILTER['SYS_REL'];?>:</td>
|
83 |
|
|
<td>
|
84 |
|
|
<input type="radio" <?php echo ($data['sys_rel']=='1') ? 'checked="checked"' :'';?>
|
85 |
|
|
name="sys_rel" value="1"><?php echo $MOD_MAIL_FILTER['ENABLED'];?>
|
86 |
|
|
<input type="radio" <?php echo (($data['sys_rel'])=='0') ? 'checked="checked"' :'';?>
|
87 |
|
|
name="sys_rel" value="0"><?php echo $MOD_MAIL_FILTER['DISABLED'];?>
|
88 |
|
|
</td>
|
89 |
|
|
</tr>
|
90 |
|
|
<tr>
|
91 |
1420
|
Luisehahne
|
<td width="35%"><?php echo $MOD_MAIL_FILTER['EMAIL_FILTER'];?>:</td>
|
92 |
|
|
<td>
|
93 |
|
|
<input type="radio" <?php echo ($data['email_filter']=='1') ?'checked="checked"' :'';?>
|
94 |
|
|
name="email_filter" value="1"><?php echo $MOD_MAIL_FILTER['ENABLED'];?>
|
95 |
|
|
<input type="radio" <?php echo (($data['email_filter'])=='0') ?'checked="checked"' :'';?>
|
96 |
|
|
name="email_filter" value="0"><?php echo $MOD_MAIL_FILTER['DISABLED'];?>
|
97 |
|
|
</td>
|
98 |
|
|
</tr>
|
99 |
|
|
<tr>
|
100 |
|
|
<td><?php echo $MOD_MAIL_FILTER['MAILTO_FILTER'];?>:</td>
|
101 |
|
|
<td>
|
102 |
|
|
<input type="radio" <?php echo ($data['mailto_filter']=='1') ?'checked="checked"' :'';?>
|
103 |
|
|
name="mailto_filter" value="1"><?php echo $MOD_MAIL_FILTER['ENABLED'];?>
|
104 |
|
|
<input type="radio" <?php echo (($data['mailto_filter'])=='0') ?'checked="checked"' :'';?>
|
105 |
|
|
name="mailto_filter" value="0"><?php echo $MOD_MAIL_FILTER['DISABLED'];?>
|
106 |
|
|
</td>
|
107 |
|
|
</tr>
|
108 |
|
|
<tr><td colspan="2"><br /><strong><?php echo $MOD_MAIL_FILTER['REPLACEMENT_CONF'];?>:</strong></td></tr>
|
109 |
|
|
<tr>
|
110 |
|
|
<td><?php echo $MOD_MAIL_FILTER['AT_REPLACEMENT'];?>:</td>
|
111 |
|
|
<td><input type="text" style="width: 160px" value="<?php echo $data['at_replacement'];?>"
|
112 |
|
|
name="at_replacement"/></td>
|
113 |
|
|
</tr>
|
114 |
|
|
<tr>
|
115 |
|
|
<td><?php echo $MOD_MAIL_FILTER['DOT_REPLACEMENT'];?>:</td>
|
116 |
|
|
<td><input type="text" style="width: 160px" value="<?php echo $data['dot_replacement'];?>"
|
117 |
|
|
name="dot_replacement"/></td>
|
118 |
|
|
</tr>
|
119 |
|
|
</table>
|
120 |
|
|
<input type="submit" name="save_settings" style="margin-top:10px; width:140px;" value="<?php echo $TEXT['SAVE']; ?>" />
|
121 |
|
|
</form>
|