-
Notifications
You must be signed in to change notification settings - Fork 13
/
config-update-select.php
170 lines (139 loc) · 5.08 KB
/
config-update-select.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
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
<?php
// +------------------------------------------------------------------------+
// | O!MPD, Copyright © 2015-2019 Artur Sierzant |
// | http://www.ompd.pl |
// | |
// | |
// | netjukebox, Copyright © 2001-2012 Willem Bartels |
// | |
// | http://www.netjukebox.nl |
// | http://forum.netjukebox.nl |
// | |
// | This program is free software: you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation, either version 3 of the License, or |
// | (at your option) any later version. |
// | |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program. If not, see <http://www.gnu.org/licenses/>. |
// +------------------------------------------------------------------------+
// +------------------------------------------------------------------------+
// | config.php |
// +------------------------------------------------------------------------+
require_once('include/initialize.inc.php');
$cfg['menu'] = 'config';
$action = getpost('action');
$update = getpost('update');
if ($action == 'updateSelect') updateSelect();
else message(__FILE__, __LINE__, 'error', '[b]Unsupported input value for[/b][br]action');
// +------------------------------------------------------------------------+
// | Select update range |
// +------------------------------------------------------------------------+
function updateSelect() {
global $cfg, $db;
authenticate('access_admin');
require_once('include/play.inc.php');
$result = mysqli_query($db,'SELECT * FROM update_progress');
$row = mysqli_fetch_assoc($result);
$update_status = $row["update_status"];
if ($update_status == 1) {
header('Location: update.php?action=update&sign=' . $cfg['sign']);
exit();
}
// formattedNavigator
$nav = array();
$nav['name'][] = 'Configuration';
$nav['url'][] = 'config.php';
$nav['name'][] = 'Update';
require_once('include/header.inc.php');
if(!isset($_COOKIE['update_dir']) || $_COOKIE['update_dir'] == '') {
$dir = $cfg['media_dir'];
} else {
$dir = myHTMLencode($_COOKIE['update_dir']);
}
//$selectedDir = isset($_GET['selectedDir']) ? str_replace('ompd_ampersand_ompd','&',$_GET['selectedDir']) : $dir;
$selectedDir = isset($_GET['selectedDir']) ? myHTMLencode($_GET['selectedDir']) : $dir;
?>
<table width="100%" cellspacing="0" cellpadding="0" class="border">
<tr class="header">
<td> </td>
<td colspan="3">Update only selected directory</td>
</tr>
<tr>
<td> </td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td> </td>
<td style="max-width: 4em;">Select directory:</td>
<td> </td>
<td>
<div class="buttons">
<input id="updateDir" value="<?php echo $selectedDir; ?>">
<span id="updateBrowse"><i class="fa fa-folder-open-o fa-fw"></i> Browse...</span>
</div>
</td>
</tr>
<tr>
<td> </td>
<td></td>
<td> </td>
<td>
<div class="buttons">
<span id="updateSelectedDir" onmouseover="return overlib('Update this dir');" onmouseout="return nd();"> <i class="fa fa-refresh fa-fw"></i> Update this directory only</span>
</div>
<div id="errorMessage"></div>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td></td>
<td>(This is force update of ALL files)</td>
</tr>
<tr>
<td> </td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr class="header">
<td> </td>
<td colspan="3">Update whole media directory (<?php echo $cfg['media_dir'];?>)</td>
</tr>
<tr>
<td> </td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td>
<div class="buttons">
<span id="updateAll" onmouseover="return overlib('Update all');" onmouseout="return nd();"> <i class="fa fa-refresh fa-fw"></i> Update all</span>
</div>
<div id="errorMessage"></div>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td></td>
<td>(This updates only new and changed files)</td>
</tr>
</table>
<?php
echo '</table>' . "\n";
require_once('include/footer.inc.php');
}
?>