184 } |
185 } |
185 $fork = isset($_POST['allow_fork']); |
186 $fork = isset($_POST['allow_fork']); |
186 $httpd->reboot($addr, null, $fork); |
187 $httpd->reboot($addr, null, $fork); |
187 } |
188 } |
188 } |
189 } |
|
190 } |
|
191 |
|
192 $message = false; |
|
193 |
|
194 // Rebuild options |
|
195 $pathinfo = @substr(@substr($_SERVER['REQUEST_URI'], 1), @strpos(@substr($_SERVER['REQUEST_URI'], 1), '/')+1); |
|
196 switch($pathinfo) |
|
197 { |
|
198 case 'rebuild/artwork': |
|
199 global $amarok_home; |
|
200 $artwork_dir = "$amarok_home/albumcovers"; |
|
201 |
|
202 if ( $dp = opendir($artwork_dir) ) |
|
203 { |
|
204 while ( $dh = @readdir($dp) ) |
|
205 { |
|
206 if ( preg_match('/^collage_[0-9]+\.(?:map|png)$/', $dh) ) |
|
207 { |
|
208 unlink("$artwork_dir/$dh"); |
|
209 } |
|
210 } |
|
211 closedir($dp); |
|
212 } |
|
213 |
|
214 $message = 'Successfully cleared album art cache'; |
|
215 break; |
|
216 case 'rebuild/playlist': |
|
217 rebuild_playlist(true); |
|
218 $message = 'Successfully rebuilt playlist cache'; |
|
219 break; |
189 } |
220 } |
190 |
221 |
191 global $theme; |
222 global $theme; |
192 $iphone = ( ( strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') || |
223 $iphone = ( ( strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') || |
193 strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') || |
224 strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') || |
194 strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') || |
225 strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') || |
195 isset($_GET['m']) ) |
226 isset($_GET['m']) ) |
196 && !isset($_GET['f']) |
227 && !isset($_GET['f']) |
197 ); |
228 ); |
198 $theme_id = ( $iphone ) ? 'iphone' : $theme; |
229 $theme_id = ( $iphone ) ? 'iphone' : $theme; |
|
230 |
199 $smarty = load_theme($theme_id); |
231 $smarty = load_theme($theme_id); |
200 |
|
201 $smarty->assign('theme', $theme_id); |
232 $smarty->assign('theme', $theme_id); |
202 $smarty->assign('greyhound_version', GREY_VERSION); |
233 $smarty->assign('greyhound_version', GREY_VERSION); |
203 $smarty->assign('tried', $tried); |
234 $smarty->assign('tried', $tried); |
204 $smarty->assign('success', $success); |
235 $smarty->assign('success', $success); |
|
236 $smarty->assign('message', $message); |
205 $smarty->assign('needpass', $needpass); |
237 $smarty->assign('needpass', $needpass); |
206 $smarty->assign('use_auth', $use_auth); |
238 $smarty->assign('use_auth', $use_auth); |
207 $smarty->assign('public', $GLOBALS['public']); |
239 $smarty->assign('public', $GLOBALS['public']); |
208 $smarty->assign('ipv6', $GLOBALS['enable_ipv6']); |
240 $smarty->assign('ipv6', $GLOBALS['enable_ipv6']); |
209 $smarty->assign('allowcontrol', $GLOBALS['allowcontrol']); |
241 $smarty->assign('allowcontrol', $GLOBALS['allowcontrol']); |