1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 15:47:00 +02:00

Notify user about expired master password for permanent login

This commit is contained in:
Jakub Vrana
2013-06-11 11:02:17 +02:00
parent 64297aea60
commit f29a7cb140
8 changed files with 20 additions and 9 deletions

View File

@@ -912,9 +912,10 @@ function apply_sql_function($function, $column) {
}
/** Read password from file adminer.key in temporary directory or create one
* @param bool
* @return string or false if the file can not be created
*/
function password_file() {
function password_file($create) {
$dir = ini_get("upload_tmp_dir"); // session_save_path() may contain other storage path
if (!$dir) {
if (function_exists('sys_get_temp_dir')) {
@@ -930,7 +931,7 @@ function password_file() {
}
$filename = "$dir/adminer.key";
$return = @file_get_contents($filename); // @ - can not exist
if ($return) {
if ($return || !$create) {
return $return;
}
$fp = @fopen($filename, "w"); // @ - can have insufficient rights //! is not atomic