File tree Expand file tree Collapse file tree 2 files changed +50
-32
lines changed
Expand file tree Collapse file tree 2 files changed +50
-32
lines changed Original file line number Diff line number Diff line change 99use Photobooth \Service \ProcessService ;
1010use Photobooth \Utility \PathUtility ;
1111
12- header ('Content-Type: application/json ' );
13-
1412$ loggerService = LoggerService::getInstance ();
1513$ logger = $ loggerService ->getLogger ('main ' );
1614$ logger ->debug (basename ($ _SERVER ['PHP_SELF ' ]));
3028
3129try {
3230 $ configurationService ->update ($ config );
33- $ logger ->debug ('New config saved. ' );
34- echo json_encode ([
35- 'status ' => 'success ' ,
36- 'message ' => 'New config saved. ' ,
37- ]);
31+ $ message = 'New config saved. ' ;
32+ $ status = 'success ' ;
3833} catch (\Exception $ exception ) {
39- $ logger ->error ('ERROR: Config can not be saved! ' );
40- echo json_encode ([
41- 'status ' => 'error ' ,
42- 'message ' => $ exception ->getMessage (),
43- ]);
34+ $ message = $ exception ->getMessage ();
35+ $ status = 'error ' ;
4436}
4537
4638// Kill service daemons after config has changed
4739ProcessService::getInstance ()->shutdown ();
48-
49- // return to Adminpanel
50- header ('location: ' . PathUtility::getPublicPath ('admin ' ));
51- exit ();
40+ ?>
41+
42+ <!DOCTYPE html>
43+ <html>
44+ <head>
45+ <meta http-equiv="refresh" content="2;url=<?= PathUtility::getPublicPath ('admin ' ) ?> ">
46+ <style>
47+ body { font-family: sans-serif; padding: 2rem; }
48+ .success { color: green; }
49+ .error { color: red; }
50+ </style>
51+ </head>
52+ <body>
53+ <div class="<?= $ status ?> ">
54+ <?= htmlspecialchars ($ message ) ?>
55+ </div>
56+ <p>Redirecting…</p>
57+ </body>
58+ </html>
59+ <?php
60+ exit ;
Original file line number Diff line number Diff line change 99use Photobooth \Service \ProcessService ;
1010use Photobooth \Utility \PathUtility ;
1111
12- header ('Content-Type: application/json ' );
13-
1412$ loggerService = LoggerService::getInstance ();
1513$ logger = $ loggerService ->getLogger ('main ' );
1614$ logger ->debug (basename ($ _SERVER ['PHP_SELF ' ]));
3028
3129try {
3230 $ configurationService ->update ($ config );
33- $ logger ->debug ('New config saved. ' );
34- echo json_encode ([
35- 'status ' => 'success ' ,
36- 'message ' => 'New config saved. ' ,
37- ]);
31+ $ message = 'New config saved. ' ;
32+ $ status = 'success ' ;
3833} catch (\Exception $ exception ) {
39- $ logger ->error ('ERROR: Config can not be saved! ' );
40- echo json_encode ([
41- 'status ' => 'error ' ,
42- 'message ' => $ exception ->getMessage (),
43- ]);
34+ $ message = $ exception ->getMessage ();
35+ $ status = 'error ' ;
4436}
4537
4638// Kill service daemons after config has changed
4739ProcessService::getInstance ()->shutdown ();
48-
49- // return to Adminpanel
50- header ('location: ' . PathUtility::getPublicPath ('admin ' ));
51- exit ();
40+ ?>
41+
42+ <!DOCTYPE html>
43+ <html>
44+ <head>
45+ <meta http-equiv="refresh" content="2;url=<?= PathUtility::getPublicPath ('admin ' ) ?> ">
46+ <style>
47+ body { font-family: sans-serif; padding: 2rem; }
48+ .success { color: green; }
49+ .error { color: red; }
50+ </style>
51+ </head>
52+ <body>
53+ <div class="<?= $ status ?> ">
54+ <?= htmlspecialchars ($ message ) ?>
55+ </div>
56+ <p>Redirecting…</p>
57+ </body>
58+ </html>
59+ <?php
60+ exit ;
You can’t perform that action at this time.
0 commit comments