Revision 1923
Added by darkviper over 11 years ago
branches/2.8.x/CHANGELOG | ||
---|---|---|
11 | 11 |
! = Update/Change |
12 | 12 |
=============================================================================== |
13 | 13 |
|
14 |
08 Jun-2013 Build 1923 Werner v.d.Decken(DarkViper) |
|
15 |
! syncronize project |
|
16 |
# some small corrections in /admin/ |
|
14 | 17 |
08 Jun-2013 Build 1922 Werner v.d.Decken(DarkViper) |
15 | 18 |
# fixed invalid translate addon activation (/admin/preferences/index.php) |
16 | 19 |
07 Jun-2013 Build 1921 Werner v.d.Decken(DarkViper) |
branches/2.8.x/wb/admin/groups/index.php | ||
---|---|---|
20 | 20 |
function admin_groups_index() |
21 | 21 |
{ |
22 | 22 |
$database = WbDatabase::getInstance(); |
23 |
// $mLang = ModLanguage::getInstance(); |
|
24 |
// $mLang->setLanguage(dirname(__FILE__).'/languages/', LANGUAGE, DEFAULT_LANGUAGE); |
|
25 | 23 |
$mLang = Translate::getinstance(); |
26 | 24 |
$mLang->enableAddon('admin\groups'); |
27 | 25 |
|
... | ... | |
127 | 125 |
} |
128 | 126 |
print $output; |
129 | 127 |
$admin->print_footer(); |
130 |
$mLang->disableAddon(); |
|
131 | 128 |
} |
132 | 129 |
// start dispatcher maintenance |
133 | 130 |
if(!defined('WB_PATH')) |
branches/2.8.x/wb/admin/templates/details.php | ||
---|---|---|
17 | 17 |
|
18 | 18 |
// Include the config file |
19 | 19 |
require('../../config.php'); |
20 |
$mLang = Translate::getinstance(); |
|
21 |
$mLang->enableAddon('admin\addons'); |
|
20 | 22 |
require_once(WB_PATH .'/framework/functions.php'); |
21 | 23 |
require_once(WB_PATH.'/framework/class.admin.php'); |
22 | 24 |
// suppress to print the header, so no new FTAN will be set |
... | ... | |
24 | 26 |
if( !$admin->checkFTAN() ) |
25 | 27 |
{ |
26 | 28 |
$admin->print_header(); |
27 |
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']);
|
|
29 |
$admin->print_error($mLang->MESSAGE_GENERIC_SECURITY_ACCESS);
|
|
28 | 30 |
} |
29 | 31 |
|
30 | 32 |
// After check print the header |
31 | 33 |
$admin->print_header(); |
32 | 34 |
// Get template name |
33 | 35 |
if(!isset($_POST['file']) OR $_POST['file'] == "") { |
34 |
$admin->print_error($MESSAGE['GENERIC_FORGOT_OPTIONS']);
|
|
36 |
$admin->print_error($mLang->MESSAGE_GENERIC_FORGOT_OPTIONS);
|
|
35 | 37 |
} else { |
36 | 38 |
$file = preg_replace('/[^a-z0-9_-]/i', "", $_POST['file']); // fix secunia 2010-92-2 |
37 | 39 |
} |
38 | 40 |
|
39 | 41 |
// Check if the template exists |
40 | 42 |
if(!is_dir(WB_PATH.'/templates/'.$file)) { |
41 |
$admin->print_error($MESSAGE['GENERIC_NOT_INSTALLED']);
|
|
43 |
$admin->print_error($mLang->MESSAGE_GENERIC_NOT_INSTALLED);
|
|
42 | 44 |
} |
43 | 45 |
|
44 | 46 |
// Check if the template exists |
45 | 47 |
if(!is_readable(WB_PATH.'/templates/'.$file)) { |
46 |
$admin->print_error($MESSAGE['ADMIN_INSUFFICIENT_PRIVELLIGES']);
|
|
48 |
$admin->print_error($mLang->MESSAGE_ADMIN_INSUFFICIENT_PRIVELLIGES);
|
|
47 | 49 |
} |
48 |
|
|
49 |
/* |
|
50 |
if(!isset($_POST['file']) OR $_POST['file'] == "") { |
|
51 |
header("Location: index.php"); |
|
52 |
exit(0); |
|
53 |
} else { |
|
54 |
$file = preg_replace('/[^a-z0-9_-]/i', "", $_POST['file']); // fix secunia 2010-92-2 |
|
55 |
} |
|
56 |
|
|
57 |
if(!file_exists(WB_PATH.'/templates/'.$file)) { |
|
58 |
header("Location: index.php"); |
|
59 |
exit(0); |
|
60 |
} |
|
61 |
// Check if the template exists |
|
62 |
if(!is_dir(WB_PATH.'/templates/'.$file)) { |
|
63 |
$admin->print_error($MESSAGE['GENERIC_NOT_INSTALLED']); |
|
64 |
} |
|
65 |
*/ |
|
66 |
|
|
67 | 50 |
// Print admin header |
68 | 51 |
//$admin = new admin('Addons', 'templates_view'); |
69 | 52 |
|
... | ... | |
109 | 92 |
'LICENSE' => $row['license'], |
110 | 93 |
) |
111 | 94 |
); |
112 |
|
|
113 |
//$mLang = ModLanguage::getInstance(); |
|
114 |
//$mLang->setLanguage(ADMIN_PATH.'/addons/languages/', LANGUAGE, DEFAULT_LANGUAGE); |
|
115 |
$mLang = Translate::getinstance(); |
|
116 |
$mLang->enableAddon('admin\addons'); |
|
117 |
|
|
118 | 95 |
/*-- insert all needed vars from language files ----------------------------------------*/ |
119 | 96 |
$template->set_var($mLang->getLangArray()); |
120 | 97 |
|
... | ... | |
122 | 99 |
// Parse template object |
123 | 100 |
$template->parse('main', 'main_block', false); |
124 | 101 |
$template->pparse('output', 'page'); |
125 |
|
|
126 | 102 |
// Print admin footer |
127 | 103 |
$admin->print_footer(); |
branches/2.8.x/wb/admin/templates/index.php | ||
---|---|---|
84 | 84 |
$template->parse('main', 'main_block', false); |
85 | 85 |
$template->pparse('output', 'page'); |
86 | 86 |
|
87 |
$mLang->disableAddon(); |
|
87 | 88 |
// Print admin footer |
88 | 89 |
$admin->print_footer(); |
branches/2.8.x/wb/admin/pages/settings.php | ||
---|---|---|
615 | 615 |
$oTpl->parse('main', 'main_block', false); |
616 | 616 |
$oTpl->pparse('output', 'page'); |
617 | 617 |
// Print admin footer |
618 |
$mLang->disableAddon(); |
|
618 | 619 |
$admin->print_footer(); |
619 | 620 |
|
620 | 621 |
function p($text,$lang) |
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', '1922');
|
|
54 |
if(!defined('REVISION')) define('REVISION', '1923');
|
|
55 | 55 |
if(!defined('SP')) define('SP', ''); |
branches/2.8.x/wb/admin/settings/index.php | ||
---|---|---|
996 | 996 |
$oTpl->pparse('output', 'page'); |
997 | 997 |
//$oTpl->p('page'); |
998 | 998 |
unset($oTpl); |
999 |
$mLang->disableAddon(); |
|
999 | 1000 |
$admin->print_footer(); |
branches/2.8.x/wb/admin/modules/details.php | ||
---|---|---|
17 | 17 |
|
18 | 18 |
// Include the config file |
19 | 19 |
require('../../config.php'); |
20 |
$mLang = Translate::getinstance(); |
|
21 |
$mLang->enableAddon('admin\addons'); |
|
20 | 22 |
require_once(WB_PATH .'/framework/functions.php'); |
21 | 23 |
require_once(WB_PATH.'/framework/class.admin.php'); |
22 | 24 |
// No print admin header |
... | ... | |
24 | 26 |
if( !$admin->checkFTAN() ) |
25 | 27 |
{ |
26 | 28 |
$admin->print_header(); |
27 |
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']);
|
|
29 |
$admin->print_error($mLang->MESSAGE_GENERIC_SECURITY_ACCESS);
|
|
28 | 30 |
} |
29 | 31 |
// After check print the header |
30 | 32 |
$admin->print_header(); |
31 | 33 |
|
32 |
//$mLang = ModLanguage::getInstance(); |
|
33 |
//$mLang->setLanguage(ADMIN_PATH.'/addons/languages/', LANGUAGE, DEFAULT_LANGUAGE); |
|
34 |
$mLang = Translate::getinstance(); |
|
35 |
$mLang->enableAddon('admin\addons'); |
|
36 |
|
|
37 | 34 |
if(!isset($_POST['file']) OR $_POST['file'] == "") { |
38 |
$admin->print_error($MESSAGE['GENERIC_FORGOT_OPTIONS']);
|
|
35 |
$admin->print_error($mLang->MESSAGE_GENERIC_FORGOT_OPTIONS);
|
|
39 | 36 |
} else { |
40 | 37 |
$file = preg_replace('/[^a-z0-9_-]/i', "", $_POST['file']); // fix secunia 2010-92-2 |
41 | 38 |
} |
42 | 39 |
|
43 | 40 |
// Check if the template exists |
44 | 41 |
if(!is_dir(WB_PATH.'/modules/'.$file)) { |
45 |
$admin->print_error($MESSAGE['GENERIC_NOT_INSTALLED']);
|
|
42 |
$admin->print_error($mLang->MESSAGE_GENERIC_NOT_INSTALLED);
|
|
46 | 43 |
} |
47 | 44 |
|
48 | 45 |
// Check if the template exists |
49 | 46 |
if(!is_readable(WB_PATH.'/modules/'.$file)) { |
50 |
$admin->print_error($MESSAGE['ADMIN_INSUFFICIENT_PRIVELLIGES']);
|
|
47 |
$admin->print_error($mLang->MESSAGE_ADMIN_INSUFFICIENT_PRIVELLIGES);
|
|
51 | 48 |
} |
52 |
|
|
53 |
/* |
|
54 |
// Get module name |
|
55 |
if(!isset($_POST['file']) OR $_POST['file'] == "") |
|
56 |
{ |
|
57 |
header("Location: index.php"); |
|
58 |
exit(0); |
|
59 |
} |
|
60 |
else |
|
61 |
{ |
|
62 |
$file = preg_replace('/[^a-z0-9_-]/i', "", $_POST['file']); // fix secunia 2010-92-1 |
|
63 |
} |
|
64 |
|
|
65 |
// Check if the module exists |
|
66 |
if(!is_readable(WB_PATH.'/modules/'.$file)) { |
|
67 |
header("Location: index.php"); |
|
68 |
exit(0); |
|
69 |
} |
|
70 |
*/ |
|
71 |
|
|
72 | 49 |
// Setup template object, parse vars to it, then parse it |
73 | 50 |
// Create new template object |
74 | 51 |
$template = new Template(dirname($admin->correct_theme_source('modules_details.htt')),'keep'); |
... | ... | |
77 | 54 |
$template->set_block('page', 'main_block', 'main'); |
78 | 55 |
|
79 | 56 |
// Insert values |
80 |
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND directory = '$file'"); |
|
81 |
if($result->numRows() > 0) { |
|
82 |
$module = $result->fetchRow(); |
|
57 |
$module = false; |
|
58 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'addons` ' |
|
59 |
. 'WHERE `type`=\'module\' AND `directory`=\''.$file.'\''; |
|
60 |
if( ($result = $database->query($sql)) ){ |
|
61 |
$module = $result->fetchRow(MYSQL_ASSOC); |
|
83 | 62 |
} |
84 |
|
|
63 |
if(!$module) { $admin->print_error($mLang->MESSAGE_GENERIC_NOT_INSTALLED); } |
|
85 | 64 |
/*-- insert all needed vars from language files ----------------------------------------*/ |
86 | 65 |
$template->set_var($mLang->getLangArray()); |
87 | 66 |
|
... | ... | |
147 | 126 |
// Parse module object |
148 | 127 |
$template->parse('main', 'main_block', false); |
149 | 128 |
$template->pparse('output', 'page'); |
150 |
|
|
151 | 129 |
// Print admin footer |
152 | 130 |
$admin->print_footer(); |
branches/2.8.x/wb/framework/class.wb.php | ||
---|---|---|
3 | 3 |
* |
4 | 4 |
* @category framework |
5 | 5 |
* @package frontend |
6 |
* @author Ryan Djurovich (2004-2009), WebsiteBaker Project |
|
7 |
* @copyright 2009-2013, WebsiteBaker Org. e.V. |
|
6 |
* @copyright WebsiteBaker Org. e.V. |
|
7 |
* @author Ryan Djurovich (2004-2009) |
|
8 |
* @author Dietmar Wöllbrink (luisehahne) |
|
9 |
* @author M.v.d.Decken (DarkViper) |
|
8 | 10 |
* @link http://www.websitebaker.org/ |
9 | 11 |
* @license http://www.gnu.org/licenses/gpl.html |
10 | 12 |
* @platform WebsiteBaker 2.8.x |
branches/2.8.x/wb/framework/UpgradeHelper.php | ||
---|---|---|
34 | 34 |
*/ |
35 | 35 |
class UpgradeHelper { |
36 | 36 |
|
37 |
public static function existsAllTables(array $aPackage) |
|
37 |
/** |
|
38 |
* Compare available tables against a list of tables |
|
39 |
* @param array list of needed table names without TablePrefix |
|
40 |
* @return array list of missing tables |
|
41 |
*/ |
|
42 |
public static function existsAllTables(array $aTablesList) |
|
38 | 43 |
{ |
39 |
$aPackage = array_flip($aPackage);
|
|
44 |
$aTablesList = array_flip($aTablesList);
|
|
40 | 45 |
$oDb = WbDatabase::getInstance(); |
41 | 46 |
$sPattern = addcslashes ( $oDb->TablePrefix, '%_' ); |
42 | 47 |
if(($oTables = $oDb->query( 'SHOW TABLES LIKE "'.$sPattern.'%"'))) { |
43 | 48 |
while($aTable = $oTables->fetchRow(MYSQL_NUM)) { |
44 | 49 |
$sTable = preg_replace('/^'.preg_quote($oDb->TablePrefix, '/').'/s', '', $aTable[0]); |
45 |
if(isset($aPackage[$sTable])) {
|
|
46 |
unset($aPackage[$sTable]);
|
|
50 |
if(isset($aTablesList[$sTable])) {
|
|
51 |
unset($aTablesList[$sTable]);
|
|
47 | 52 |
} |
48 | 53 |
} |
49 | 54 |
} |
50 |
return array_flip($aPackage);
|
|
55 |
return array_flip($aTablesList);
|
|
51 | 56 |
} |
52 | 57 |
|
53 | 58 |
|
Also available in: Unified diff
syncronize project and some small typo corrections in /admin/