Project

General

Profile

« Previous | Next » 

Revision 576

Added by doc almost 17 years ago

Added the new admin tool email output filter which allows to transform emails before displaying them on the frontend

View differences:

trunk/CHANGELOG
11 11
! = Update/Change
12 12

  
13 13
------------------------------------- 2.7.0 -------------------------------------
14

  
15
20-Jan-2008 Thomas Hornik
16
!	updated admin/pages/sections.php to changed jscalendar-api from changeset 571
17
!	module menu_link: after adding a menu_link, the anchor dropdown shows "#"; fixed 
14

  
15
20-Jan-2008 Christian Sommer
16
+	added the new admin tool email output filter which allows to transform
17
	emails before displaying them on the frontend
18
20-Jan-2008 Thomas Hornik
19
!	updated admin/pages/sections.php to changed jscalendar-api from changeset 571
20
!	module menu_link: after adding a menu_link, the anchor dropdown shows "#"; fixed 
18 21
#	fixed E_NOTICE-warning in news-module (about SECTION_ID in comment.php)
19 22
19-Jan-2008 Christian Sommer
20 23
!	Reduced the success time out and set WYSIWSY background to white
......
23 26
19-Jan-2008 Matthias Gallas
24 27
#	Fixed bug in news modul with missing variable PAGE_DIRECTORY
25 28
+	Added keywords to new files
26
19-Jan-2008 Thomas Hornik
27
-	Module news: removed old calendar
28
+	Module news: adapted news to use the new include/jscalendar
29
19-Jan-2008 Thomas Hornik

30
-	Module news: removed old calendar

31
+	Module news: adapted news to use the new include/jscalendar

29 32
+	added installation-instructions to include/jscalendar
30 33
#	Module code: curly backets get deleted by pparse() from phplib. fixed
31 34
+	Module menu_link: added dropdown-listbox to select anchor
trunk/wb/framework/frontend.functions.php
346 346
			$base_file = "frontend.js";
347 347
		}
348 348

  
349
  	// gather information for all models embedded on actual page
349
  		// gather information for all models embedded on actual page
350 350
		$page_id = $wb->page_id;
351
    $query_modules = $database->query("SELECT module FROM " .TABLE_PREFIX ."sections 
351
    	$query_modules = $database->query("SELECT module FROM " .TABLE_PREFIX ."sections 
352 352
			WHERE page_id=$page_id AND module<>'wysiwyg'");
353 353

  
354
    while($row = $query_modules->fetchRow()) {
354
    	while($row = $query_modules->fetchRow()) {
355 355
			// check if page module directory contains a frontend.js or frontend.css file
356
    	if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file")) {
356
    		if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file")) {
357 357
				// create link with frontend.js or frontend.css source for the current module
358 358
				$tmp_link = str_replace("{MODULE_DIRECTORY}", $row['module'], $base_link);
359 359

  
360
        // define constant indicating that the register_frontent_files was invoked
360
        		// define constant indicating that the register_frontent_files was invoked
361 361
				if($file_id == 'css') {
362 362
					define('MOD_FRONTEND_CSS_REGISTERED', true);
363 363
				} else {
364 364
					define('MOD_FRONTEND_JAVASCRIPT_REGISTERED', true);
365 365
				}
366 366

  
367
        // ensure that frontend.js or frontend.css is only added once per module type
368
        if(strpos($head_links, $tmp_link) === false) {
367
        		// ensure that frontend.js or frontend.css is only added once per module type
368
        		if(strpos($head_links, $tmp_link) === false) {
369 369
					$head_links .= $tmp_link ."\n";
370 370
				}
371 371
			}
372
    }
373
  	// write out links with all external module javascript/CSS files, remove last line feed
372
    	}
373
  		// include the Javascript email protection function
374
  		if($file_id != 'css' && file_exists(WB_PATH .'/modules/mail_filter/js/mdcr.js')) {
375
			$head_links .= '<script type="text/javascript" src="'.WB_URL.'/modules/mail_filter/js/mdcr.js"></script>' ."\n";
376
		}
377
  		
378
		// write out links with all external module javascript/CSS files, remove last line feed
374 379
		echo $head_links;
375 380
	}
376 381
}
trunk/wb/index.php
79 79
	}
