From c867de95dc804de2fae0eee0d0e30cbebf171b5c Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Fri, 19 Jul 2024 06:53:09 -0700 Subject: [PATCH] Create user encryptionkey if not exist. (this is for old sites) --- Rocksolid_Light/rocksolid/newsportal.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index 31999e6..d44fc89 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -1280,6 +1280,15 @@ function group_display_name($gname) } function set_user_logged_in_cookies($name, $keys) { + + global $debug_log; + if( !get_user_config($name, 'encryptionkey')) { + $key = openssl_random_pseudo_bytes(44); + set_user_config($name, 'encryptionkey', base64_encode($key)); + file_put_contents($debug_log, "\n" . logging_prefix() . " Created encryptionkey for: " . $name, FILE_APPEND); + + } + $name = trim($name); $auth_expire = 14400; $authkey = password_hash($name . $keys[0] . get_user_config($name, 'encryptionkey'), PASSWORD_DEFAULT);