forked from TN03/hi_updatecheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
116 lines (99 loc) · 3.75 KB
/
admin.php
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
<?php
/*
* @version $Id: admin.php 257 2015-03-14 17:01:30Z hi $
*/
/*
* ==================================================================
* Update-Check-Plugin for CMSimple_XH
* ==================================================================
* Version: 1.4
* Build: 2016011001
* Copyright: Holger Irmler
* Email: [email protected]
* Website: http://CMSimple.HolgerIrmler.de
* License: GPL3
* ==================================================================
*/
if (!defined('CMSIMPLE_XH_VERSION')) {
header('HTTP/1.0 403 Forbidden');
exit;
}
if (defined('CMSIMPLE_RELEASE')) {
$o .= '<div class="upd_error">'
. 'Sorry, Update-Check-Plugin can only work with the original CMSimple_XH from '
. '<a target="_blank" href="http://www.cmsimple-xh.org">www.cmsimple-xh.org.</a>'
. tag('br')
. 'Please delete the folder /plugins/hi_updatecheck/ from your installation.'
. '</div>';
return;
}
define('UPD_VERSION', '1.4');
define('UPD_DATE', '2016-01-10');
//Path to core-Versioninfo
define('CMSIMPLE_XH_VERSIONINFO', 'http://www.cmsimple-xh.org/userfiles/downloads/versioninfo/cmsimple_xh-version.nfo');
include_once($pth['folder']['plugins'] . 'jquery/jquery.inc.php');
include_jQuery();
include_once($pth['folder']['plugins'] . 'hi_updatecheck/updatecheck.php');
//Add hidden info-icon to editmenu
$o .= upd_addMenuEntry();
if (isset($_POST['do_updatecheck']) && isset($_POST['pluginname'])) {
header('Content-Type:text/html; charset=UTF-8');
echo hi_updateInfo($_POST['pluginname']);
exit;
}
if (isset($_POST['do_quickcheck'])) {
hi_updateQuickInfo();
exit;
}
//Quick-Check, only once per session
if (!isset($_SESSION['upd_checked']) && $plugin_cf['hi_updatecheck']['autocheck'] == 'true') {
hi_updateSetStatus();
}
if (isset($_SESSION['upd_available'])) {
hi_updateNotify();
}
/*
* Register the plugin menu items.
*/
if (function_exists('XH_registerStandardPluginMenuItems')) {
XH_registerStandardPluginMenuItems(true);
}
/*
* Handle the plugin administration.
*/
if (function_exists('XH_wantsPluginAdministration')
&& XH_wantsPluginAdministration('hi_updatecheck')
|| isset($hi_updatecheck) && $hi_updatecheck == 'true'
) {
$o .= print_plugin_admin('on');
switch ($admin) {
case '':
$o .= hi_updateVersion();
break;
case 'plugin_main':
$o .= hi_updateCheckAll();
break;
default:
$o .= plugin_admin_common($action, $admin, $plugin);
}
}
/**
* Returns the plugin version information view.
*
* @return string The (X)HTML.
*/
function hi_updateVersion() {
global $pth;
return '<h1>CMSimple_XH - Update-Check</h1>' . "\n"
. tag('img src="' . $pth['folder']['plugins'] . 'hi_updatecheck/images/software-update-icon.png" class="upd_plugin_icon"')
. '<p>Version: ' . UPD_VERSION . ' - ' . UPD_DATE . '</p>' . "\n"
. '<p>Copyright ©2013-2014 <a href="http://cmsimple.holgerirmler.de/">Holger Irmler</a> - all rights reserved' . tag('br')
. '<p class="upd_license">License: GPL3</p>' . "\n"
. '<p class="upd_license">THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR'
. ' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,'
. ' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE'
. ' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER'
. ' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,'
. ' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE'
. ' SOFTWARE.</p>' . "\n";
}