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 |
|
2a4acd
|
34 |
if(!isset($_SESSION['s']['module']['name'])) $_SESSION['s']['module']['name'] = 'login'; |
T |
35 |
|
|
36 |
$app->uses('tpl'); |
|
37 |
$app->tpl->newTemplate('main.tpl.htm'); |
d35b34
|
38 |
$app->tpl->setVar('logged_in', ($_SESSION['s']['user']['active'] != 1 ? 'n' : 'y')); |
532ae5
|
39 |
|
73ec6b
|
40 |
// tab change warning? |
M |
41 |
// read misc config |
|
42 |
$app->uses('getconf'); |
|
43 |
$sys_config = $app->getconf->get_global_config('misc'); |
|
44 |
if($sys_config['tab_change_warning'] == 'y') { |
b1a6a5
|
45 |
$app->tpl->setVar('tabchange_warning_enabled', 'y'); |
MC |
46 |
$app->tpl->setVar('global_tabchange_warning_txt', $app->lng('global_tabchange_warning_txt')); |
73ec6b
|
47 |
} else { |
b1a6a5
|
48 |
$app->tpl->setVar('tabchange_warning_enabled', 'n'); |
73ec6b
|
49 |
} |
M |
50 |
$app->tpl->setVar('tabchange_discard_enabled', $sys_config['tab_change_discard']); |
|
51 |
if($sys_config['tab_change_discard'] == 'y') { |
b1a6a5
|
52 |
$app->tpl->setVar('global_tabchange_discard_txt', $app->lng('global_tabchange_discard_txt')); |
73ec6b
|
53 |
} |
M |
54 |
|
9021d7
|
55 |
if($sys_config['use_loadindicator'] == 'y') { |
MC |
56 |
$app->tpl->setVar('use_loadindicator', 'y'); |
|
57 |
} |
|
58 |
if($sys_config['use_combobox'] == 'y') { |
|
59 |
$app->tpl->setVar('use_combobox', 'y'); |
|
60 |
} |
|
61 |
|
|
62 |
|
5715f5
|
63 |
if(isset($_SESSION['show_info_msg'])) { |
b1a6a5
|
64 |
$app->tpl->setVar('show_info_msg', $_SESSION['show_info_msg']); |
MC |
65 |
unset($_SESSION['show_info_msg']); |
5715f5
|
66 |
} |
M |
67 |
if(isset($_SESSION['show_error_msg'])) { |
b1a6a5
|
68 |
$app->tpl->setVar('show_error_msg', $_SESSION['show_error_msg']); |
MC |
69 |
unset($_SESSION['show_error_msg']); |
5715f5
|
70 |
} |
M |
71 |
|
e372dd
|
72 |
// read js.d files |
M |
73 |
$js_d = ISPC_WEB_PATH . '/js/js.d'; |
|
74 |
$js_d_files = array(); |
|
75 |
if(@is_dir($js_d)) { |
b1a6a5
|
76 |
$dir = opendir($js_d); |
MC |
77 |
while($file = readdir($dir)) { |
|
78 |
$filename = $js_d . '/' . $file; |
|
79 |
if($file === '.' || $file === '..' || !is_file($filename)) continue; |
|
80 |
if(substr($file, -3) !== '.js') continue; |
|
81 |
$js_d_files[] = array('file' => $file); |
|
82 |
} |
|
83 |
closedir($dir); |
e372dd
|
84 |
} |
M |
85 |
|
8a9345
|
86 |
if (!empty($js_d_files)) $app->tpl->setLoop('js_d_includes', $js_d_files); |
e372dd
|
87 |
unset($js_d_files); |
5715f5
|
88 |
|
01cec5
|
89 |
$app->tpl->setVar('current_theme', isset($_SESSION['s']['theme']) ? $_SESSION['s']['theme'] : 'default'); |
MC |
90 |
|
61f1f5
|
91 |
// Logo |
MC |
92 |
$logo = $app->db->queryOneRecord("SELECT * FROM sys_ini WHERE sysini_id = 1"); |
|
93 |
if($logo['custom_logo'] != ''){ |
|
94 |
$base64_logo_txt = $logo['custom_logo']; |
|
95 |
} else { |
|
96 |
$base64_logo_txt = $logo['default_logo']; |
|
97 |
} |
|
98 |
$tmp_base64 = explode(',', $base64_logo_txt, 2); |
|
99 |
$logo_dimensions = $app->functions->getimagesizefromstring(base64_decode($tmp_base64[1])); |
64466c
|
100 |
$app->tpl->setVar('base64_logo_width', $logo_dimensions[0].'px'); |
MC |
101 |
$app->tpl->setVar('base64_logo_height', $logo_dimensions[1].'px'); |
61f1f5
|
102 |
$app->tpl->setVar('base64_logo_txt', $base64_logo_txt); |
MC |
103 |
|
18bf6c
|
104 |
// Title |
8f5b51
|
105 |
$app->tpl->setVar('company_name', $sys_config['company_name']. ' :: '); |
18bf6c
|
106 |
|
532ae5
|
107 |
$app->tpl_defaults(); |
L |
108 |
$app->tpl->pparse(); |
b1a6a5
|
109 |
?> |