Completed
Push — 1.7 ( ae6d99...a09cef )
by
unknown
08:06
created

admin.php (4 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 28 and the first side effect is on line 23.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * webtrees: online genealogy
4
 * Copyright (C) 2017 webtrees development team
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
 * GNU General Public License for more details.
13
 * You should have received a copy of the GNU General Public License
14
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15
 */
16
namespace Fisharebest\Webtrees;
17
18
/**
19
 * Defined in session.php
20
 *
21
 * @global Tree $WT_TREE
22
 */
23
global $WT_TREE;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
24
25
use Fisharebest\Webtrees\Controller\PageController;
26
use Fisharebest\Webtrees\Functions\Functions;
27
28
define('WT_SCRIPT_NAME', 'admin.php');
29
30
require './includes/session.php';
31
32
// This is a list of old files and directories, from earlier versions of webtrees, that can be deleted.
33
// It was generated with the help of a command like this:
34
// git diff 1.6.0..master --name-status | grep ^D
35
$old_files = array(
36
	// Removed in 1.0.2
37
	WT_ROOT . 'language/en.mo',
38
	// Removed in 1.0.3
39
	WT_ROOT . 'themechange.php',
40
	// Removed in 1.0.4
41
	// Removed in 1.0.5
42
	// Removed in 1.0.6
43
	WT_ROOT . 'includes/extras',
44
	// Removed in 1.1.0
45
	WT_ROOT . 'addremotelink.php',
46
	WT_ROOT . 'addsearchlink.php',
47
	WT_ROOT . 'client.php',
48
	WT_ROOT . 'dir_editor.php',
49
	WT_ROOT . 'editconfig_gedcom.php',
50
	WT_ROOT . 'editgedcoms.php',
51
	WT_ROOT . 'edit_merge.php',
52
	WT_ROOT . 'genservice.php',
53
	WT_ROOT . 'includes/classes',
54
	WT_ROOT . 'includes/controllers',
55
	WT_ROOT . 'includes/family_nav.php',
56
	WT_ROOT . 'logs.php',
57
	WT_ROOT . 'manageservers.php',
58
	WT_ROOT . 'media.php',
59
	WT_ROOT . 'module_admin.php',
60
	//WT_ROOT.'modules', // Do not delete - users may have stored custom modules/data here
61
	WT_ROOT . 'opensearch.php',
62
	WT_ROOT . 'PEAR.php',
63
	WT_ROOT . 'pgv_to_wt.php',
64
	WT_ROOT . 'places',
65
	//WT_ROOT.'robots.txt', // Do not delete this - it may contain user data
66
	WT_ROOT . 'serviceClientTest.php',
67
	WT_ROOT . 'siteconfig.php',
68
	WT_ROOT . 'SOAP',
69
	WT_ROOT . 'themes/clouds/mozilla.css',
70
	WT_ROOT . 'themes/clouds/netscape.css',
71
	WT_ROOT . 'themes/colors/mozilla.css',
72
	WT_ROOT . 'themes/colors/netscape.css',
73
	WT_ROOT . 'themes/fab/mozilla.css',
74
	WT_ROOT . 'themes/fab/netscape.css',
75
	WT_ROOT . 'themes/minimal/mozilla.css',
76
	WT_ROOT . 'themes/minimal/netscape.css',
77
	WT_ROOT . 'themes/webtrees/mozilla.css',
78
	WT_ROOT . 'themes/webtrees/netscape.css',
79
	WT_ROOT . 'themes/webtrees/style_rtl.css',
80
	WT_ROOT . 'themes/xenea/mozilla.css',
81
	WT_ROOT . 'themes/xenea/netscape.css',
82
	WT_ROOT . 'uploadmedia.php',
83
	WT_ROOT . 'useradmin.php',
84
	WT_ROOT . 'webservice',
85
	WT_ROOT . 'wtinfo.php',
86
	// Removed in 1.1.1
87
	// Removed in 1.1.2
88
	WT_ROOT . 'treenav.php',
89
	// Removed in 1.2.0
90
	WT_ROOT . 'themes/clouds/jquery',
91
	WT_ROOT . 'themes/colors/jquery',
92
	WT_ROOT . 'themes/fab/jquery',
93
	WT_ROOT . 'themes/minimal/jquery',
94
	WT_ROOT . 'themes/webtrees/jquery',
95
	WT_ROOT . 'themes/xenea/jquery',
96
	// Removed in 1.2.1
97
	// Removed in 1.2.2
98
	WT_ROOT . 'themes/clouds/chrome.css',
99
	WT_ROOT . 'themes/clouds/opera.css',
100
	WT_ROOT . 'themes/clouds/print.css',
101
	WT_ROOT . 'themes/clouds/style_rtl.css',
102
	WT_ROOT . 'themes/colors/chrome.css',
103
	WT_ROOT . 'themes/colors/opera.css',
104
	WT_ROOT . 'themes/colors/print.css',
105
	WT_ROOT . 'themes/colors/style_rtl.css',
106
	WT_ROOT . 'themes/fab/chrome.css',
107
	WT_ROOT . 'themes/fab/opera.css',
108
	WT_ROOT . 'themes/minimal/chrome.css',
109
	WT_ROOT . 'themes/minimal/opera.css',
110
	WT_ROOT . 'themes/minimal/print.css',
111
	WT_ROOT . 'themes/minimal/style_rtl.css',
112
	WT_ROOT . 'themes/xenea/chrome.css',
113
	WT_ROOT . 'themes/xenea/opera.css',
114
	WT_ROOT . 'themes/xenea/print.css',
115
	WT_ROOT . 'themes/xenea/style_rtl.css',
116
	// Removed in 1.2.3
117
	//WT_ROOT.'modules_v2', // Do not delete - users may have stored custom modules/data here
118
	// Removed in 1.2.4
119
	WT_ROOT . 'includes/cssparser.inc.php',
120
	WT_ROOT . 'modules_v3/gedcom_favorites/help_text.php',
121
	WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_3_find.php',
122
	WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_3_search_add.php',
123
	WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_5_input.js',
124
	WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_5_input.php',
125
	WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php',
126
	WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_query_1a.php',
127
	WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_query_2a.php',
128
	WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_query_3a.php',
129
	WT_ROOT . 'modules_v3/lightbox/css/album_page_RTL2.css',
130
	WT_ROOT . 'modules_v3/lightbox/css/album_page_RTL.css',
131
	WT_ROOT . 'modules_v3/lightbox/css/album_page_RTL_ff.css',
132
	WT_ROOT . 'modules_v3/lightbox/css/clearbox_music.css',
133
	WT_ROOT . 'modules_v3/lightbox/css/clearbox_music_RTL.css',
134
	WT_ROOT . 'modules_v3/user_favorites/db_schema',
135
	WT_ROOT . 'modules_v3/user_favorites/help_text.php',
136
	WT_ROOT . 'search_engine.php',
137
	WT_ROOT . 'themes/clouds/modules.css',
138
	WT_ROOT . 'themes/colors/modules.css',
139
	WT_ROOT . 'themes/fab/modules.css',
140
	WT_ROOT . 'themes/minimal/modules.css',
141
	WT_ROOT . 'themes/webtrees/modules.css',
142
	WT_ROOT . 'themes/xenea/modules.css',
143
	// Removed in 1.2.5
144
	WT_ROOT . 'includes/media_reorder_count.php',
145
	WT_ROOT . 'includes/media_tab_head.php',
146
	WT_ROOT . 'modules_v3/clippings/index.php',
147
	WT_ROOT . 'modules_v3/googlemap/css/googlemap_style.css',
148
	WT_ROOT . 'modules_v3/googlemap/css/wt_v3_places_edit.css',
149
	WT_ROOT . 'modules_v3/googlemap/index.php',
150
	WT_ROOT . 'modules_v3/lightbox/index.php',
151
	WT_ROOT . 'modules_v3/recent_changes/help_text.php',
152
	WT_ROOT . 'modules_v3/todays_events/help_text.php',
153
	WT_ROOT . 'sidebar.php',
154
	// Removed in 1.2.6
155
	WT_ROOT . 'modules_v3/sitemap/admin_index.php',
156
	WT_ROOT . 'modules_v3/sitemap/help_text.php',
157
	WT_ROOT . 'modules_v3/tree/css/styles',
158
	WT_ROOT . 'modules_v3/tree/css/treebottom.gif',
159
	WT_ROOT . 'modules_v3/tree/css/treebottomleft.gif',
160
	WT_ROOT . 'modules_v3/tree/css/treebottomright.gif',
161
	WT_ROOT . 'modules_v3/tree/css/tree.jpg',
162
	WT_ROOT . 'modules_v3/tree/css/treeleft.gif',
163
	WT_ROOT . 'modules_v3/tree/css/treeright.gif',
164
	WT_ROOT . 'modules_v3/tree/css/treetop.gif',
165
	WT_ROOT . 'modules_v3/tree/css/treetopleft.gif',
166
	WT_ROOT . 'modules_v3/tree/css/treetopright.gif',
167
	WT_ROOT . 'modules_v3/tree/css/treeview_print.css',
168
	WT_ROOT . 'modules_v3/tree/help_text.php',
169
	WT_ROOT . 'modules_v3/tree/images/print.png',
170
	// Removed in 1.2.7
171
	WT_ROOT . 'login_register.php',
172
	WT_ROOT . 'modules_v3/top10_givnnames/help_text.php',
173
	WT_ROOT . 'modules_v3/top10_surnames/help_text.php',
174
	// Removed in 1.3.0
175
	WT_ROOT . 'admin_site_ipaddress.php',
176
	WT_ROOT . 'downloadgedcom.php',
177
	WT_ROOT . 'export_gedcom.php',
178
	WT_ROOT . 'gedcheck.php',
179
	WT_ROOT . 'images',
180
	WT_ROOT . 'includes/dmsounds_UTF8.php',
181
	WT_ROOT . 'includes/grampsxml.rng',
182
	WT_ROOT . 'includes/session_spider.php',
183
	WT_ROOT . 'modules_v3/googlemap/admin_editconfig.php',
184
	WT_ROOT . 'modules_v3/googlemap/admin_placecheck.php',
185
	WT_ROOT . 'modules_v3/googlemap/flags.php',
186
	WT_ROOT . 'modules_v3/googlemap/images/pedigree_map.gif',
187
	WT_ROOT . 'modules_v3/googlemap/pedigree_map.php',
188
	WT_ROOT . 'modules_v3/lightbox/admin_config.php',
189
	WT_ROOT . 'modules_v3/lightbox/album.php',
190
	WT_ROOT . 'modules_v3/tree/css/vline.jpg',
191
	// Removed in 1.3.1
192
	WT_ROOT . 'imageflush.php',
193
	WT_ROOT . 'modules_v3/googlemap/wt_v3_pedigree_map.js.php',
194
	WT_ROOT . 'modules_v3/lightbox/js/tip_balloon_RTL.js',
195
	// Removed in 1.3.2
196
	WT_ROOT . 'includes/set_gedcom_defaults.php',
197
	WT_ROOT . 'modules_v3/address_report',
198
	WT_ROOT . 'modules_v3/lightbox/functions/lb_horiz_sort.php',
199
	WT_ROOT . 'modules_v3/random_media/help_text.php',
200
	// Removed in 1.4.0
201
	WT_ROOT . 'imageview.php',
202
	WT_ROOT . 'media/MediaInfo.txt',
203
	WT_ROOT . 'media/thumbs/ThumbsInfo.txt',
204
	WT_ROOT . 'modules_v3/GEDFact_assistant/css/media_0_inverselink.css',
205
	WT_ROOT . 'modules_v3/lightbox/help_text.php',
206
	WT_ROOT . 'modules_v3/lightbox/images/blank.gif',
207
	WT_ROOT . 'modules_v3/lightbox/images/close_1.gif',
208
	WT_ROOT . 'modules_v3/lightbox/images/image_add.gif',
209
	WT_ROOT . 'modules_v3/lightbox/images/image_copy.gif',
210
	WT_ROOT . 'modules_v3/lightbox/images/image_delete.gif',
211
	WT_ROOT . 'modules_v3/lightbox/images/image_edit.gif',
212
	WT_ROOT . 'modules_v3/lightbox/images/image_link.gif',
213
	WT_ROOT . 'modules_v3/lightbox/images/images.gif',
214
	WT_ROOT . 'modules_v3/lightbox/images/image_view.gif',
215
	WT_ROOT . 'modules_v3/lightbox/images/loading.gif',
216
	WT_ROOT . 'modules_v3/lightbox/images/next.gif',
217
	WT_ROOT . 'modules_v3/lightbox/images/nextlabel.gif',
218
	WT_ROOT . 'modules_v3/lightbox/images/norm_2.gif',
219
	WT_ROOT . 'modules_v3/lightbox/images/overlay.png',
220
	WT_ROOT . 'modules_v3/lightbox/images/prev.gif',
221
	WT_ROOT . 'modules_v3/lightbox/images/prevlabel.gif',
222
	WT_ROOT . 'modules_v3/lightbox/images/private.gif',
223
	WT_ROOT . 'modules_v3/lightbox/images/slideshow.jpg',
224
	WT_ROOT . 'modules_v3/lightbox/images/transp80px.gif',
225
	WT_ROOT . 'modules_v3/lightbox/images/zoom_1.gif',
226
	WT_ROOT . 'modules_v3/lightbox/js',
227
	WT_ROOT . 'modules_v3/lightbox/music',
228
	WT_ROOT . 'modules_v3/lightbox/pic',
229
	WT_ROOT . 'themes/_administration/jquery',
230
	WT_ROOT . 'themes/webtrees/chrome.css',
231
	// Removed in 1.4.1
232
	WT_ROOT . 'modules_v3/lightbox/images/image_edit.png',
233
	WT_ROOT . 'modules_v3/lightbox/images/image_view.png',
234
	// Removed in 1.4.2
235
	WT_ROOT . 'modules_v3/lightbox/images/image_view.png',
236
	WT_ROOT . 'modules_v3/top10_pageviews/help_text.php',
237
	WT_ROOT . 'themes/_administration/jquery-ui-1.10.0',
238
	WT_ROOT . 'themes/clouds/jquery-ui-1.10.0',
239
	WT_ROOT . 'themes/colors/jquery-ui-1.10.0',
240
	WT_ROOT . 'themes/fab/jquery-ui-1.10.0',
241
	WT_ROOT . 'themes/minimal/jquery-ui-1.10.0',
242
	WT_ROOT . 'themes/webtrees/jquery-ui-1.10.0',
243
	WT_ROOT . 'themes/xenea/jquery-ui-1.10.0',
244
	// Removed in 1.5.0
245
	WT_ROOT . 'includes/media_reorder.php',
246
	WT_ROOT . 'includes/old_messages.php',
247
	WT_ROOT . 'modules_v3/GEDFact_assistant/_CENS/census_note_decode.php',
248
	WT_ROOT . 'modules_v3/GEDFact_assistant/_CENS/census_asst_date.php',
249
	WT_ROOT . 'modules_v3/googlemap/wt_v3_googlemap.js.php',
250
	WT_ROOT . 'modules_v3/lightbox/functions/lightbox_print_media.php',
251
	WT_ROOT . 'modules_v3/upcoming_events/help_text.php',
252
	WT_ROOT . 'modules_v3/stories/help_text.php',
253
	WT_ROOT . 'modules_v3/user_messages/help_text.php',
254
	WT_ROOT . 'themes/_administration/favicon.png',
255
	WT_ROOT . 'themes/_administration/images',
256
	WT_ROOT . 'themes/_administration/msie.css',
257
	WT_ROOT . 'themes/_administration/style.css',
258
	WT_ROOT . 'themes/clouds/favicon.png',
259
	WT_ROOT . 'themes/clouds/images',
260
	WT_ROOT . 'themes/clouds/msie.css',
261
	WT_ROOT . 'themes/clouds/style.css',
262
	WT_ROOT . 'themes/colors/css',
263
	WT_ROOT . 'themes/colors/favicon.png',
264
	WT_ROOT . 'themes/colors/images',
265
	WT_ROOT . 'themes/colors/ipad.css',
266
	WT_ROOT . 'themes/colors/msie.css',
267
	WT_ROOT . 'themes/fab/favicon.png',
268
	WT_ROOT . 'themes/fab/images',
269
	WT_ROOT . 'themes/fab/msie.css',
270
	WT_ROOT . 'themes/fab/style.css',
271
	WT_ROOT . 'themes/minimal/favicon.png',
272
	WT_ROOT . 'themes/minimal/images',
273
	WT_ROOT . 'themes/minimal/msie.css',
274
	WT_ROOT . 'themes/minimal/style.css',
275
	WT_ROOT . 'themes/webtrees/favicon.png',
276
	WT_ROOT . 'themes/webtrees/images',
277
	WT_ROOT . 'themes/webtrees/msie.css',
278
	WT_ROOT . 'themes/webtrees/style.css',
279
	WT_ROOT . 'themes/xenea/favicon.png',
280
	WT_ROOT . 'themes/xenea/images',
281
	WT_ROOT . 'themes/xenea/msie.css',
282
	WT_ROOT . 'themes/xenea/style.css',
283
	// Removed in 1.5.1
284
	WT_ROOT . 'themes/_administration/css-1.5.0',
285
	WT_ROOT . 'themes/clouds/css-1.5.0',
286
	WT_ROOT . 'themes/colors/css-1.5.0',
287
	WT_ROOT . 'themes/fab/css-1.5.0',
288
	WT_ROOT . 'themes/minimal/css-1.5.0',
289
	WT_ROOT . 'themes/webtrees/css-1.5.0',
290
	WT_ROOT . 'themes/xenea/css-1.5.0',
291
	// Removed in 1.5.2
292
	WT_ROOT . 'themes/_administration/css-1.5.1',
293
	WT_ROOT . 'themes/clouds/css-1.5.1',
294
	WT_ROOT . 'themes/colors/css-1.5.1',
295
	WT_ROOT . 'themes/fab/css-1.5.1',
296
	WT_ROOT . 'themes/minimal/css-1.5.1',
297
	WT_ROOT . 'themes/webtrees/css-1.5.1',
298
	WT_ROOT . 'themes/xenea/css-1.5.1',
299
	// Removed in 1.5.3
300
	WT_ROOT . 'modules_v3/GEDFact_assistant/_CENS/census_asst_help.php',
301
	WT_ROOT . 'modules_v3/googlemap/admin_places.php',
302
	WT_ROOT . 'modules_v3/googlemap/defaultconfig.php',
303
	WT_ROOT . 'modules_v3/googlemap/googlemap.php',
304
	WT_ROOT . 'modules_v3/googlemap/placehierarchy.php',
305
	WT_ROOT . 'modules_v3/googlemap/places_edit.php',
306
	WT_ROOT . 'modules_v3/googlemap/util.js',
307
	WT_ROOT . 'modules_v3/googlemap/wt_v3_places_edit.js.php',
308
	WT_ROOT . 'modules_v3/googlemap/wt_v3_places_edit_overlays.js.php',
309
	WT_ROOT . 'modules_v3/googlemap/wt_v3_street_view.php',
310
	WT_ROOT . 'readme.html',
311
	WT_ROOT . 'themes/_administration/css-1.5.2',
312
	WT_ROOT . 'themes/clouds/css-1.5.2',
313
	WT_ROOT . 'themes/colors/css-1.5.2',
314
	WT_ROOT . 'themes/fab/css-1.5.2',
315
	WT_ROOT . 'themes/minimal/css-1.5.2',
316
	WT_ROOT . 'themes/webtrees/css-1.5.2',
317
	WT_ROOT . 'themes/xenea/css-1.5.2',
318
	// Removed in 1.6.0
319
	WT_ROOT . 'downloadbackup.php',
320
	WT_ROOT . 'modules_v3/ckeditor/ckeditor-4.3.2-custom',
321
	WT_ROOT . 'site-php-version.php',
322
	WT_ROOT . 'themes/_administration/css-1.5.3',
323
	WT_ROOT . 'themes/clouds/css-1.5.3',
324
	WT_ROOT . 'themes/colors/css-1.5.3',
325
	WT_ROOT . 'themes/fab/css-1.5.3',
326
	WT_ROOT . 'themes/minimal/css-1.5.3',
327
	WT_ROOT . 'themes/webtrees/css-1.5.3',
328
	WT_ROOT . 'themes/xenea/css-1.5.3',
329
	// Removed in 1.6.1
330
	WT_ROOT . 'includes/authentication.php',
331
	// Removed in 1.6.2
332
	WT_ROOT . 'themes/_administration/css-1.6.0',
333
	WT_ROOT . 'themes/_administration/jquery-ui-1.10.3',
334
	WT_ROOT . 'themes/clouds/css-1.6.0',
335
	WT_ROOT . 'themes/clouds/jquery-ui-1.10.3',
336
	WT_ROOT . 'themes/colors/css-1.6.0',
337
	WT_ROOT . 'themes/colors/jquery-ui-1.10.3',
338
	WT_ROOT . 'themes/fab/css-1.6.0',
339
	WT_ROOT . 'themes/fab/jquery-ui-1.10.3',
340
	WT_ROOT . 'themes/minimal/css-1.6.0',
341
	WT_ROOT . 'themes/minimal/jquery-ui-1.10.3',
342
	WT_ROOT . 'themes/webtrees/css-1.6.0',
343
	WT_ROOT . 'themes/webtrees/jquery-ui-1.10.3',
344
	WT_ROOT . 'themes/xenea/css-1.6.0',
345
	WT_ROOT . 'themes/xenea/jquery-ui-1.10.3',
346
	WT_ROOT . 'themes/_administration/css-1.6.0',
347
	WT_ROOT . 'themes/_administration/jquery-ui-1.10.3',
348
	// Removed in 1.7.0
349
	WT_ROOT . 'admin_site_other.php',
350
	WT_ROOT . 'includes/config_data.php',
351
	WT_ROOT . 'includes/db_schema',
352
	WT_ROOT . 'includes/fonts',
353
	WT_ROOT . 'includes/functions',
354
	WT_ROOT . 'includes/hitcount.php',
355
	WT_ROOT . 'includes/reportheader.php',
356
	WT_ROOT . 'includes/specialchars.php',
357
	WT_ROOT . 'js',
358
	WT_ROOT . 'language/en_GB.mo', // Replaced with en-GB.mo
359
	WT_ROOT . 'language/en_US.mo', // Replaced with en-US.mo
360
	WT_ROOT . 'language/pt_BR.mo', // Replaced with pt-BR.mo
361
	WT_ROOT . 'language/zh_CN.mo', // Replaced with zh-Hans.mo
362
	WT_ROOT . 'language/extra',
363
	WT_ROOT . 'library',
364
	WT_ROOT . 'modules_v3/batch_update/admin_batch_update.php',
365
	WT_ROOT . 'modules_v3/batch_update/plugins',
366
	WT_ROOT . 'modules_v3/charts/help_text.php',
367
	WT_ROOT . 'modules_v3/ckeditor/ckeditor-4.4.1-custom',
368
	WT_ROOT . 'modules_v3/clippings/clippings_ctrl.php',
369
	WT_ROOT . 'modules_v3/clippings/help_text.php',
370
	WT_ROOT . 'modules_v3/faq/help_text.php',
371
	WT_ROOT . 'modules_v3/gedcom_favorites/db_schema',
372
	WT_ROOT . 'modules_v3/gedcom_news/db_schema',
373
	WT_ROOT . 'modules_v3/googlemap/db_schema',
374
	WT_ROOT . 'modules_v3/googlemap/help_text.php',
375
	WT_ROOT . 'modules_v3/html/help_text.php',
376
	WT_ROOT . 'modules_v3/logged_in/help_text.php',
377
	WT_ROOT . 'modules_v3/review_changes/help_text.php',
378
	WT_ROOT . 'modules_v3/todo/help_text.php',
379
	WT_ROOT . 'modules_v3/tree/class_treeview.php',
380
	WT_ROOT . 'modules_v3/user_blog/db_schema',
381
	WT_ROOT . 'modules_v3/yahrzeit/help_text.php',
382
	WT_ROOT . 'save.php',
383
	WT_ROOT . 'themes/_administration/css-1.6.2',
384
	WT_ROOT . 'themes/_administration/templates',
385
	WT_ROOT . 'themes/_administration/header.php',
386
	WT_ROOT . 'themes/_administration/footer.php',
387
	WT_ROOT . 'themes/clouds/css-1.6.2',
388
	WT_ROOT . 'themes/clouds/templates',
389
	WT_ROOT . 'themes/clouds/header.php',
390
	WT_ROOT . 'themes/clouds/footer.php',
391
	WT_ROOT . 'themes/colors/css-1.6.2',
392
	WT_ROOT . 'themes/colors/templates',
393
	WT_ROOT . 'themes/colors/header.php',
394
	WT_ROOT . 'themes/colors/footer.php',
395
	WT_ROOT . 'themes/fab/css-1.6.2',
396
	WT_ROOT . 'themes/fab/templates',
397
	WT_ROOT . 'themes/fab/header.php',
398
	WT_ROOT . 'themes/fab/footer.php',
399
	WT_ROOT . 'themes/minimal/css-1.6.2',
400
	WT_ROOT . 'themes/minimal/templates',
401
	WT_ROOT . 'themes/minimal/header.php',
402
	WT_ROOT . 'themes/minimal/footer.php',
403
	WT_ROOT . 'themes/webtrees/css-1.6.2',
404
	WT_ROOT . 'themes/webtrees/templates',
405
	WT_ROOT . 'themes/webtrees/header.php',
406
	WT_ROOT . 'themes/webtrees/footer.php',
407
	WT_ROOT . 'themes/xenea/css-1.6.2',
408
	WT_ROOT . 'themes/xenea/templates',
409
	WT_ROOT . 'themes/xenea/header.php',
410
	WT_ROOT . 'themes/xenea/footer.php',
411
	// Removed in 1.7.2
412
	WT_ROOT . 'assets/js-1.7.0',
413
	WT_ROOT . 'packages/bootstrap-3.3.4',
414
	WT_ROOT . 'packages/bootstrap-datetimepicker-4.0.0',
415
	WT_ROOT . 'packages/ckeditor-4.4.7-custom',
416
	WT_ROOT . 'packages/font-awesome-4.3.0',
417
	WT_ROOT . 'packages/jquery-1.11.2',
418
	WT_ROOT . 'packages/jquery-2.1.3',
419
	WT_ROOT . 'packages/moment-2.10.3',
420
	// Removed in 1.7.3
421
	WT_ROOT . 'includes/php_53_compatibility.php',
422
	WT_ROOT . 'modules_v3/GEDFact_assistant/census/date.js',
423
	WT_ROOT . 'modules_v3/GEDFact_assistant/census/dynamicoptionlist.js',
424
	WT_ROOT . 'packages/jquery-cookie-1.4.1/jquery.cookie.js',
425
	// Removed in 1.7.4
426
	WT_ROOT . 'assets/js-1.7.2',
427
	WT_ROOT . 'themes/_administration/css-1.7.0',
428
	WT_ROOT . 'themes/clouds/css-1.7.0',
429
	WT_ROOT . 'themes/colors/css-1.7.0',
430
	WT_ROOT . 'themes/fab/css-1.7.0',
431
	WT_ROOT . 'themes/minimal/css-1.7.0',
432
	WT_ROOT . 'themes/webtrees/css-1.7.0',
433
	WT_ROOT . 'themes/xenea/css-1.7.0',
434
	WT_ROOT . 'packages/bootstrap-3.3.5',
435
	WT_ROOT . 'packages/bootstrap-datetimepicker-4.15.35',
436
	WT_ROOT . 'packages/jquery-1.11.3',
437
	WT_ROOT . 'packages/jquery-2.1.4',
438
	WT_ROOT . 'packages/moment-2.10.6',
439
	// Removed in 1.7.5
440
	WT_ROOT . 'themes/_administration/css-1.7.4',
441
	WT_ROOT . 'themes/clouds/css-1.7.4',
442
	WT_ROOT . 'themes/colors/css-1.7.4',
443
	WT_ROOT . 'themes/fab/css-1.7.4',
444
	WT_ROOT . 'themes/minimal/css-1.7.4',
445
	WT_ROOT . 'themes/webtrees/css-1.7.4',
446
	WT_ROOT . 'themes/xenea/css-1.7.4',
447
	// Removed in 1.7.7
448
	WT_ROOT . 'assets/js-1.7.4',
449
	WT_ROOT . 'modules_v3/googlemap/images/css_sprite_facts.png',
450
	WT_ROOT . 'modules_v3/googlemap/images/flag_shadow.png',
451
	WT_ROOT . 'modules_v3/googlemap/images/shadow-left-large.png',
452
	WT_ROOT . 'modules_v3/googlemap/images/shadow-left-small.png',
453
	WT_ROOT . 'modules_v3/googlemap/images/shadow-right-large.png',
454
	WT_ROOT . 'modules_v3/googlemap/images/shadow-right-small.png',
455
	WT_ROOT . 'modules_v3/googlemap/images/shadow50.png',
456
	WT_ROOT . 'modules_v3/googlemap/images/transparent-left-large.png',
457
	WT_ROOT . 'modules_v3/googlemap/images/transparent-left-small.png',
458
	WT_ROOT . 'modules_v3/googlemap/images/transparent-right-large.png',
459
	WT_ROOT . 'modules_v3/googlemap/images/transparent-right-small.png',
460
	// Removed in 1.7.8
461
	WT_ROOT . 'themes/clouds/css-1.7.5',
462
	WT_ROOT . 'themes/colors/css-1.7.5',
463
	WT_ROOT . 'themes/fab/css-1.7.5',
464
	WT_ROOT . 'themes/minimal/css-1.7.5',
465
	WT_ROOT . 'themes/webtrees/css-1.7.5',
466
	WT_ROOT . 'themes/xenea/css-1.7.5',
467
	// Removed in 1.7.9
468
	WT_ROOT . 'assets/js-1.7.7',
469
);
470
471
// Delete old files (if we can).
472
$files_to_delete = array();
473
foreach ($old_files as $file) {
474
	if (file_exists($file) && !File::delete($file)) {
475
		$files_to_delete[] = $file;
476
	}
477
}
478
479
$controller = new PageController;
480
$controller
481
	->restrictAccess(Auth::isManager($WT_TREE))
482
	->setPageTitle(I18N::translate('Control panel') . ' — ' . /* I18N: A summary of the system status */ I18N::translate('Dashboard'))
483
	->pageHeader();
484
485
// Check for updates
486
$latest_version_txt = Functions::fetchLatestVersion();
487
if (preg_match('/^[0-9.]+\|[0-9.]+\|/', $latest_version_txt)) {
488
	list($latest_version) = explode('|', $latest_version_txt);
489
} else {
490
	// Cannot determine the latest version
491
	$latest_version = '';
492
}
493
494
$update_available = Auth::isAdmin() && $latest_version && version_compare(WT_VERSION, $latest_version) < 0;
495
496
// Total number of users
497
$total_users = User::count();
498
499
// Administrators
500
$administrators = Database::prepare(
501
	"SELECT SQL_CACHE user_id, real_name FROM `##user` JOIN `##user_setting` USING (user_id) WHERE setting_name='canadmin' AND setting_value='1'"
502
)->fetchAll();
503
504
// Managers
505
$managers = Database::prepare(
506
	"SELECT SQL_CACHE user_id, real_name FROM `##user` JOIN `##user_gedcom_setting` USING (user_id)" .
507
	" WHERE setting_name = 'canedit' AND setting_value='admin'" .
508
	" GROUP BY user_id, real_name" .
509
	" ORDER BY real_name"
510
)->fetchAll();
511
512
// Moderators
513
$moderators = Database::prepare(
514
	"SELECT SQL_CACHE user_id, real_name FROM `##user` JOIN `##user_gedcom_setting` USING (user_id)" .
515
	" WHERE setting_name = 'canedit' AND setting_value='accept'" .
516
	" GROUP BY user_id, real_name" .
517
	" ORDER BY real_name"
518
)->fetchAll();
519
520
// Number of users who have not verified their email address
521
$unverified = Database::prepare(
522
	"SELECT SQL_CACHE user_id, real_name FROM `##user` JOIN `##user_setting` USING (user_id)" .
523
	" WHERE setting_name = 'verified' AND setting_value = '0'" .
524
	" ORDER BY real_name"
525
)->fetchAll();
526
527
// Number of users whose accounts are not approved by an administrator
528
$unapproved = Database::prepare(
529
	"SELECT SQL_CACHE user_id, real_name FROM `##user` JOIN `##user_setting` USING (user_id)" .
530
	" WHERE setting_name = 'verified_by_admin' AND setting_value = '0'" .
531
	" ORDER BY real_name"
532
)->fetchAll();
533
534
// Users currently logged in
535
$logged_in = Database::prepare(
536
	"SELECT SQL_NO_CACHE DISTINCT user_id, real_name FROM `##user` JOIN `##session` USING (user_id)" .
537
	" ORDER BY real_name"
538
)->fetchAll();
539
540
// Count of records
541
$individuals = Database::prepare(
542
	"SELECT SQL_CACHE gedcom_id, COUNT(i_id) AS count FROM `##gedcom` LEFT JOIN `##individuals` ON gedcom_id = i_file GROUP BY gedcom_id"
543
)->fetchAssoc();
544
$families = Database::prepare(
545
	"SELECT SQL_CACHE gedcom_id, COUNT(f_id) AS count FROM `##gedcom` LEFT JOIN `##families` ON gedcom_id = f_file GROUP BY gedcom_id"
546
)->fetchAssoc();
547
$sources = Database::prepare(
548
	"SELECT SQL_CACHE gedcom_id, COUNT(s_id) AS count FROM `##gedcom` LEFT JOIN `##sources` ON gedcom_id = s_file GROUP BY gedcom_id"
549
)->fetchAssoc();
550
$media = Database::prepare(
551
	"SELECT SQL_CACHE gedcom_id, COUNT(m_id) AS count FROM `##gedcom` LEFT JOIN `##media` ON gedcom_id = m_file GROUP BY gedcom_id"
552
)->fetchAssoc();
553
$repositories = Database::prepare(
554
	"SELECT SQL_CACHE gedcom_id, COUNT(o_id) AS count FROM `##gedcom` LEFT JOIN `##other` ON gedcom_id = o_file AND o_type = 'REPO' GROUP BY gedcom_id"
555
)->fetchAssoc();
556
$changes = Database::prepare(
557
	"SELECT SQL_CACHE g.gedcom_id, COUNT(change_id) AS count FROM `##gedcom` AS g LEFT JOIN `##change` AS c ON g.gedcom_id = c.gedcom_id AND status = 'pending' GROUP BY g.gedcom_id"
558
)->fetchAssoc();
559
560
// Server warnings
561
// Note that security support for 5.6 ends after security support for 7.0
562
$server_warnings = array();
563
if (
564
	PHP_VERSION_ID < 50500 ||
565
	PHP_VERSION_ID < 50600 && date('Y-m-d') >= '2016-07-10' ||
566
	PHP_VERSION_ID < 70000 && date('Y-m-d') >= '2018-12-31' ||
567
	PHP_VERSION_ID >= 70000 && PHP_VERSION_ID < 70100 && date('Y-m-d') >= '2018-12-03'
568
) {
569
	$server_warnings[] =
570
		I18N::translate('Your web server is using PHP version %s, which is no longer receiving security updates. You should upgrade to a later version as soon as possible.', PHP_VERSION) .
571
		'<br><a href="https://php.net/supported-versions.php">https://php.net/supported-versions.php</a>';
572
} elseif (
573
	PHP_VERSION_ID < 50600 ||
574
	PHP_VERSION_ID < 70000 && date('Y-m-d') >= '2016-12-31' ||
575
	PHP_VERSION_ID < 70100 && date('Y-m-d') >= '2017-12-03'
576
) {
577
	$server_warnings[] =
578
		I18N::translate('Your web server is using PHP version %s, which is no longer maintained. You should upgrade to a later version.', PHP_VERSION) .
579
		 '<br><a href="https://php.net/supported-versions.php">https://php.net/supported-versions.php</a>';
580
}
581
582
?>
583
<h1><?php echo $controller->getPageTitle(); ?></h1>
584
585
<p>
586
	<?php echo I18N::translate('These pages provide access to all the preferences and management tools for this webtrees site.'); ?>
587
</p>
588
589
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
590
591
	<!-- SERVER WARNINGS -->
592
	<?php if ($server_warnings): ?>
0 ignored issues
show
Bug Best Practice introduced by
The expression $server_warnings of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
593
		<div class="panel panel-danger">
594
			<div class="panel-heading" role="tab" id="server-heading">
595
				<h2 class="panel-title">
596
					<a data-toggle="collapse" data-parent="#accordion" href="#server-panel" aria-expanded="true" aria-controls="server-panel">
597
						<?php echo I18N::translate('Server information'); ?>
598
					</a>
599
				</h2>
600
			</div>
601
			<div id="server-panel" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="server-heading">
602
				<div class="panel-body">
603
					<?php foreach ($server_warnings as $server_warning): ?>
604
					<p>
605
						<?php echo $server_warning; ?>
606
					</p>
607
					<?php endforeach; ?>
608
				</div>
609
			</div>
610
		</div>
611
	<?php endif; ?>
612
613
	<!-- WEBTREES VERSION -->
614
	<div class="panel <?php echo Auth::isAdmin() && $update_available ? 'panel-danger' : 'panel-primary'; ?>">
615
		<div class="panel-heading" role="tab" id="webtrees-version-heading">
616
			<h2 class="panel-title">
617
				<a data-toggle="collapse" data-parent="#accordion" href="#webtrees-version-panel" aria-expanded="true" aria-controls="webtrees-version-panel">
618
					<?php echo WT_WEBTREES, ' ', WT_VERSION; ?>
619
				</a>
620
			</h2>
621
		</div>
622
		<div id="webtrees-version-panel" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="webtrees-version-heading">
623
			<div class="panel-body">
624
				<p>
625
					<?php echo /* I18N: %s is a URL/link to the project website */ I18N::translate('Support and documentation can be found at %s.', '<a href="https://webtrees.net/">webtrees.net</a>'); ?>
626
				</p>
627
				<?php if (Auth::isAdmin()): ?>
628
				<p>
629
					<?php if ($latest_version === ''): ?>
630
					<?php echo I18N::translate('No upgrade information is available.'); ?>
631
					<?php elseif ($update_available): ?>
632
					<?php echo I18N::translate('A new version of webtrees is available.'); ?>
633
					<a href="admin_site_upgrade.php" class="error">
634
						<?php echo /* I18N: %s is a version number */ I18N::translate('Upgrade to webtrees %s.', Filter::escapeHtml($latest_version)); ?>
635
					</a>
636
					<?php else: ?>
637
						<?php echo I18N::translate('This is the latest version of webtrees. No upgrade is available.'); ?>
638
					<?php endif; ?>
639
				</p>
640
				<?php endif; ?>
641
			</div>
642
		</div>
643
	</div>
644
645
	<!-- USERS -->
646
	<?php if (Auth::isAdmin()): ?>
647
	<div class="panel <?php echo $unapproved || $unverified ? 'panel-danger' : 'panel-primary'; ?>">
648
		<div class="panel-heading" role="tab" id="users-heading">
649
			<h2 class="panel-title">
650
				<a data-toggle="collapse" data-parent="#accordion" href="#users-panel" aria-expanded="false" aria-controls="users-panel">
651
					<?php echo I18N::translate('Users'); ?>
652
				</a>
653
			</h2>
654
		</div>
655
		<div id="users-panel" class="panel-collapse collapse" role="tabpanel" aria-labelledby="users-heading">
656
			<div class="panel-body">
657
				<table class="table table-condensed">
658
					<caption class="sr-only">
659
						<?php echo I18N::translate('Users'); ?>
660
					</caption>
661
					<tbody>
662
						<tr>
663
							<th class="col-xs-3">
664
								<?php echo I18N::translate('Total number of users'); ?>
665
							</th>
666
							<td class="col-xs-9">
667
								<a href="admin_users.php">
668
									<?php echo I18N::number($total_users); ?>
669
								</a>
670
							</td>
671
						</tr>
672
						<tr>
673
							<th>
674
								<?php echo I18N::translate('Administrators'); ?>
675
							</th>
676
							<td>
677 View Code Duplication
								<?php foreach ($administrators as $n => $user): ?>
678
									<?php echo $n ? I18N::$list_separator : ''; ?>
679
									<a href="admin_users.php?action=edit&user_id=<?php echo $user->user_id; ?>" dir="auto">
680
										<?php echo Filter::escapeHtml($user->real_name); ?>
681
									</a>
682
								<?php endforeach; ?>
683
							</td>
684
						</tr>
685
						<tr>
686
							<th>
687
								<?php echo I18N::translate('Managers'); ?>
688
							</th>
689
							<td>
690 View Code Duplication
								<?php foreach ($managers as $n => $user): ?>
691
									<?php echo $n ? I18N::$list_separator : ''; ?>
692
									<a href="admin_users.php?action=edit&user_id=<?php echo $user->user_id; ?>" dir="auto">
693
										<?php echo Filter::escapeHtml($user->real_name); ?>
694
									</a>
695
								<?php endforeach; ?>
696
							</td>
697
						</tr>
698
						<tr>
699
							<th>
700
								<?php echo I18N::translate('Moderators'); ?>
701
							</th>
702
							<td>
703 View Code Duplication
								<?php foreach ($moderators as $n => $user): ?>
704
									<?php echo $n ? I18N::$list_separator : ''; ?>
705
									<a href="admin_users.php?action=edit&user_id=<?php echo $user->user_id; ?>" dir="auto">
706
										<?php echo Filter::escapeHtml($user->real_name); ?>
707
									</a>
708
								<?php endforeach; ?>
709
							</td>
710
						</tr>
711
						<tr class="<?php echo $unverified ? 'danger' : ''; ?>">
712
							<th>
713
								<?php echo I18N::translate('Not verified by the user'); ?>
714
							</th>
715
							<td>
716 View Code Duplication
								<?php foreach ($unverified as $n => $user): ?>
717
									<?php echo $n ? I18N::$list_separator : ''; ?>
718
									<a href="admin_users.php?action=edit&user_id=<?php echo $user->user_id; ?>" dir="auto">
719
										<?php echo Filter::escapeHtml($user->real_name); ?>
720
									</a>
721
								<?php endforeach; ?>
722
							</td>
723
						</tr>
724
						<tr class="<?php echo $unapproved ? 'danger' : ''; ?>">
725
							<th>
726
								<?php echo I18N::translate('Not approved by an administrator'); ?>
727
							</th>
728
							<td>
729 View Code Duplication
								<?php foreach ($unapproved as $n => $user): ?>
730
									<?php echo $n ? I18N::$list_separator : ''; ?>
731
									<a href="admin_users.php?action=edit&user_id=<?php echo $user->user_id; ?>" dir="auto">
732
										<?php echo Filter::escapeHtml($user->real_name); ?>
733
									</a>
734
								<?php endforeach; ?>
735
							</td>
736
						</tr>
737
						<tr>
738
							<th>
739
								<?php echo I18N::translate('Users who are signed in'); ?>
740
							</th>
741
							<td>
742 View Code Duplication
								<?php foreach ($logged_in as $n => $user): ?>
743
								<?php echo $n ? I18N::$list_separator : ''; ?>
744
									<a href="admin_users.php?action=edit&user_id=<?php echo $user->user_id; ?>" dir="auto">
745
										<?php echo Filter::escapeHtml($user->real_name); ?>
746
									</a>
747
								<?php endforeach; ?>
748
							</td>
749
						</tr>
750
					</tbody>
751
				</table>
752
			</div>
753
		</div>
754
	</div>
755
	<?php endif; ?>
756
757
	<!-- FAMILY TREES -->
758
	<div class="panel <?php echo array_sum($changes) ? 'panel-danger' : 'panel-primary'; ?>">
759
		<div class="panel-heading" role="tab" id="trees-heading">
760
			<h2 class="panel-title">
761
				<a data-toggle="collapse" data-parent="#accordion" href="#trees-panel" aria-expanded="false" aria-controls="trees-panel">
762
					<?php echo I18N::translate('Family trees'); ?>
763
				</a>
764
			</h2>
765
		</div>
766
		<div id="trees-panel" class="panel-collapse collapse" role="tabpanel" aria-labelledby="trees-heading">
767
			<div class="panel-body">
768
				<table class="table table-condensed">
769
					<caption class="sr-only">
770
						<?php echo I18N::translate('Family trees'); ?>
771
					</caption>
772
					<thead>
773
						<tr>
774
							<th class="col-xs-5"><?php echo I18N::translate('Family tree'); ?></th>
775
							<th class="col-xs-2 text-right flip"><?php echo I18N::translate('Pending changes'); ?></th>
776
							<th class="col-xs-1 text-right flip"><?php echo I18N::translate('Individuals'); ?></th>
777
							<th class="col-xs-1 text-right flip"><?php echo I18N::translate('Families'); ?></th>
778
							<th class="col-xs-1 text-right flip"><?php echo I18N::translate('Sources'); ?></th>
779
							<th class="col-xs-1 text-right flip"><?php echo I18N::translate('Repositories'); ?></th>
780
							<th class="col-xs-1 text-right flip"><?php echo I18N::translate('Media'); ?></th>
781
						</tr>
782
					</thead>
783
					<tbody>
784
						<?php foreach (Tree::getAll() as $tree): ?>
785
						<tr class="<?php echo $changes[$tree->getTreeId()] ? 'danger' : ''; ?>">
786
							<td>
787
								<a href="index.php?ctype=gedcom&amp;ged=<?php echo $tree->getNameUrl(); ?>">
788
									<?php echo $tree->getNameHtml(); ?>
789
									-
790
									<?php echo $tree->getTitleHtml(); ?>
791
								</a>
792
							</td>
793
							<td class="text-right flip">
794 View Code Duplication
								<?php if ($changes[$tree->getTreeId()]): ?>
795
								<a onclick="window.open('edit_changes.php', '_blank', chan_window_specs); return false;" href="#">
796
									<?php echo I18N::number($changes[$tree->getTreeId()]); ?>
797
									<span class="sr-only"><?php echo I18N::translate('Pending changes'); ?> <?php echo $tree->getTitleHtml(); ?></span>
798
								</a>
799
								<?php else: ?>
800
								-
801
								<?php endif; ?>
802
							</td>
803
							<td class="text-right flip">
804 View Code Duplication
								<?php if ($individuals[$tree->getTreeId()]): ?>
805
								<a href="indilist.php?ged=<?php echo $tree->getNameUrl(); ?>">
806
									<?php echo I18N::number($individuals[$tree->getTreeId()]); ?>
807
									<span class="sr-only"><?php echo I18N::translate('Individuals'); ?> <?php echo $tree->getTitleHtml(); ?></span>
808
								</a>
809
								<?php else: ?>
810
									-
811
								<?php endif; ?>
812
								</td>
813
							<td class="text-right flip">
814 View Code Duplication
								<?php if ($families[$tree->getTreeId()]): ?>
815
								<a href="famlist.php?ged=<?php echo $tree->getNameUrl(); ?>">
816
									<?php echo I18N::number($families[$tree->getTreeId()]); ?>
817
									<span class="sr-only"><?php echo I18N::translate('Families'); ?> <?php echo $tree->getTitleHtml(); ?></span>
818
								</a>
819
								<?php else: ?>
820
								-
821
								<?php endif; ?>
822
								</td>
823
							<td class="text-right flip">
824 View Code Duplication
								<?php if ($sources[$tree->getTreeId()]): ?>
825
								<a href="sourcelist.php?ged=<?php echo $tree->getNameUrl(); ?>">
826
									<?php echo I18N::number($sources[$tree->getTreeId()]); ?>
827
									<span class="sr-only"><?php echo I18N::translate('Sources'); ?> <?php echo $tree->getTitleHtml(); ?></span>
828
								</a>
829
								<?php else: ?>
830
								-
831
								<?php endif; ?>
832
							</td>
833
							<td class="text-right flip">
834 View Code Duplication
								<?php if ($repositories[$tree->getTreeId()]): ?>
835
								<a href="repolist.php?ged=<?php echo $tree->getNameUrl(); ?>">
836
									<?php echo I18N::number($repositories[$tree->getTreeId()]); ?>
837
									<span class="sr-only"><?php echo I18N::translate('Repositories'); ?> <?php echo $tree->getTitleHtml(); ?></span>
838
								</a>
839
								<?php else: ?>
840
									-
841
								<?php endif; ?>
842
							</td>
843
							<td class="text-right flip">
844 View Code Duplication
								<?php if ($media[$tree->getTreeId()]): ?>
845
								<a href="medialist.php?ged=<?php echo $tree->getNameUrl(); ?>">
846
									<?php echo I18N::number($media[$tree->getTreeId()]); ?>
847
									<span class="sr-only"><?php echo I18N::translate('Media objects'); ?> <?php echo $tree->getTitleHtml(); ?></span>
848
								</a>
849
								<?php else: ?>
850
								-
851
								<?php endif; ?>
852
							</td>
853
						</tr>
854
						<?php endforeach; ?>
855
					</tbody>
856
					<tfoot>
857
						<tr>
858
							<td>
859
								<?php echo I18N::translate('Total'); ?>
860
								-
861
								<?php echo I18N::plural('%s family tree', '%s family trees', count(Tree::getAll()), I18N::number(count(Tree::getAll()))); ?>
862
							</td>
863
							<td class="text-right flip">
864
								<?php echo I18N::number(array_sum($changes)); ?>
865
							</td>
866
							<td class="text-right flip">
867
								<?php echo I18N::number(array_sum($individuals)); ?>
868
							</td>
869
							<td class="text-right flip">
870
								<?php echo I18N::number(array_sum($families)); ?>
871
							</td>
872
							<td class="text-right flip">
873
								<?php echo I18N::number(array_sum($sources)); ?>
874
							</td>
875
							<td class="text-right flip">
876
								<?php echo I18N::number(array_sum($repositories)); ?>
877
							</td>
878
							<td class="text-right flip">
879
								<?php echo I18N::number(array_sum($media)); ?>
880
							</td>
881
						</tr>
882
					</tfoot>
883
				</table>
884
			</div>
885
		</div>
886
	</div>
887
888
	<!-- OLD FILES -->
889
	<?php if (Auth::isAdmin() && $files_to_delete): ?>
0 ignored issues
show
Bug Best Practice introduced by
The expression $files_to_delete of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
890
	<div class="panel panel-danger">
891
		<div class="panel-heading" role="tab" id="old-files-heading">
892
			<h2 class="panel-title">
893
				<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#old-files-panel" aria-expanded="false" aria-controls="old-files-panel">
894
					<?php echo I18N::translate('Old files found'); ?>
895
				</a>
896
			</h2>
897
		</div>
898
		<div id="old-files-panel" class="panel-collapse collapse" role="tabpanel" aria-labelledby="old-files-heading">
899
			<div class="panel-body">
900
				<p>
901
					<?php echo I18N::translate('Files have been found from a previous version of webtrees. Old files can sometimes be a security risk. You should delete them.'); ?>
902
				</p>
903
				<ul class="list-unstyled">
904
					<?php foreach ($files_to_delete as $file_to_delete): ?>
905
						<li dir="ltr"><code><?php echo Filter::escapeHtml($file_to_delete); ?></code></li>
906
					<?php endforeach ?>
907
				</ul>
908
			</div>
909
		</div>
910
	</div>
911
	<?php endif; ?>
912
913
</div>
914