_('root requires a password'), 'mismatch' => _('Password confirmation does not match'), 'maxLength' => _('Max password length is 128 characters'), 'saveError' => _('Unable to set password'), ]; $POST_ERROR = ''; /** * POST handler */ if (!empty($_POST['password']) && !empty($_POST['confirmPassword'])) { if ($_POST['password'] !== $_POST['confirmPassword']) return $POST_ERROR = $VALIDATION_MESSAGES['mismatch']; if (strlen($_POST['password']) > $MAX_PASS_LENGTH) return $POST_ERROR = $VALIDATION_MESSAGES['maxLength']; $userName = 'root'; $userPassword = base64_encode($_POST['password']); exec("/usr/local/sbin/emcmd 'cmdUserEdit=Change&userName=$userName&userPassword=$userPassword'", $output, $result); if ($result == 0) { // PAM service will log to syslog: "password changed for root" if (session_status()==PHP_SESSION_NONE) session_start(); $_SESSION['unraid_login'] = time(); $_SESSION['unraid_user'] = 'root'; session_regenerate_id(true); session_write_close(); // Redirect the user to the start page header("Location: /".$start_page); exit; } // Error when attempting to set password my_logger("{$VALIDATION_MESSAGES['saveError']} [REMOTE_ADDR]: {$REMOTE_ADDR}"); return $POST_ERROR = $VALIDATION_MESSAGES['saveError']; } require_once "$docroot/plugins/dynamix/include/ThemeHelper.php"; $themeHelper = new ThemeHelper($display['theme']); $isDarkTheme = $themeHelper->isDarkTheme(); ?> <?=$var['NAME']?>/SetPassword

.

.