Refactor NAS Management: Enforce strict validation and update NAS types list#674
Open
retho-p wants to merge 2 commits intolirantal:masterfrom
Open
Refactor NAS Management: Enforce strict validation and update NAS types list#674retho-p wants to merge 2 commits intolirantal:masterfrom
retho-p wants to merge 2 commits intolirantal:masterfrom
Conversation
- Updated '\' in 'validation.php' to include the comprehensive official list of FreeRADIUS NAS types. - Converted the NAS Type input in 'mng-rad-nas-new.php' and 'mng-rad-nas-edit.php' to a strict HTML '<select>' dropdown. - Reinstated strict server-side validation using 'in_array()' to prevent unauthorized values, falling back to 'other' by default. - Added helpful tooltips to NAS form inputs and updated help pages in lang/en.php.
Review Summary by QodoRefactor NAS management with strict validation and improved UX
WalkthroughsDescription• Updated NAS types list to official FreeRADIUS 3.x comprehensive types • Converted NAS Type input from text with datalist to strict HTML select dropdown • Changed default fallback value from first array element to "other" • Added contextual tooltips to all NAS form fields for better UX • Enhanced help documentation for NAS management pages Diagramflowchart LR
A["NAS Types List"] -->|"Updated to official FreeRADIUS 3.x"| B["validation.php"]
C["Form Inputs"] -->|"Convert to select dropdown"| D["mng-rad-nas-new.php<br/>mng-rad-nas-edit.php"]
E["Default Fallback"] -->|"Changed to 'other'"| D
F["Form Fields"] -->|"Add tooltips"| D
G["Help Pages"] -->|"Enhanced documentation"| H["lang/en.php"]
File Changes1. app/common/includes/validation.php
|
Code Review by Qodo
1.
|
…rwrite When a NAS stored a type not in $valid_nastypes, the select rendered with no matching option and the form would silently save the first option (livingston). Now legacy types are prepended to the select with a "(legacy)" label and accepted by server-side validation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This Pull Request improves the NAS management forms by updating the valid NAS types list and ensuring strict validation.
Changes
$valid_nastypesarray invalidation.phpto use the official FreeRADIUS 3.x list.<select>dropdown inmng-rad-nas-new.phpandmng-rad-nas-edit.php.tooltipText) to all fields in the NAS creation and editing forms.mngradnasnewandmngradnaseditby adding help texts inlang/en.php.