Issues (752)

server/includes/templates/webclient.php (1 issue)

Labels
Severity
1
<?php
2
include BASE_PATH . 'server/includes/loader.php';
3
include BASE_PATH . 'server/includes/templates/serverinfo.php';
4
5
$loader = new FileLoader();
6
7
$versionInfo['webapp'] = $loader->getVersion();
8
$serverConfig = array_merge($serverConfig, [
9
	'base_url' => BASE_URL,
10
	'webapp_title' => $webappTitle,
11
	'using_sso' => false,
12
	'disable_full_gab' => !ENABLE_FULL_GAB,
13
	'plugin_webappmanual_url' => PLUGIN_WEBAPPMANUAL_URL,
14
	'enable_shared_rules' => ENABLE_SHARED_RULES,
15
	'always_enabled_plugins' => $GLOBALS['PluginManager']->expandPluginList(ALWAYS_ENABLED_PLUGINS_LIST),
16
	'enable_advanced_settings' => ENABLE_ADVANCED_SETTINGS ? true : false,
17
	'post_max_size' => getMaxPostRequestSize(),
18
	'max_file_uploads' => getMaxFileUploads(),
19
	'client_timeout' => defined('CLIENT_TIMEOUT') && is_numeric(CLIENT_TIMEOUT) && CLIENT_TIMEOUT > 0 ? CLIENT_TIMEOUT : false,
20
	'active_theme' => Theming::getActiveTheme(),
21
	'icons_primary_color' => Theming::getPrimaryIconColor(),
22
	'icons_secondary_color' => Theming::getSecondaryIconColor(),
23
	'json_themes' => Theming::getJsonThemes(),
24
	'iconsets' => Iconsets::getIconsets(),
25
	'active_iconset' => Iconsets::getActiveIconset(),
26
	'iconsets_about' => Iconsets::getAboutTexts(),
27
	'version_info' => $GLOBALS['PluginManager']->getPluginsVersion(),
28
	'is_vcfimport_supported' => function_exists('mapi_vcftomapi'),
29
	'is_icsimport_supported' => function_exists('mapi_mapitoical'),
30
	'color_schemes' => json_decode(COLOR_SCHEMES),
31
	'default_categories' => json_decode(DEFAULT_CATEGORIES),
32
	'maximum_eml_files_in_zip' => MAX_EML_FILES_IN_ZIP,
33
	'powerpaste' => [
34
		'powerpaste_word_import' => POWERPASTE_WORD_IMPORT,
35
		'powerpaste_html_import' => POWERPASTE_HTML_IMPORT,
36
		'powerpaste_allow_local_images' => POWERPASTE_ALLOW_LOCAL_IMAGES,
37
	],
38
	'shared_store_polling_interval' => SHARED_STORE_POLLING_INTERVAL,
39
	'prefetch_email_count' => PREFETCH_EMAIL_COUNT,
40
	'prefetch_email_interval' => PREFETCH_EMAIL_INTERVAL,
41
	'enable_dompurify' => ENABLE_DOMPURIFY_FILTER,
42
	'enable_file_previewer' => ENABLE_FILE_PREVIEWER,
43
	'enable_themes' => ENABLE_THEMES,
44
	'enable_iconsets' => ENABLE_ICONSETS,
45
	'enable_widgets' => ENABLE_WIDGETS,
46
]);
47
if (CONTACT_PREFIX) {
48
	$serverConfig['contact_prefix'] = json_decode(CONTACT_PREFIX);
0 ignored issues
show
CONTACT_PREFIX of type false is incompatible with the type string expected by parameter $json of json_decode(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

48
	$serverConfig['contact_prefix'] = json_decode(/** @scrutinizer ignore-type */ CONTACT_PREFIX);
Loading history...
49
}
50
if (CONTACT_SUFFIX) {
51
	$serverConfig['contact_suffix'] = json_decode(CONTACT_SUFFIX);
52
}
53
if (defined('ADDITIONAL_COLOR_SCHEMES')) {
54
	$serverConfig['additional_color_schemes'] = json_decode((string) ADDITIONAL_COLOR_SCHEMES);
55
}
56
if (defined('ADDITIONAL_CATEGORIES')) {
57
	$serverConfig['additional_default_categories'] = json_decode((string) ADDITIONAL_CATEGORIES);
58
}
59
?>
60
<!DOCTYPE html>
61
<html>
62
63
	<head>
64
		<meta name="Generator" content="grommunio-web v<?php echo $loader->getVersion(); ?>">
65
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
66
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
67
		<title><?php echo $webappTitle; ?></title>
68
		<link rel="icon" href="<?php echo $favicon; ?>" type="image/x-icon">
69
		<link rel="shortcut icon" href="<?php echo $favicon; ?>" type="image/x-icon">
70
71
		<script><?php require BASE_PATH . 'client/fingerprint.js'; ?></script>
72
73
		<!-- load the login css first as we need it immediately! -->
74
		<link rel="stylesheet" href="client/resources/css/external/login.css" >
75
		<?php
76
			$loader->cssOrder();
77
echo Theming::getStyles($theme);
78
$iconsetStylesheet = Iconsets::getActiveStylesheet();
79
?>
80
		<link id="grommunio-iconset-stylesheet" rel="stylesheet" href="<?php echo $iconsetStylesheet; ?>" >
81
	</head>
82
83
	<body class="zarafa-webclient theme-<?php echo strtolower((string) $theme ?: 'basic');
84
echo ' ' . $hideFavorites;
85
echo ' ' . $scrollFavorites;
86
echo ' ' . $unreadBorders; ?>">
87
		<div id="loading-mask">
88
			<div id="form-container" class="loading" style="visibility: hidden;">
89
				<div id="bg"></div>
90
				<div id="content">
91
					<div class="left">
92
						<div id="logo"></div>
93
					</div>
94
					<div class="right">
95
					</div>
96
				</div>
97
			</div>
98
		</div>
99
100
		<!-- Translations -->
101
		<script src="index.php?version=<?php echo $loader->getVersion(); ?>&load=translations.js&lang=<?php echo $Language->getSelected(); ?>"></script>
102
		<!-- JS Files -->
103
		<?php
104
		$loader->jsOrder();
105
// get URL data from session and dump it for client to use
106
$urlActionData = [];
107
if (!empty($_SESSION['url_action'])) {
108
	$urlActionData = $_SESSION['url_action'];
109
110
	// remove data from session so if user reloads webapp then we will again not execute url action
111
	unset($_SESSION['url_action']);
112
}
113
?>
114
115
		<script><?php require BASE_PATH . 'client/resize.js'; ?></script>
116
		<script>
117
			settings 		= <?php echo $GLOBALS["settings"]->getJSON(); ?>;
118
			persistentsettings      = <?php echo $GLOBALS["settings"]->getPersistentSettingsJSON(); ?>;
119
			languages 		= <?php echo $Language->getJSON(); ?>;
120
			user 			= <?php echo json_encode($GLOBALS['mapisession']->getUserInfo()); ?>;
121
			version 		= <?php echo json_encode($versionInfo); ?>;
122
			serverconfig 		= <?php echo json_encode($serverConfig); ?>;
123
			urlActionData 		= <?php echo json_encode($urlActionData); ?>;
124
125
			Ext.onReady(Zarafa.loadWebclient, Zarafa);
126
		</script>
127
	</body>
128
</html>
129