X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fgen_sql_patches.php;h=4baf15fa48f0eb3f962e7c80bcfc7f402a279a1e;hp=8c54d294aa7a71699516dd038989f031b20b2d27;hb=01c4a1aa0914ebb2ab1d5df3d592246fb86e50cb;hpb=7ca7fc19533794f4cec43d8e9767d1c137148a8a diff --git a/inc/gen_sql_patches.php b/inc/gen_sql_patches.php index 8c54d294aa..4baf15fa48 100644 --- a/inc/gen_sql_patches.php +++ b/inc/gen_sql_patches.php @@ -1,7 +1,7 @@ Cookie: ".get_session('u_hash')."
Test: ".$test); - - // Write $file_hash to database - UPDATE_CONFIG("file_hash", $file_hash); + writeToFile($FQFN, $secretKey); + + // Is the file there? + if (isFileReadable($FQFN)) { + //* DEBUG: */ removeFile($FQFN); + //* DEBUG: */ $test = hexdec(getSession('u_hash')) / hexdec($secretKey); + //* DEBUG: */ $test = generateHash(str_replace('.', '', $test)); + //* DEBUG: */ die("Secret-Key: ".$secretKey."
Cookie: ".getSession('u_hash')."
Test: ".$test); + + // Write $fileHash to database + updateConfiguration('file_hash', $fileHash); + + // Generate FQFN for .htaccess file + $FQFN = sprintf("%sinc/.secret/.htaccess", + getConfig('PATH') + ); + + // Is the .htaccess file there? + if (!isFileReadable($FQFN)) { + // Also create .htaccess file + writeToFile($FQFN, "Deny from all\n"); + } // END - if // Also update configuration - $_CONFIG['secret_key'] = $secretKey; - $_CONFIG['file_hash'] = $file_hash; + setConfigEntry('secret_key', $secretKey); - // And remove some variables + // Remove variables unset($secretKey); - unset($file_hash); - } -} + unset($fileHash); + } // END - if +} // END - if // -?> +?> \ No newline at end of file