commit | author | age
|
532ae5
|
1 |
<?php |
L |
2 |
|
|
3 |
/* |
|
4 |
Copyright (c) 2007, Till Brehm, projektfarm Gmbh |
|
5 |
All rights reserved. |
|
6 |
|
|
7 |
Redistribution and use in source and binary forms, with or without modification, |
|
8 |
are permitted provided that the following conditions are met: |
|
9 |
|
|
10 |
* Redistributions of source code must retain the above copyright notice, |
|
11 |
this list of conditions and the following disclaimer. |
|
12 |
* Redistributions in binary form must reproduce the above copyright notice, |
|
13 |
this list of conditions and the following disclaimer in the documentation |
|
14 |
and/or other materials provided with the distribution. |
|
15 |
* Neither the name of ISPConfig nor the names of its contributors |
|
16 |
may be used to endorse or promote products derived from this software without |
|
17 |
specific prior written permission. |
|
18 |
|
|
19 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
|
20 |
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
21 |
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
|
22 |
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, |
|
23 |
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
|
24 |
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|
25 |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
|
26 |
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
|
27 |
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
|
28 |
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
29 |
*/ |
|
30 |
|
b1a6a5
|
31 |
require_once '../lib/config.inc.php'; |
MC |
32 |
require_once '../lib/app.inc.php'; |
532ae5
|
33 |
|
b79c5b
|
34 |
// Check if we have an active users ession and redirect to login if thats not the case. |
TB |
35 |
if($_SESSION['s']['user']['active'] != 1) { |
|
36 |
header('Location: /login/'); |
|
37 |
die(); |
|
38 |
} |
|
39 |
|
|
40 |
if(!isset($_SESSION['s']['module']['name'])) $_SESSION['s']['module']['name'] = 'dashboard'; |
2a4acd
|
41 |
|
T |
42 |
$app->uses('tpl'); |
|
43 |
$app->tpl->newTemplate('main.tpl.htm'); |
b2ba0d
|
44 |
$app->tpl->setVar('startpage', isset($_SESSION['s']['module']['startpage']) ? $_SESSION['s']['module']['startpage'] : ''); |
d35b34
|
45 |
$app->tpl->setVar('logged_in', ($_SESSION['s']['user']['active'] != 1 ? 'n' : 'y')); |
532ae5
|
46 |
|
73ec6b
|
47 |
// tab change warning? |
M |
48 |
// read misc config |
|
49 |
$app->uses('getconf'); |
|
50 |
$sys_config = $app->getconf->get_global_config('misc'); |
|
51 |
if($sys_config['tab_change_warning'] == 'y') { |
b1a6a5
|
52 |
$app->tpl->setVar('tabchange_warning_enabled', 'y'); |
MC |
53 |
$app->tpl->setVar('global_tabchange_warning_txt', $app->lng('global_tabchange_warning_txt')); |
73ec6b
|
54 |
} else { |
b1a6a5
|
55 |
$app->tpl->setVar('tabchange_warning_enabled', 'n'); |
73ec6b
|
56 |
} |
M |
57 |
$app->tpl->setVar('tabchange_discard_enabled', $sys_config['tab_change_discard']); |
|
58 |
if($sys_config['tab_change_discard'] == 'y') { |
b1a6a5
|
59 |
$app->tpl->setVar('global_tabchange_discard_txt', $app->lng('global_tabchange_discard_txt')); |
73ec6b
|
60 |
} |
M |
61 |
|
9021d7
|
62 |
if($sys_config['use_loadindicator'] == 'y') { |
MC |
63 |
$app->tpl->setVar('use_loadindicator', 'y'); |
|
64 |
} |
|
65 |
if($sys_config['use_combobox'] == 'y') { |
|
66 |
$app->tpl->setVar('use_combobox', 'y'); |
|
67 |
} |
|
68 |
|
|
69 |
|
5715f5
|
70 |
if(isset($_SESSION['show_info_msg'])) { |
b1a6a5
|
71 |
$app->tpl->setVar('show_info_msg', $_SESSION['show_info_msg']); |
MC |
72 |
unset($_SESSION['show_info_msg']); |
5715f5
|
73 |
} |
M |
74 |
if(isset($_SESSION['show_error_msg'])) { |
b1a6a5
|
75 |
$app->tpl->setVar('show_error_msg', $_SESSION['show_error_msg']); |
MC |
76 |
unset($_SESSION['show_error_msg']); |
5715f5
|
77 |
} |
M |
78 |
|
e372dd
|
79 |
// read js.d files |
M |
80 |
$js_d = ISPC_WEB_PATH . '/js/js.d'; |
|
81 |
$js_d_files = array(); |
|
82 |
if(@is_dir($js_d)) { |
b1a6a5
|
83 |
$dir = opendir($js_d); |
MC |
84 |
while($file = readdir($dir)) { |
|
85 |
$filename = $js_d . '/' . $file; |
|
86 |
if($file === '.' || $file === '..' || !is_file($filename)) continue; |
|
87 |
if(substr($file, -3) !== '.js') continue; |
|
88 |
$js_d_files[] = array('file' => $file); |
|
89 |
} |
|
90 |
closedir($dir); |
e372dd
|
91 |
} |
M |
92 |
|
8a9345
|
93 |
if (!empty($js_d_files)) $app->tpl->setLoop('js_d_includes', $js_d_files); |
e372dd
|
94 |
unset($js_d_files); |
5715f5
|
95 |
|
01cec5
|
96 |
$app->tpl->setVar('current_theme', isset($_SESSION['s']['theme']) ? $_SESSION['s']['theme'] : 'default'); |
MC |
97 |
|
61f1f5
|
98 |
// Logo |
MC |
99 |
$logo = $app->db->queryOneRecord("SELECT * FROM sys_ini WHERE sysini_id = 1"); |
|
100 |
if($logo['custom_logo'] != ''){ |
|
101 |
$base64_logo_txt = $logo['custom_logo']; |
|
102 |
} else { |
|
103 |
$base64_logo_txt = $logo['default_logo']; |
|
104 |
} |
|
105 |
$tmp_base64 = explode(',', $base64_logo_txt, 2); |
|
106 |
$logo_dimensions = $app->functions->getimagesizefromstring(base64_decode($tmp_base64[1])); |
64466c
|
107 |
$app->tpl->setVar('base64_logo_width', $logo_dimensions[0].'px'); |
MC |
108 |
$app->tpl->setVar('base64_logo_height', $logo_dimensions[1].'px'); |
61f1f5
|
109 |
$app->tpl->setVar('base64_logo_txt', $base64_logo_txt); |
MC |
110 |
|
18bf6c
|
111 |
// Title |
8f5b51
|
112 |
$app->tpl->setVar('company_name', $sys_config['company_name']. ' :: '); |
18bf6c
|
113 |
|
532ae5
|
114 |
$app->tpl_defaults(); |
L |
115 |
$app->tpl->pparse(); |
b1a6a5
|
116 |
?> |