/
info.inc
210 lines (192 loc) · 7.96 KB
/
info.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<?php
/**
* @var ThemeIcons $icons
* @var ConfigData $configData
* @var callable $_getvar
* @var Template $this
*/
?>
<div id="title" class="titleNormal">
<i class="material-icons">info</i>
<?php use SP\Config\ConfigData;
use SP\Core\UI\ThemeIcons;
use SP\Html\Html;
use SP\Mvc\View\Template;
use SP\Plugin\PluginInterface;
use SP\Services\Install\Installer;
use SP\Util\VersionUtil;
echo __('Application Information'); ?>
</div>
<table class="data">
<tr>
<td class="descField">
<?php echo __('sysPass version'); ?>
</td>
<td class="valField">
<div class="lowres-title"><?php echo __('sysPass version'); ?></div>
<?php printf('%s (%s)', Installer::VERSION_TEXT, Html::strongText(VersionUtil::getVersionStringNormalized())); ?>
<br>
<?php printf('Config: %s', $configData->getConfigVersion()); ?>
<br>
<?php printf('App: %s', $configData->getAppVersion()); ?>
<br>
<?php printf('DB: %s', $configData->getDatabaseVersion()); ?>
</td>
</tr>
<tr>
<td class="descField">
<?php echo __('Database'); ?>
</td>
<td class="valField">
<div class="lowres-title"><?php echo __('Database'); ?></div>
<?php foreach ($_getvar('dbInfo') as $infoattr => $infoval): ?>
<?php printf('%s : %s', Html::strongText($infoattr), $infoval); ?>
<br>
<?php endforeach; ?>
<?php printf('%s: %s', Html::strongText(__('Name')), (!$_getvar('isDemo')) ? $_getvar('dbName') : '***'); ?>
</td>
</tr>
<tr>
<td class="descField">
<?php echo __('PHP'); ?>
</td>
<td class="valField">
<div class="lowres-title"><?php echo __('PHP'); ?></div>
<?php printf('%s: %s', Html::strongText(__('Version')), PHP_VERSION); ?>
<br>
<?php printf('%s: %s', Html::strongText(__('Extensions')), implode(', ', get_loaded_extensions())); ?>
<br>
<?php
if (!empty($_getvar('missingExtensions'))) {
printf('%s: %s', Html::strongText(__('Unavailable extensions')), implode(', ', $_getvar('missingExtensions')));
echo '<br>';
}
?>
<?php printf('%s: %d KB', Html::strongText(__('Used Memory')), (memory_get_usage(true) / 1024)); ?>
<br>
<?php printf('%s: %s', Html::strongText(__('User')), (!$_getvar('isDemo')) ? get_current_user() : '***'); ?>
<br>
<?php printf('%s: %d MB/s', Html::strongText(__('Download rate')), $_getvar('downloadRate')); ?>
<?php if (function_exists('opcache_get_status') && PHP_VERSION_ID >= 50600): ?>
<br>
<?php echo Html::strongText(__('OP Cache')); ?>
<?php foreach (opcache_get_status(false)['opcache_statistics'] as $key => $value): ?>
<br><?php printf('%s : %s', $key, $value); ?>
<?php endforeach; ?>
<?php endif; ?>
</td>
</tr>
<tr>
<td class="descField">
<?php echo __('Server'); ?>
</td>
<td class="valField">
<div class="lowres-title"><?php echo __('Server'); ?></div>
<?php echo (!$_getvar('isDemo')) ? Html::strongText($_SERVER['SERVER_SOFTWARE']) : '***'; ?>
</td>
</tr>
<tr>
<td class="descField">
<?php echo __('Configuration Backup'); ?>
</td>
<td class="valField">
<div class="lowres-title"><?php echo __('Configuration Backup'); ?></div>
<?php echo $_getvar('configBackupDate'); ?>
<?php if ($_getvar('downloadLog')): ?>
<div>
<a href="<?php echo $_getRoute('configGeneral/downloadConfigBackup/json'); ?>"
class="download" target="_blank">
<button type="button" class="mdl-button mdl-js-button">
<?php printf(__('Download %s'), 'JSON'); ?>
</button>
</a>
</div>
<?php endif; ?>
</td>
</tr>
<tr>
<td class="descField">
<?php echo __('Language'); ?>
<div id="help-infolang"
class="icon material-icons <?php echo $icons->getIconHelp()->getClass(); ?>"><?php echo $icons->getIconHelp()->getIcon(); ?></div>
<div class="mdl-tooltip mdl-tooltip--large" for="help-infolang">
<p>
<?php echo __('Tells whether the language is available or not.'); ?>
</p>
<p>
<?php echo __('If it is not installed, you would need install the right operating system locales. More info at Wiki.'); ?>
</p>
</div>
</td>
<td class="valField">
<div class="lowres-title"><?php echo __('Language'); ?></div>
<?php echo $_getvar('locale'); ?>
</td>
</tr>
<tr>
<td class="descField">
<?php echo __('Encrypted Session'); ?>
<div id="help-infosession"
class="icon material-icons <?php echo $icons->getIconHelp()->getClass(); ?>"><?php echo $icons->getIconHelp()->getIcon(); ?></div>
<div class="mdl-tooltip mdl-tooltip--large" for="help-infosession">
<p>
<?php echo __('Tells whether the session data are encrypted in the server side or not'); ?>
</p>
</div>
</td>
<td class="valField">
<div class="lowres-title"><?php echo __('Encrypted Session'); ?></div>
<?php echo $_getvar('securedSession') ? __('Yes') : __('No'); ?>
</td>
</tr>
<tr>
<td class="descField">
<?php echo __('Loaded Plugins'); ?>
</td>
<td class="valField">
<div class="lowres-title"><?php echo __('Loaded Plugins'); ?></div>
<ul class="mdl-list">
<?php /** @var PluginInterface $plugin */
foreach ($_getvar('plugins') as $name => $plugin): ?>
<li class="mdl-list__item">
<span class="mdl-list__item-primary-content">
<i class="material-icons mdl-list__item-icon">extension</i>
<?php echo $name; ?>
<br>
<?php printf('Version: %s', implode('.', $plugin->getVersion())); ?>
<br>
<?php printf('Autor: %s', $plugin->getAuthor()); ?>
</span>
</li>
<?php endforeach; ?>
</ul>
</td>
</tr>
<?php if ($_getvar('downloadLog')): ?>
<tr>
<td class="descField">
<?php echo __('Log file'); ?>
</td>
<td class="valField">
<div class="lowres-title"><?php echo __('Log file'); ?></div>
<a href="<?php echo $_getRoute('configGeneral/downloadLog'); ?>"
class="download" target="_blank">
<button type="button" class="mdl-button mdl-js-button">
<?php printf(__('Download %s'), basename(LOG_FILE)); ?>
</button>
</a>
</td>
</tr>
<?php endif; ?>
</table>
<div class="tab-actions">
<ul>
<li>
<button id="btnBack" type="button"
class="btn-back mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab mdl-button--colored <?php echo $icons->getIconBack()->getClassButton(); ?>"
title="<?php echo __('Back'); ?>">
<i class="material-icons"><?php echo $icons->getIconBack()->getIcon(); ?></i>
</button>
</li>
</ul>
</div>