-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.php
More file actions
46 lines (42 loc) · 1.52 KB
/
update.php
File metadata and controls
46 lines (42 loc) · 1.52 KB
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
<?php
/*
Name: Thesis Developer Update Repository
Author: Tim Milligan
Version: 1.3
Configuration:
Replace the items in the $files array with arrays of your skins, boxes, and packages.
*/
if(!count($_POST) || !isset($_POST['wp'])) die("Hacking Attempt...");
$data = unserialize(stripslashes($_POST['data']));
$types = array('skins', 'boxes', 'packages');
$files = array();
if(isset($data['thesis']) && version_compare($data['thesis'], '2.1', '>=')) { // Thesis 2.1 assets
$files = array(
'boxes' => array(
'ewpfi' => array('version' => '2.1', 'url' => 'http://voidzonemedia.com/files/2_1/ewpfi.zip'),
'vzm_copyright' => array('version' => '2.1', 'url' => 'http://voidzonemedia.com/files/2_1/vzm_copyright.zip')
)
);
} else { // Thesis 2.0 assets
$files = array(
'boxes' => array(
'ewpfi' => array('version' => '1.3', 'url' => 'http://voidzonemedia.com/files/2_0/ewpfi.zip'),
'vzm_copyright' => array('version' => '1.3', 'url' => 'http://voidzonemedia.com/files/2_0/vzm_copyright.zip')
),
'packages' => array(
'vzm_example_package' => array('version' => '1.0', 'url' => 'http://voidzonemedia.com/files/2_0/vzm_example_package.zip')
)
);
}
$return_data = array();
foreach($types as $type) {
if(isset($files[$type]) && is_array($files[$type])) {
foreach($files[$type] as $name => $file_data){
if(array_key_exists($name, $data[$type]) && version_compare($data[$type][$name], $file_data['version'], '<') ) {
$return_data[$type][$name] = $file_data;
}
}
}
}
if(!empty($return_data))
echo serialize($return_data);