$mxValue ) { if( is_array( $mxValue ) ) { $arrOD[] = '[' . $strKey . ']'; foreach( $mxValue as $strSubKey => $mxSubValue ) { $arrOD[] = $strSubKey . ' = ' . ( is_numeric( $mxSubValue ) ? $mxSubValue : '"' . $mxSubValue . '"' ); } } else { $arrOD[] = $strKey . ' = ' . ( is_numeric( $mxValue ) ? $mxValue : '"' . $mxValue . '"' ); } } return ( file_put_contents( $strFileName , implode( PHP_EOL , $arrOD ) , LOCK_EX ) !== false ) ? true : false; } function sendHTTPHeadersNoBrowserCache() { header( 'Cache-Control: no-store, no-cache, must-revalidate, max-age=0' ); header( 'Cache-Control: post-check=0, pre-check=0' , false ); header( 'Pragma: no-cache' ); return true; } function getHTTPAuth( $arrUserData , $strAuthRealm = null ) { if( ! is_string( $strAuthRealm ) ) { $strAuthRealm = $_SERVER[ 'HTTP_HOST' ]; } if( ! isset( $_SERVER[ 'PHP_AUTH_USER' ] ) ) { header( 'Content-Type: text/plain; charset=utf-8' ); header( 'Cache-Control: no-cache, must-revalidate, ' . 'post-check=0, pre-check=0, private' ); header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); header( 'Pragma: no-cache, public' ); header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); header( 'WWW-Authenticate: Basic realm="' . $strAuthRealm . '"' ); header( 'HTTP/1.0 401 Unauthorized' ); echo 'HTTP/1.0 401 Unauthorized'; exit; } else { $_SERVER[ 'PHP_AUTH_USER' ] = basename( strtolower( trim( $_SERVER[ 'PHP_AUTH_USER' ] ) ) ); $_SERVER[ 'PHP_AUTH_PW' ] = basename( trim( $_SERVER[ 'PHP_AUTH_PW' ] ) ); foreach( $arrUserData as $strUserName => $strUserPassword ) { $strUserName = basename( strtolower( trim( $strUserName ) ) ); $strUserPassword = basename( trim( $strUserPassword ) ); if( ( $_SERVER[ 'PHP_AUTH_USER' ] === $strUserName ) && ( $_SERVER[ 'PHP_AUTH_PW' ] === $strUserPassword ) ) { return array( $strUserName , $strUserPassword ); } } header( 'Content-Type: text/plain; charset=utf-8' ); header( 'Cache-Control: no-cache, must-revalidate, ' . 'post-check=0, pre-check=0, private' ); header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); header( 'Pragma: no-cache, public' ); header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); header( 'WWW-Authenticate: Basic realm="' . $strAuthRealm . '"' ); header( 'HTTP/1.0 401 Unauthorized' ); echo 'HTTP/1.0 401 Unauthorized'; exit; } return null; } function isLoggedIn() { if( isset( $_REQUEST[ 'login' ] ) ) { $arrR = getHTTPAuth( $GLOBALS[ 'arrConfig' ][ 'users' ] ); } if( ( isset( $GLOBALS[ 'arrConfig' ] [ 'users' ] [ $_SERVER[ 'PHP_AUTH_USER' ] ] ) ) && ( $GLOBALS [ 'arrConfig' ] [ 'users' ] [ $_SERVER[ 'PHP_AUTH_USER' ] ] === $_SERVER[ 'PHP_AUTH_PW' ] ) ) { return true; } return false; } function getWebBaseURL() { return 'http' . ( ( isset( $_SERVER[ 'HTTPS' ] ) ) ? 's' : '' ) . '://' . $_SERVER[ 'HTTP_HOST' ] . dirname( $_SERVER[ 'SCRIPT_NAME' ] ) . '/'; } function getWebFullURL() { $strPS = ''; $arrA = func_get_args(); if( ( is_array( $arrA ) ) && ( count( $arrA ) > 0 ) ) { $strPS .= '?'; foreach( $arrA as $mxCA ) { if( is_array( $mxCA ) ) { $strCK = key( $mxCA ); $strPS .= $strCK; $strPS .= ( isset( $mxCA[ $strCK ] ) ) ? '=' . urlencode( $mxCA[ $strCK ] ) : ''; } else { $strPS .= $mxCA; } $strPS .= '&'; } $strPS = substr( $strPS , 0 , -1 ); } return 'http' . ( ( isset( $_SERVER[ 'HTTPS' ] ) ) ? 's' : '' ) . '://' . $_SERVER[ 'HTTP_HOST' ] . $_SERVER[ 'SCRIPT_NAME' ] . $strPS; } function doHTMLURL( $strI ) { return ( is_string( $strI ) ) ? str_ireplace( '&' , '&' , $strI ) : ''; } loadConfigurationData(); sendHTTPHeadersNoBrowserCache(); if( ! isLoggedIn() ) { if( ! $GLOBALS[ 'arrConfig' ][ 'bAllowGuests' ] ) { header( 'Content-Type: text/plain; charset=utf-8' ); doExit( 1020 , 'No guest access allowed' ); } } header( 'Content-Type: text/html; charset=utf-8' ); if( ! is_dir( $GLOBALS[ 'arrConfig' ][ 'strFilesDir' ] ) ) { if( mkdir( $GLOBALS[ 'arrConfig' ][ 'strFilesDir' ] ) === false ) { doExit( 1010 , '"' . $GLOBALS[ 'arrConfig' ][ 'strFilesDir' ] . '" does not exist/is not a directory and cannot be created' ); } } if( isset( $_FILES[ 'ufile' ] ) ) { if( ! isLoggedIn() ) { exit; } move_uploaded_file( $_FILES[ 'ufile' ][ 'tmp_name' ] , $GLOBALS[ 'arrConfig' ][ 'strFilesDir' ] . basename( $_FILES[ 'ufile' ][ 'name' ] ) ); } if( isset( $_REQUEST[ 'cmd' ] ) ) { if( ! isLoggedIn() ) { exit; } if( ( $_REQUEST[ 'cmd' ] === 'delete' ) && ( isset( $_REQUEST[ 'file' ] ) ) && ( is_file( $GLOBALS[ 'arrConfig' ][ 'strFilesDir' ] . $_REQUEST[ 'file' ] ) ) ) { file_put_contents( $GLOBALS[ 'arrConfig' ][ 'strFilesDir' ] . $_REQUEST[ 'file' ] , '' , LOCK_EX ); unlink( $GLOBALS[ 'arrConfig' ][ 'strFilesDir' ] . $_REQUEST[ 'file' ] ); } if( ( $_REQUEST[ 'cmd' ] === 'rename' ) && ( isset( $_REQUEST[ 'file' ] ) ) && ( is_file( $GLOBALS[ 'arrConfig' ][ 'strFilesDir' ] . $_REQUEST[ 'file' ] ) ) ) { if( isset( $_REQUEST[ 'newname' ] ) ) { rename( $GLOBALS[ 'arrConfig' ][ 'strFilesDir' ] . $_REQUEST[ 'file' ] , $GLOBALS[ 'arrConfig' ][ 'strFilesDir' ] . trim( strip_tags( basename( $_REQUEST[ 'newname' ] ) ) ) ); } } } if( isset( $_REQUEST[ 'logout' ] ) ) { header( 'Location: ' . str_ireplace( '://' , '://logout@' , getWebBaseURL() ) ); exit; } ?> <?php echo $GLOBALS[ 'arrConfig' ][ 'strScriptName' ]; ?>
File ""
                Name: 
                Size:  bytes ( Mbytes)
                
            
Rename file ""?
Delete file ""?
'; echo ''; echo ''; echo ''; } } echo PHP_EOL . ' ' . PHP_EOL; if( isLoggedIn() ) { echo PHP_EOL . ' ' . PHP_EOL . ' '; } ?>
File Options
'; echo '' . $strCF . ''; echo ''; echo '
'; echo ''; echo ''; echo '
'; if( isLoggedIn() ) { echo '
'; echo ''; echo ''; echo '
'; echo '
'; echo ''; echo ''; echo '
'; } echo '
' . $intC . ' file(s) in directory
'; echo '
'; echo ''; echo ''; echo '
'; echo '