File tree Expand file tree Collapse file tree 4 files changed +5
-4
lines changed Expand file tree Collapse file tree 4 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -542,7 +542,7 @@ function disableValidation(form) {
542542
543543function updateActivityLED ( ) {
544544 const threshold_bytes = 300 ;
545- fetch ( '/ app/net_activity' )
545+ fetch ( 'app/net_activity' )
546546 . then ( res => res . text ( ) )
547547 . then ( data => {
548548 const activity = parseInt ( data . trim ( ) ) ;
Original file line number Diff line number Diff line change @@ -82,9 +82,10 @@ public function logout(): void
8282 session_regenerate_id (true ); // generate a new session id
8383 session_unset (); // unset all session variables
8484 session_destroy (); // destroy the session
85+ $ basePath = rtrim (dirname ($ _SERVER ['SCRIPT_NAME ' ]), '/ ' );
8586 $ redirectUrl = $ _SERVER ['REQUEST_URI ' ];
8687 if (strpos ($ redirectUrl , '/login ' ) === false ) {
87- header ('Location: /login?action= ' . urlencode ($ redirectUrl ));
88+ header ('Location: ' . $ basePath . ' /login?action= ' . urlencode (basename ( $ redirectUrl) ));
8889 exit ();
8990 }
9091 }
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class HtmlErrorRenderer
1919 public function __construct ()
2020 {
2121 $ this ->charset = 'UTF-8 ' ;
22- $ this ->projectDir = $ _SERVER [ ' DOCUMENT_ROOT ' ] ;
22+ $ this ->projectDir = dirname ( __DIR__ , 3 ) ;
2323 $ this ->template = '/templates/exception.php ' ;
2424 $ this ->debug = true ;
2525 }
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public function __construct()
3232 $ this ->tempSudoers = '/tmp/090_ ' ;
3333 $ this ->destSudoers = '/etc/sudoers.d/ ' ;
3434 $ this ->refModules = '/refs/heads/master/.gitmodules ' ;
35- $ this ->rootPath = $ _SERVER [ ' DOCUMENT_ROOT ' ] ;
35+ $ this ->rootPath = dirname ( __DIR__ , 3 ) ;
3636 $ this ->pluginsManifest = '/plugins/manifest.json ' ;
3737 $ this ->repoPublic = $ this ->getRepository ();
3838 $ this ->helperScriptPath = RASPI_CONFIG .'/plugins/plugin_helper.sh ' ;
You can’t perform that action at this time.
0 commit comments