80 80
}
81 81

  
82
// Display the template
82
if(file_exists(WB_PATH .'/modules/mail_filter/filter-routines.php')) {
83
	// include the filter routines
84
	require_once(WB_PATH .'/modules/mail_filter/filter-routines.php');
85
	
86
	// get the mail filter settings from the database 
87
	$mail_filter_settings = get_mail_filter_settings();
88
	// check if we should filter emails before displaying them
89
	if($mail_filter_settings['email_filter'] == '1') {
90
		// filter email addresses before displaying them
91
		ob_start();
92
		require(WB_PATH.'/templates/'.TEMPLATE.'/index.php');
93
		$frontend_output = ob_get_contents();
94
		ob_end_clean();
95
		$frontend_output = filter_email_links($frontend_output);
96
		echo $frontend_output;
97
		die;
98
	}
99
}
100
// Display the template (no output filtering)
83 101
require(WB_PATH.'/templates/'.TEMPLATE.'/index.php');
84 102

  
85 103
?>
trunk/wb/modules/mail_filter/uninstall.php
1
<?php
2

  
3
// $Id: uninstall.php 547 2008-01-17 19:38:05Z doc $
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2008, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
// prevent this file from being accessed directly
27
if(!defined('WB_PATH')) { exit('Cannot access this file directly'); }
28

  
29
$table = TABLE_PREFIX .'mod_mail_filter';
30
$database->query("DROP TABLE `$table`");
31

  
32
?>
trunk/wb/modules/mail_filter/filter-routines.php
1
<?php
2

  
3
// $Id: filter-routines.php 519 2007-12-23 14:37:02Z Doc $
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2008, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
// direct access prevention
27
defined('WB_PATH') OR die(header('Location: ../index.php'));
28

  
29

  
30
// function to read the current filter settings
31
if (!function_exists('get_mail_filter_settings')) {
32
	function get_mail_filter_settings() {
33
		global $database, $admin;
34
		// connect to database and read out filter settings
35
		$result = $database->query("SELECT * FROM " .TABLE_PREFIX ."mod_mail_filter");
36
		if($result->numRows() > 0) {
37
			// get all data
38
			$data = $result->fetchRow();
39
			$filter_settings['email_filter'] = $admin->strip_slashes($data['email_filter']);
40
			$filter_settings['mailto_filter'] = $admin->strip_slashes($data['mailto_filter']);
41
			$filter_settings['at_replacement'] = $admin->strip_slashes($data['at_replacement']);
42
			$filter_settings['dot_replacement'] = $admin->strip_slashes($data['dot_replacement']);
43
		} else {
44
			// something went wrong, use dummy value
45
			$filter_settings['email_filter'] = '0';
46
			$filter_settings['mailto_filter'] = '0';
47
			$filter_settings['at_replacement'] = '(at)';
48
			$filter_settings['dot_replacement'] = '(dot)';
49
		}
50
		
51
		// return array with filter settings
52
		return $filter_settings;
53
	}
54
}
55

  
56

  
57
// function to rewrite email before beeing displayed the frontend
58
if (!function_exists('filter_email_links')) {
59
	function filter_email_links($content) {
60
		// get the mailer settings from the global variable defined in /wb/index.php
61
		global $mail_filter_settings;
62

  
63
		// check if there is anything to do
64
		global $mail_filter_settings;
65
		if(!isset($mail_filter_settings['email_filter']) || $mail_filter_settings['email_filter'] !=='1' ||
66
			!isset($mail_filter_settings['mailto_filter']) || !isset($mail_filter_settings['at_replacement']) || 
67
			!isset($mail_filter_settings['dot_replacement'])) {
68
			return $content;
69
		}
70

  
71
		// search pattern to find all mail addresses embedded in the frontend content (both text and mailto emails)
72
		$pattern = '#(<a href="mailto:)?(\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,})([^">]*">)?([^<]*</a>)?#i';
73
		/*
74
			exp 1:  (<a href=mailto:)?	-> Optional: search for <a href=mailto:
75
			exp 2a: (\w[\w|\.|\-]+@ 	 	-> 1st char word element, one ore more (+) word elements, or (|) . or (|) - followed by @
76
			exp 2b: \w[\w|\.|\-]+ 		-> see exp 2 for explanation
77
			exp 2c: \.[a-zA-Z]{2,})  	-> dot followed by at least 2 characters (TLD filter: .de, .com, .info) 
78
			exp 3: ([^">]*">)?  			-> Optional: all characters except > followed by ">; could contain ?subject=...&body=...
79
			exp 4: ([^<]*</a>)?  			-> Optional: all characters except <; email link message
80
			? 1 or 0 matches, # encapsulate regex, () subpattern as additional array element, i.. inherent (not case sensitive)
81
		*/
82

  
83
		// find all email addresses embedded in the content and encrypt them via callback function encrypt_emails
84
		$content = preg_replace_callback($pattern, 'encrypt_emails', $content);
85
		return $content;
86
	}
87
}
88

  
89

  
90
// function to encrypt mailto links before beeing displayed at the frontend
91
if (!function_exists('encrypt_emails')) {
92
	function encrypt_emails($match) { 
93
		// get the mailer settings from the global variable defined in /wb/index.php
94
		global $mail_filter_settings;
95

  
96
		// check if there is anything to do
97
		if(!isset($mail_filter_settings['email_filter']) || $mail_filter_settings['email_filter'] !=='1' ||
98
			!isset($mail_filter_settings['mailto_filter']) || !isset($mail_filter_settings['at_replacement']) || 
99
			!isset($mail_filter_settings['dot_replacement'])) {
100
			return $match[0];
101
		}
102
		
103
		// work out replacements
104
		$at_replace = strip_tags($mail_filter_settings['at_replacement']);
105
		$dot_replace = strip_tags($mail_filter_settings['dot_replacement']);
106

  
107
		// check if extracted email address is mailto or text ($match[0] contains entire regexp pattern)
108
		if (strpos($match[0], "mailto:") > 0) {
109
			// mailto email
110

  
111
			// do we need to consider mailto links
112
			if($mail_filter_settings['mailto_filter'] !='1') {
113
				// do not touch mailto links
114
				return $match[0];
115
			}
116
			
117
			// email sub parts: [<a href="mailto:] [name@domain.com] [?subject=blubb&Body=text">] [Mail description</a>]
118
			$email_href			= $match[1];	// a href part
119
			$email_address		= $match[2];	// email address
120
			$email_options 	= $match[3];	// optional: subject or body text for mail clients
121
			$email_link_text 	= $match[4];	// optional: mail description
122

  
123
			// do some cleaning
124
			$email_options 	= str_replace("\">", "", $email_options);					// strip off '">'
125
			$email_link_text 	= str_replace("</a>", "", trim($email_link_text));		// strip off closing </a>
126

  
127
			// make sure that all emails have a description
128
			if(strlen($email_link_text) == 0 ) {
129
				$email_link_text = $email_address;
130
			}
131

  
132
			// replace "@" and "." within top level domain (TLD) if link text is a valid email address
133
			if(preg_match('#\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,}#i', $email_link_text, $email)) {
134
				$email_link_text = str_replace("@", $at_replace, $email_address);		// replace @
135
				// remove "." from top level domain (TLD) part
136
				if (preg_match('#\.[a-zA-Z]{2,}$#im', $email_link_text, $tld) !==0) {
137
					$tld_replace =  str_replace(".", $dot_replace, $tld[0]);
138
					$email_link_text = str_replace($tld[0], $tld_replace, $email_link_text);				// replace . in email TLD part
139
				}
140
			}
141
		
142
			//////////////////////////////////////////////////////////////////////////////////////////////////////////////
143
			// encrypt the email address
144
			//////////////////////////////////////////////////////////////////////////////////////////////////////////////
145
			// create random encryption key
146
			mt_srand((double)microtime()*1000000);			// initialize the randomizer (PHP < 4.2.0)
147
			$char_shift = mt_rand(1, 5);						// shift:=1; a->b, shift:=5; a-->f
148
			$decryption_key = chr($char_shift+97);			// ASCII a:=97
149
		
150
			// prepare mailto string for encryption (mail protocol, decryption key, mail address)
151
			$email_address = "mailto:" .$decryption_key .$email_address;
152
		
153
			// encrypt email address by shifting characters
154
		  	$encrypted_email = "";
155
			for($i=0; $i<strlen($email_address); $i++) {
156
				$encrypted_email .= chr(ord($email_address[$i]) + $char_shift);
157
			}
158
			$encrypted_email[7] = $decryption_key;			// replace first character after mailto: with decryption key 
159
			$encrypted_email = rawurlencode($encrypted_email);
160

  
161
			// return encrypted javascript mailto link
162
			$mailto_link  = "<a href=\"javascript:mdcr('";		// a href part with javascript function to decrypt the email address
163
			$mailto_link .= "$encrypted_email')\">";				// add encrypted email address as paramter to JS function mdcr
164
			$mailto_link .= $email_link_text ."</a>";				// add email link text and closing </a> tag
165
			return $mailto_link;
166
		
167
		} else {
168
			// text email (e.g. name@domain.com)
169
			$match[0] = str_replace("@", $at_replace, $match[0]);		// replace @
170
			// remove "." from top level domain (TLD) part
171
			if (preg_match('#\.[a-zA-Z]{2,}$#im', $match[0], $tld) !==0) {
172
				$tld_replace =  str_replace(".", $dot_replace, $tld[0]);
173
				return str_replace($tld[0], $tld_replace, $match[0]);							// replace . in email TLD part
174
			}
175
		}
176
	}
177
}
178

  
179
?>
trunk/wb/modules/mail_filter/info.php
1
<?php
2

  
3
// $Id: info.php 519 2007-12-23 14:37:02Z Doc $
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2008, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
 -----------------------------------------------------------------------------------------
