Project

General

Profile

1
<?php
2

    
3
// $Id: details.php 1457 2011-06-25 17:18:50Z Luisehahne $
4

    
5
/*
6

    
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2009, 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
// Include the config code
27
require('../../config.php');
28

    
29
// Print admin header
30
require_once(WB_PATH.'/framework/class.admin.php');
31
$admin = new admin('Addons', 'languages_view', false);
32
if( !$admin->checkFTAN() )
33
{
34
	$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']);
35
}
36
// After check print the header
37
$admin->print_header();
38

    
39
// Get language name
40
if(!isset($_POST['code']) OR $_POST['code'] == "") {
41
	$code = '';
42
} else {
43
	$code = $_POST['code'];
44
}
45

    
46
// fix secunia 2010-93-2
47
if (!preg_match('/^[A-Z]{2}$/', $code)) {
48
	header("Location: index.php");
49
	exit(0);
50
}
51

    
52
// Check if the language exists
53
if(!file_exists(WB_PATH.'/languages/'.$code.'.php')) {
54
	header("Location: index.php");
55
	exit(0);
56
}
57

    
58
// Setup language object
59
$template = new Template(THEME_PATH.'/templates');
60
$template->set_file('page', 'languages_details.htt');
61
$template->set_block('page', 'main_block', 'main');
62

    
63
// Insert values
64
require(WB_PATH.'/languages/'.$code.'.php');
65
$template->set_var(array(
66
								'CODE' => $language_code,
67
								'NAME' => $language_name,
68
								'AUTHOR' => $language_author,
69
								'VERSION' => $language_version,
70
								'DESIGNED_FOR' => $language_platform,
71
								'ADMIN_URL' => ADMIN_URL,
72
								'WB_URL' => WB_URL,
73
								'THEME_URL' => THEME_URL
74
								)
75
						);
76

    
77
// Restore language to original code
78
require(WB_PATH.'/languages/'.LANGUAGE.'.php');
79

    
80
// Insert language headings
81
$template->set_var(array(
82
								'HEADING_LANGUAGE_DETAILS' => $HEADING['LANGUAGE_DETAILS']
83
								)
84
						);
85
// Insert language text and messages
86
$template->set_var(array(
87
								'TEXT_CODE' => $TEXT['CODE'],
88
								'TEXT_NAME' => $TEXT['NAME'],
89
								'TEXT_TYPE' => $TEXT['TYPE'],
90
								'TEXT_AUTHOR' => $TEXT['AUTHOR'],
91
								'TEXT_VERSION' => $TEXT['VERSION'],
92
								'TEXT_DESIGNED_FOR' => $TEXT['DESIGNED_FOR'],
93
								'TEXT_BACK' => $TEXT['BACK']
94
								)
95
						);
96

    
97
// Parse language object
98
$template->parse('main', 'main_block', false);
99
$template->pparse('output', 'page');
100

    
101
// Print admin footer
102
$admin->print_footer();
103

    
104
?>
(1-1/4)