fix(freeradius): replace MySQL SUBSTRING_INDEX with PostgreSQL split_part
This commit is contained in:
@@ -443,7 +443,7 @@ authorize {
|
||||
# Engineers → dynamic pool
|
||||
if (&control:Tmp-String-1 == "engineer") {
|
||||
update control {
|
||||
Pool-Name := "engineers-%{sql:SELECT SUBSTRING_INDEX('%{User-Name}','@',-1)}"
|
||||
Pool-Name := "engineers-%{sql:SELECT split_part('%{User-Name}', '@', 2)}"
|
||||
}
|
||||
}
|
||||
# If you are using /etc/smbpasswd, and are also doing mschap authentication, the un-comment this line, and configure the 'smbpasswd' module.
|
||||
@@ -650,7 +650,7 @@ accounting {
|
||||
|
||||
### rebuild Pool-Name
|
||||
update control {
|
||||
Pool-Name := "engineers-%{sql:SELECT SUBSTRING_INDEX('%{User-Name}','@',-1)}"
|
||||
Pool-Name := "engineers-%{sql:SELECT split_part('%{User-Name}', '@', 2)}"
|
||||
}
|
||||
|
||||
### apply only for engineers
|
||||
|
||||
Reference in New Issue
Block a user