If no regkey use 'Tools>Registration' as start page

This commit is contained in:
Tom Mortensen
2024-02-01 14:41:18 -08:00
parent 4e71349cf2
commit b8844dcedb
3 changed files with 8 additions and 4 deletions
+3
View File
@@ -27,6 +27,9 @@ if ($_SERVER['REQUEST_URI'] == '/logout') {
$error = _('Successfully logged out'); $error = _('Successfully logged out');
} }
// If issue with license key redirect to Tools/Registration, otherwise go to start page
$start_page = (!empty(_var($var,'regCheck'))) ? 'Tools/Registration' : _var($var,'START_PAGE','Main');
$result = exec( "/usr/bin/passwd --status root"); $result = exec( "/usr/bin/passwd --status root");
if (($result === false) || (substr($result, 0, 6) !== "root P")) if (($result === false) || (substr($result, 0, 6) !== "root P"))
include "$docroot/webGui/include/.set-password.php"; include "$docroot/webGui/include/.set-password.php";
+3 -3
View File
@@ -9,8 +9,8 @@ if (!empty($_COOKIE['unraid_'.md5($server_name)])) {
// Check if the user is already logged in // Check if the user is already logged in
if ($_SESSION && !empty($_SESSION['unraid_user'])) { if ($_SESSION && !empty($_SESSION['unraid_user'])) {
// If so redirect them to the start page // Redirect the user to the start page
header("Location: /".$var['START_PAGE']); header("Location: /".$start_page);
exit; exit;
} }
} }
@@ -219,7 +219,7 @@ if (!empty($username) && !empty($password)) {
exec("logger -t webGUI -- \"Successful login user {$username} from {$remote_addr}\""); exec("logger -t webGUI -- \"Successful login user {$username} from {$remote_addr}\"");
// Redirect the user to the start page // Redirect the user to the start page
header("Location: /".$var['START_PAGE']); header("Location: /".$start_page);
exit; exit;
} catch (Exception $exception) { } catch (Exception $exception) {
// Set error message // Set error message
@@ -30,7 +30,8 @@ if (!empty($_POST['password']) && !empty($_POST['confirmPassword'])) {
session_regenerate_id(true); session_regenerate_id(true);
session_write_close(); session_write_close();
header("Location: /".$var['START_PAGE']); // Redirect the user to the start page
header("Location: /".$start_page);
exit; exit;
} }