Project

General

Profile

« Previous | Next » 

Revision 1892

Added by Dietmar over 11 years ago

! update output_filter module set version to 0.4.1

View differences:

branches/2.8.x/CHANGELOG
13 13

  
14 14

  
15 15

  
16
19 Mar-2013 Build 1892 Dietmar Woellbrink (Luisehahne)
17
! update output_filter module set version to 0.4.1 
16 18
19 Mar-2013 Build 1891 Dietmar Woellbrink (Luisehahne)
17 19
! update captcha_control module set version to 1.2.1 
18 20
19 Mar-2013 Build 1890 Dietmar Woellbrink (Luisehahne)
branches/2.8.x/wb/upgrade-script.php
965 965
	 * upgrade modules if newer version is available
966 966
	 * $aModuleList list of proofed modules
967 967
	 */
968
	$aModuleList = array('wysiwyg','form','code','captcha_control');
968
	$aModuleList = array('wysiwyg','form','code','captcha_control','output_filter');
969 969
	if(sizeof($aModuleList)) 
970 970
	{
971 971
		echo '<h3>Step '.(++$stepID).': Upgrade proofed modules</h3>';
branches/2.8.x/wb/admin/interface/version.php
51 51

  
52 52
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
53 53
if(!defined('VERSION')) define('VERSION', '2.8.3');
54
if(!defined('REVISION')) define('REVISION', '1891');
54
if(!defined('REVISION')) define('REVISION', '1892');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/modules/output_filter/sql/mod_output_filter.sql
1
-- phpMyAdmin SQL Dump
2
-- Erstellungszeit: 15. Mrz 2013 um 18:21
3
-- Server-Version: 5.5.27
4
--
5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
6
SET time_zone = "+00:00";
7
-- --------------------------------------------------------
8
-- Database structure for WebsiteBaker core
9
--
10
-- Replacements: {TABLE_PREFIX}, {TABLE_ENGINE}, {TABLE_COLLATION}
11
--
12
-- --------------------------------------------------------
13
--
14
-- Tabellenstruktur für Tabelle `{TABLE_PREFIX}mod_output_filter`
15
--
16
DROP TABLE IF EXISTS `{TABLE_PREFIX}mod_output_filter`;
17
CREATE TABLE IF NOT EXISTS `{TABLE_PREFIX}mod_output_filter` (
18
  `sys_rel` int(11) NOT NULL DEFAULT '0',
19
  `email_filter` int(11) NOT NULL DEFAULT '1',
20
  `mailto_filter` int(11) NOT NULL DEFAULT '1',
21
  `at_replacement` varchar(255){TABLE_COLLATION} NOT NULL DEFAULT '(at)',
22
  `dot_replacement` varchar(255){TABLE_COLLATION} NOT NULL DEFAULT '(dot)'
23
){TABLE_ENGINE};
24
-- EndOfFile
branches/2.8.x/wb/modules/output_filter/sql/data_output_filter.sql
1
-- phpMyAdmin SQL Dump
2
-- Erstellungszeit: 15. Mrz 2013 um 18:21
3
-- Server-Version: 5.5.27
4
--
5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
6
SET time_zone = "+00:00";
7
-- --------------------------------------------------------
8
-- Database structure for WebsiteBaker core
9
--
10
-- Replacements: {TABLE_PREFIX}, {TABLE_ENGINE}, {TABLE_COLLATION}
11
--
12
-- --------------------------------------------------------
13
--
14
-- Default Daten für Tabelle `mod_output_filter`
15
--
16

  
17
INSERT INTO `{TABLE_PREFIX}mod_output_filter` VALUES('0', '1', '1', '{at}', '{dot}');
18
-- EndOfFile
branches/2.8.x/wb/modules/output_filter/info.php
4 4
 * @category        modules
5 5
 * @package         output_filter
6 6
 * @author          WebsiteBaker Project
7
 * @copyright       2011, Website Baker Org. e.V.
8
 * @link			http://www.websitebaker2.org/
7
 * @copyright       2012, WebsiteBaker Org. e.V.
8
 * @link            http://www.websitebaker2.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
10
 * @platform        WebsiteBaker 2.8.2
10
 * @platform        WebsiteBaker 2.8.4
11 11
 * @requirements    PHP 5.2.2 and higher
12 12
 * @version         $Id$
13
 * @filesource		$HeadURL$
13
 * @filesource      $HeadURL$
14 14
 * @lastmodified    $Date$
15 15
 *
16 16
 */
17 17

  
18
$module_directory = 'output_filter';
19
$module_name = 'Frontend Output Filter';
20
$module_function = 'tool';
21
$module_version	= '0.4';
22
$module_platform = '2.8.3';
23
$module_author = 'Christian Sommer(doc), WB-Project, Werner v.d. Decken(DarkViper)';
24
$module_license = 'GNU General Public License';
18
$module_directory   = 'output_filter';
19
$module_name        = 'Frontend Output Filter';
20
$module_function    = 'tool';
21
$module_version     = '0.4.1';
22
$module_platform    = '2.8.4';
23
$module_author      = 'Christian Sommer(doc), WB-Project, Werner v.d. Decken(DarkViper)';
24
$module_license     = 'GNU General Public License';
25 25
$module_description = 'This module allows to filter the output before displaying it on the frontend. Support for filtering mailto links and mail addresses in strings.';
branches/2.8.x/wb/modules/output_filter/install.php
4 4
 * @category        modules
5 5
 * @package         output_filter
6 6
 * @author          Christian Sommer, WB-Project, Werner v.d. Decken
7
 * @copyright       2011-, Website Baker Org. e.V.
8
 * @link			http://www.websitebaker2.org/
7
 * @copyright       20096-2012, WebsiteBaker Org. e.V.
8
 * @link            http://www.websitebaker2.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
10 10
 * @platform        WebsiteBaker 2.8.2
11 11
 * @requirements    PHP 5.2.2 and higher
12 12
 * @version         $Id$
13
 * @filesource		$HeadURL$
13
 * @filesource      $HeadURL$
14 14
 * @lastmodified    $Date$
15 15
 *
16 16
 */
17 17
/* -------------------------------------------------------- */
18 18
// Must include code to stop this file being accessed directly
19
require_once( dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php');
20
if(!defined('WB_PATH')) { throw new IllegalFileException(); }
21
/* -------------------------------------------------------- */
22

  
23
$table = TABLE_PREFIX .'mod_output_filter';
24
$database->query("DROP TABLE IF EXISTS `$table`");
25

  
26
$database->query("CREATE TABLE IF NOT EXISTS `$table` (
27
	`sys_rel` INT NOT NULL DEFAULT '0',
28
	`email_filter` VARCHAR(1) NOT NULL DEFAULT '0',
29
	`mailto_filter` VARCHAR(1) NOT NULL DEFAULT '0',
30
	`at_replacement` VARCHAR(255) NOT NULL DEFAULT '(at)',
31
	`dot_replacement` VARCHAR(255) NOT NULL DEFAULT '(dot)'
32
	) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"
33
);
34

  
35
// add default values to the module table
36
$database->query("INSERT INTO ".TABLE_PREFIX
37
	."mod_output_filter (sys_rel,email_filter, mailto_filter, at_replacement, dot_replacement) VALUES ('0','1', '1', '(at)', '(dot)')");
19
if(!defined('WB_PATH')) {
20
	require_once(dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php');
21
	throw new IllegalFileException();
22
} else {
23
	$sError = array();
24
// Create table
25
	if(!$database->SqlImport(dirname(__FILE__).'/sql/mod_output_filter.sql','',false)){
26
		$sError[] = $database->get_error();
27
	}
28
// Create table
29
	if(!$database->SqlImport(dirname(__FILE__).'/sql/data_output_filter.sql','',false)){
30
		$sError[] = $database->get_error();
31
	}
32
}
branches/2.8.x/wb/modules/output_filter/upgrade.php
4 4
 * @category        modules
5 5
 * @package         output_filter
6 6
 * @author          Christian Sommer, WB-Project, Werner v.d. Decken
7
 * @copyright       2009-2011, Website Baker Org. e.V.
8
 * @link			http://www.websitebaker2.org/
7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8
 * @link            http://www.websitebaker2.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
10 10
 * @platform        WebsiteBaker 2.8.2
11 11
 * @requirements    PHP 5.2.2 and higher
12 12
 * @version         $Id$
13
 * @filesource		$HeadURL$
13
 * @filesource      $HeadURL$
14 14
 * @lastmodified    $Date$
15 15
 *
16 16
 */
17 17
// Must include code to stop this file being access directly
18 18
/* -------------------------------------------------------- */
19
if(defined('WB_PATH') == false)
20
{
21
	// Stop this file being access directly
22
		die('<head><title>Access denied</title></head><body><h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2></body></html>');
19
// Must include code to stop this file being accessed directly
20
if(!defined('WB_URL')) {
21
	require_once(dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php');
22
	throw new IllegalFileException();
23 23
}
24 24
/* -------------------------------------------------------- */
25 25

  
26
$msg = '';
27
$sTable = TABLE_PREFIX.'mod_output_filter';
28
if(($sOldType = $database->getTableEngine($sTable))) {
29
	if(('myisam' != strtolower($sOldType))) {
30
		if(!$database->query('ALTER TABLE `'.$sTable.'` Engine = \'MyISAM\' ')) {
31
			$msg = $database->get_error();
26
	function mod_output_filter_upgrade($bDebug=false) {
27
		global $OK ,$FAIL;
28
		$database=WbDatabase::getInstance();
29
		$msg = array();
30
		$callingScript = $_SERVER["SCRIPT_NAME"];
31
		// check if upgrade startet by upgrade-script to echo a message
32
		$tmp = 'upgrade-script.php';
33
		$globalStarted = substr_compare($callingScript, $tmp,(0-strlen($tmp)),strlen($tmp)) === 0;
34
// check for missing tables, if true stop the upgrade
35
		$aTable = array('mod_output_filter');
36
		$aPackage = UpgradeHelper::existsAllTables($aTable);
37
		if( sizeof($aPackage) > 0){
38
			$msg[] =  'TABLE '.implode(' missing! '.$FAIL.'<br />TABLE ',$aPackage).' missing! '.$FAIL;
39
			$msg[] = 'Output_filter upgrade failed'." $FAIL";
40
			if($globalStarted) {
41
				echo '<strong>'.implode('<br />',$msg).'</strong><br />';
42
			}
43
			return ( ($globalStarted==true ) ? $globalStarted : $msg);
44
		} else {
45
			for($x=0; $x<sizeof($aTable);$x++) {
46
				if(($sOldType = $database->getTableEngine($database->TablePrefix.$aTable[$x]))) {
47
					if(('myisam' != strtolower($sOldType))) {
48
						if(!$database->query('ALTER TABLE `'.$database->TablePrefix.$aTable[$x].'` Engine = \'MyISAM\' ')) {
49
							$msg[] = $database->get_error();
50
						} else{
51
							$msg[] = 'TABLE `'.$database->TablePrefix.$aTable[$x].'` changed to Engine = \'MyISAM\''." $OK";
52
						}
53
					} else {
54
						$msg[] = 'TABLE `'.$database->TablePrefix.$aTable[$x].'` has Engine = \'MyISAM\''." $OK";
55
					}
56
				} else {
57
					$msg[] = $database->get_error();
58
				}
59
			}
60
			$table_name = $database->TablePrefix.'mod_output_filter';
61
			$field_name = 'sys_rel';
62
			$description = 'INT(11) NOT NULL DEFAULT \'0\' FIRST';
63
			if(!$database->field_exists($table_name,$field_name)) {
64
				$database->field_add($table_name, $field_name, $description);
65
				$msg[] = 'Add field `sys_rel` FIRST'." $OK";
66
			} else {
67
				$msg[] = 'Field `sys_rel` already exists'." $OK";
68
			}
69
// change table structure
70
			$sTable = $database->TablePrefix.'mod_output_filter';
71
			$sDescription = 'int(11) NOT NULL DEFAULT \'0\'';
72
			$sFieldName = 'sys_rel';
73
			if(!$database->field_modify($sTable,$sFieldName,$sDescription)) {
74
				$msg[] = ''.$database->get_error();
75
			} else {
76
				$msg[] = 'Field ( `sys_rel` ) description has been changed successfully'." $OK";
77
			}
78
			$sDescription = 'int(11) NOT NULL DEFAULT \'1\'';
79
			$sFieldName = 'email_filter';
80
			if(!$database->field_modify($sTable,$sFieldName,$sDescription)) {
81
				$msg[] = ''.$database->get_error();
82
			} else {
83
				$msg[] = 'Field ( `email_filter` ) description has been changed successfully'." $OK";
84
			}
85
			$sFieldName = 'mailto_filter';
86
			if(!$database->field_modify($sTable,$sFieldName,$sDescription)) {
87
				$msg[] = ''.$database->get_error();
88
			} else {
89
				$msg[] = 'Field ( `mailto_filter` ) description has been changed successfully'." $OK";
90
			}
91
// only for upgrade-script
92
			if($globalStarted) {
93
				if($bDebug) {
94
					echo '<strong>'.implode('<br />',$msg).'</strong><br />';
95
				}
96
			}
32 97
		}
98
		$msg[] = 'Output_filter upgrade successfull finished '." $OK";
99
		if($globalStarted) {
100
			echo "<strong>Output_filter upgrade successfull finished $OK</strong><br />";
101
		}
102
		return ( ($globalStarted==true ) ? $globalStarted : $msg);
33 103
	}
34
} else {
35
	$msg = $database->get_error();
104
// ------------------------------------
105

  
106
$bDebugModus = ((isset($bDebugModus)) ? $bDebugModus : false);
107
// Don't show the messages twice
108
if( is_array($msg = mod_output_filter_upgrade($bDebugModus)) ) {
109
	echo '<strong>'.implode('<br />',$msg).'</strong><br />';
36 110
}
37
// ------------------------------------global $i;
38
$table_name = TABLE_PREFIX .'mod_output_filter';
39
$field_name = 'sys_rel';
40
$i = (!isset($i) ? 1 : $i);
41
print "<div style=\"margin:1em auto;font-size:1.1em;\">";
42
print "<h4>Step $i: Updating Output Filter</h4>\n";
43
$i++;
44
$OK   = "<span class=\"ok\">OK</span>";
45
$FAIL = "<span class=\"error\">FAILED</span>";
46
if ( ($database->field_exists($table_name,$field_name) )) {
47
		print "<br /><strong>'Output Filter already updated'</strong> $OK<br />\n";
48
} else {
49
	$description = 'INT NOT NULL DEFAULT \'0\' FIRST';
50
	if( ($database->field_add($table_name,$field_name,$description )) ) {
51
		print "<br /><strong>Updating Output Filter</strong> $OK<br />\n";
52
	} else {
53
			print "<br /><strong>Updating Output Filter</strong> $FAIL<br />\n";
54
	}
55
}
56
print "</div>";

Also available in: Unified diff