X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fgen_sql_patches.php;h=4baf15fa48f0eb3f962e7c80bcfc7f402a279a1e;hp=0903d68470947c1253782fe39a7ee8a4119bfc3b;hb=8e74b561f46f5d90b7fe8c3280ec064ae85df1e9;hpb=963e55ca1ea79e255f235e359cde9f7862191dc5 diff --git a/inc/gen_sql_patches.php b/inc/gen_sql_patches.php index 0903d68470..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