diff --git a/auth_request.php b/auth-request.php similarity index 100% rename from auth_request.php rename to auth-request.php diff --git a/login.php b/login.php index 52524a175..09834b29d 100644 --- a/login.php +++ b/login.php @@ -1,47 +1,10 @@ $value) { - if ($value && $time - $value > $cooldown) { - unset ($fails[$key]); - $updatefails = true; - } - } - if ($updatefails) { - $failtext = implode("\n", $fails); - fileWrite($failfile, $failtext); - } - - if (count($fails) >= $maxfails) { - $error = 'Too many invalid login attempts'; - if (count($fails) == $maxfails) - exec("logger -t webGUI ".escapeshellarg("Ignoring login attempts for {$_POST['username']} from {$remote_addr}")); - - } else { - - // User Login attempt - foreach (file('/etc/nginx/htpasswd') as $strCredentials) { - list($user,$pwhash) = explode(':', trim($strCredentials)); - - // Validate credentials - if ($_POST['username'] == $user && password_verify($_POST['password'], $pwhash)) { - // Successful login, start session - @unlink($failfile); - session_start(); - $_SESSION['unraid_login'] = time(); - $_SESSION['unraid_user'] = $_POST['username']; - session_regenerate_id(true); - session_write_close(); - exec("logger -t webGUI ".escapeshellarg("Successful login user {$_POST['username']} from {$remote_addr}")); - header("Location: /".$var['START_PAGE']); - exit; - } - } - - // Invalid login - $error = 'Invalid Username or Password'; - exec("logger -t webGUI ".escapeshellarg("Unsuccessful login user {$_POST['username']} from {$remote_addr}")); - - } - fileAppend($failfile, $time."\n"); + $error = _('Successfully logged out'); } - -$boot = "/boot/config/plugins/dynamix"; -$myfile = "case-model.cfg"; -$mycase = file_exists("$boot/$myfile") ? file_get_contents("$boot/$myfile") : false; - -extract(parse_plugin_cfg('dynamix',true)); -$theme_dark = in_array($display['theme'],['black','gray']); +$result = exec( "/usr/bin/passwd --status root"); +if (($result === false) || (substr($result, 0, 6) !== "root P")) + include("$docroot/webGui/include/set-password.php"); +else + include("$docroot/webGui/include/login.php"); ?> - - -
- - - - - - - - - - -Please set a password for the root user account. Maximum length is 128 characters.
+