diff --git a/build/libifm.php b/build/libifm.php index da6cb9b..6e71721 100644 --- a/build/libifm.php +++ b/build/libifm.php @@ -3985,6 +3985,12 @@ function IFM( params ) { if( $this->config['auth'] == 0 ) return true; + if( isset( $_SERVER['HTTP_X_IFM_AUTH'] ) && ! empty( $_SERVER['HTTP_X_IFM_AUTH'] ) ) { + $cred = split( ":", base64_decode( $_SERVER['HTTP_X_IFM_AUTH'] ) ); + if( count( $cred ) == 2 && $this->checkCredentials( $cred[0], $cred[1] ) ) + return true; + } + if( session_status() !== PHP_SESSION_ACTIVE ) { if( isset( $this->config['session_lifetime'] ) ) ini_set( 'session.gc_maxlifetime', $this->config['session_lifetime'] ); diff --git a/ifm.php b/ifm.php index 0cb7518..d7b6372 100644 --- a/ifm.php +++ b/ifm.php @@ -3985,6 +3985,12 @@ function IFM( params ) { if( $this->config['auth'] == 0 ) return true; + if( isset( $_SERVER['HTTP_X_IFM_AUTH'] ) && ! empty( $_SERVER['HTTP_X_IFM_AUTH'] ) ) { + $cred = split( ":", base64_decode( $_SERVER['HTTP_X_IFM_AUTH'] ) ); + if( count( $cred ) == 2 && $this->checkCredentials( $cred[0], $cred[1] ) ) + return true; + } + if( session_status() !== PHP_SESSION_ACTIVE ) { if( isset( $this->config['session_lifetime'] ) ) ini_set( 'session.gc_maxlifetime', $this->config['session_lifetime'] ); diff --git a/src/main.php b/src/main.php index a1f8bb3..d2b0d52 100644 --- a/src/main.php +++ b/src/main.php @@ -965,6 +965,12 @@ f00bar; if( $this->config['auth'] == 0 ) return true; + if( isset( $_SERVER['HTTP_X_IFM_AUTH'] ) && ! empty( $_SERVER['HTTP_X_IFM_AUTH'] ) ) { + $cred = split( ":", base64_decode( $_SERVER['HTTP_X_IFM_AUTH'] ) ); + if( count( $cred ) == 2 && $this->checkCredentials( $cred[0], $cred[1] ) ) + return true; + } + if( session_status() !== PHP_SESSION_ACTIVE ) { if( isset( $this->config['session_lifetime'] ) ) ini_set( 'session.gc_maxlifetime', $this->config['session_lifetime'] );