25
  Email Output Filter tool for Website Baker v2.7
26
  Licencsed under GNU, written by Christian Sommer (Doc)
27
 -----------------------------------------------------------------------------------------
28
   v0.10  (doc; 21 Jan, 2008)
29
    + initial module release (Note: requires WB 2.7 core file changes to work)
30

  
31
*/
32

  
33
$module_directory 	= 'mail_filter';
34
$module_name 			= 'Email Output Filter';
35
$module_function 		= 'tool';
36
$module_version 		= '0.10';
37
$module_platform 		= '2.7';
38
$module_author 		= 'Christian Sommer (doc)';
39
$module_license 		= 'GNU General Public License';
40
$module_description 	= 'This module allows you to define rewrite rules for emails (e.g. <em>name@mail.com</em> --> <em>name(at)mail(dot).com</em>).';
41

  
42
?>
trunk/wb/modules/mail_filter/tool.php
1
<?php
2

  
3
// $Id: tool.php 519 2007-12-23 14:37:02Z Doc $
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2008, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
// direct access prevention
27
defined('WB_PATH') OR die(header('Location: ../index.php'));
28

  
29
// check if data was submitted
30
if(isset($_POST['save_settings'])) {
31
	// get configuration settings
32
	$email_filter = ($_POST['email_filter'] == '1') ? '1' : '0';
33
	$mailto_filter = ($_POST['mailto_filter'] == '1') ? '1' : '0';
34
	
35
	// get replacement settings
36
	$at_replacement = strip_tags($_POST['at_replacement']);
37
	$at_replacement = (strlen(trim($at_replacement)) > 0) ? $admin->add_slashes($at_replacement) : '(at)';
38
	$dot_replacement = strip_tags($_POST['dot_replacement']);
39
	$dot_replacement = (strlen(trim($dot_replacement)) > 0) ? $admin->add_slashes($dot_replacement) : '(dot)';
40
	
41
	// update database settings
42
	$database->query("UPDATE " .TABLE_PREFIX ."mod_mail_filter SET email_filter = '$email_filter', 
43
		mailto_filter = '$mailto_filter', at_replacement = '$at_replacement', dot_replacement = '$dot_replacement'");
44

  
45
	// check if there is a database error, otherwise say successful
46
	if($database->is_error()) {
47
		$admin->print_error($database->get_error(), $js_back);
48
	} else {
49
		$admin->print_success($MESSAGE['PAGES']['SAVED'], ADMIN_URL.'/admintools/tool.php?tool=mail_filter');
50
	}
51

  
52
} else {
53
	// write out heading
54
	echo '<h2>Email Output Filter</h2>';
55

  
56
	// include filter functions
57
	require_once(WB_PATH .'/modules/mail_filter/filter-routines.php');
58
	
59
	// read the mail filter settings from the database 
60
	$data = get_mail_filter_settings();
61
	
62
	// output the form with values from the database
63
?>
64

  
65
<p>You can enable/disable the output filtering of email adresses with the options below. The Javascript mailto: encryption requires to enable the register_frontend_modfiles in your browser.</p>
66
<form name="store_settings" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
67
	<table width="98%" cellspacing="0" cellpadding="5px" class="row_a">
68
	<tr><td colspan="2"><strong>Basic Configuration:</strong></td></tr>
69
	<tr>
70
		<td width="35%">Email Output Filter:</td>
71
		<td>
72
			<input type="radio" <?php echo ($data['email_filter']=='1') ?'checked="checked"' :'';?> 
73
				name="email_filter" value="1">Enabled
74
			<input type="radio" <?php echo ($data['email_filter']=='0') ?'checked="checked"' :'';?> 
75
				name="email_filter" value="0">Disabled
76
		</td>
77
	</tr>
78
	<tr>
79
		<td>Javascript Encryption (mailto):</td>
80
		<td>
81
			<input type="radio" <?php echo ($data['mailto_filter']=='1') ?'checked="checked"' :'';?>
82
				name="mailto_filter" value="1">Enabled
83
			<input type="radio" <?php echo (($data['mailto_filter'])=='0') ?'checked="checked"' :'';?>
84
				name="mailto_filter" value="0">Disabled
85
		</td>
86
	</tr>
87
	<tr><td colspan="2"><br /><strong>Email Replacements:</strong></td></tr>
88
	<tr>
89
		<td>Replacement for "@":</td>
90
		<td><input type="text" style="width: 160px" value="<?php echo $data['at_replacement'];?>" 
91
			name="at_replacement"/></td>
92
	</tr>
93
	<tr>
94
		<td>Replacement for ".":</td>
95
		<td><input type="text" style="width: 160px" value="<?php echo $data['dot_replacement'];?>" 
96
			name="dot_replacement"/></td>
97
	</tr>
98
	</table>
99
	<input type="submit" name="save_settings" style="margin-top:10px; width:140px;" value="<?php echo $TEXT['SAVE']; ?>" />
100
</form>
101
<?php
102
}
103

  
104
?>
trunk/wb/modules/mail_filter/install.php
1
<?php
2

  
3
// $Id: install.php 565 2008-01-19 15:07:26Z doc $
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2008, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
// prevent this file from being accessed directly
27
if(!defined('WB_PATH')) { exit('Cannot access this file directly'); }
28

  
29
$table = TABLE_PREFIX .'mod_mail_filter';
30
$database->query("DROP TABLE IF EXISTS `$table`");
31

  
32
$database->query("CREATE TABLE `$table` (
33
	`email_filter` VARCHAR(1) NOT NULL DEFAULT '0',
34
	`mailto_filter` VARCHAR(1) NOT NULL DEFAULT '0',
35
	`at_replacement` VARCHAR(255) NOT NULL DEFAULT '(at)',
36
	`dot_replacement` VARCHAR(255) NOT NULL DEFAULT '(dot)'
37
	)"
38
);
39

  
40
// add new row using the table default values defined above
41
//$database->query("INSERT INTO ".TABLE_PREFIX."mod_mail_filter");
42
$database->query("INSERT INTO ".TABLE_PREFIX."mod_mail_filter (email_filter, mailto_filter, at_replacement, dot_replacement) VALUES ('0', '0', '(at)', '(dot)')");
43

  
44

  
45
?>
trunk/wb/modules/mail_filter/js/mdcr.js
1
/*
2
--------------------------------------------------------------------------------
3
  MDCR (Mail DeCrypt Routine) for Website Baker v2.6.x
4
  Licencsed under GNU, written by Christian Sommer (Doc)
5
--------------------------------------------------------------------------------
6
*/
7

  
8
function mdcr(s) {
9
  location.href=dcstr(s);
10
}
11

  
12
function dcstr(s) {
13
  var m = unescape(s);
14
  var x = m.charCodeAt(7)-97;
15
  var c = m.substr(0,7) + m.substr(8);
16
  var n=0;
17
  var r="";
18

  
19
  for(var i=0; i<c.length; i++) {
20
    r+=String.fromCharCode(c.charCodeAt(i) - x);
21
  }
22
  return r;
23
}
trunk/wb/modules/mail_filter/index.php
1
<?php
2

  
3
// $Id: index.php 519 2007-12-23 14:37:02Z Doc $
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2008, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
header('Location: ../index.php');
27

  
28
?>

Also available in: Unified diff