Commit da3c257
fix(employees): apply defaults and auto-generate SIP password on bulk import (#996)
CSV bulk import created broken extensions: rows with empty sip_secret
column failed validation, and even rows with passwords could not
authenticate because Asterisk silently rejected endpoints with empty
dtmf_mode/transport enum values.
Root cause: SaveEmployeeAction (legacy bulk path) and SaveRecordAction
(REST POST path) both required sip_secret as a hard pre-validation field
and never invoked DataStructure::applyDefaults() during create. CSV rows
without these columns landed in DB with NULL dtmfmode, generated
"dtmf_mode = " in pjsip.conf, and res_pjsip discarded the whole endpoint.
Fixes:
- SaveEmployeeAction::prepareData() now applies DataStructure defaults
on create and auto-generates sip_secret via Sip::generateSipPassword()
when missing, mirroring DataStructure::createForNewEmployee() used by
the manual form.
- SaveRecordAction::main() auto-generates sip_secret in Phase 1 before
required-field validation (the required rule on sip_secret is now
obsolete and removed).
- Frontend extensions-bulk-upload.js updateRowStatus() surfaces the
backend error message inline in the import preview row instead of
hiding it in the browser console; message is HTML-escaped via
jQuery .text() to prevent XSS.1 parent 960712b commit da3c257
4 files changed
Lines changed: 44 additions & 11 deletions
File tree
- sites/admin-cabinet/assets/js
- pbx/Extensions
- src/Extensions
- src/PBXCoreREST/Lib/Employees
Lines changed: 14 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1022 | 1022 | | |
1023 | 1023 | | |
1024 | 1024 | | |
1025 | | - | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
1026 | 1035 | | |
1027 | 1036 | | |
1028 | 1037 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
142 | 154 | | |
143 | 155 | | |
144 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
103 | 110 | | |
104 | 111 | | |
105 | 112 | | |
| |||
120 | 127 | | |
121 | 128 | | |
122 | 129 | | |
123 | | - | |
124 | 130 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
0 commit comments