mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
Change ACL name (#355)
This commit is contained in:
committed by
Franco Fichtner
parent
3d9195ec6e
commit
4f6cdcd505
@@ -37,9 +37,9 @@ use \OPNsense\Core\Config;
|
||||
$mdlProxyUserACL = new ProxyUserACL();
|
||||
$domain = strtoupper((string) Config::getInstance()->object()->system->domain);
|
||||
|
||||
array_map('unlink', glob("/usr/local/etc/squid/ACL_*.txt"));
|
||||
array_map('unlink', glob("/usr/local/etc/squid/ACL_useracl_*.txt"));
|
||||
foreach ($mdlProxyUserACL->getNodeByReference('general.ACLs.ACL')->getNodes() as $acl) {
|
||||
file_put_contents("/usr/local/etc/squid/ACL_" .
|
||||
file_put_contents("/usr/local/etc/squid/ACL_useracl_" .
|
||||
$acl["Priority"] . ".txt", $acl["Name"] . "\n" .
|
||||
($acl["Group"]["user"]["selected"] == "1" ? $acl["Name"] . "@" . $domain . "\n" : ""));
|
||||
}
|
||||
|
||||
+3
-3
@@ -30,16 +30,16 @@ external_acl_type ext_ldap_{{ ACL.Priority }}_{{ loop.index }} ttl=300 negative_
|
||||
{% else %}
|
||||
external_acl_type ext_ldap_{{ ACL.Priority }}_{{ loop.index }} ttl=300 negative_ttl=60 %LOGIN /usr/local/libexec/squid/ext_ldap_group_acl -R -b "{{ldap[0].ldap_basedn}}" -f "(&({{ldap[0].ldap_attr_user}}=%u)(memberOf=cn=%a,{{authcn}}))" -D "{{ldap[0].ldap_binddn}}" -w "{{ldap[0].ldap_bindpw}}" -p "{{ldap[0].ldap_port}}" "{{ldap[0].host}}"
|
||||
{% endif %}
|
||||
acl group_ldap_{{ACL.Priority}}_{{ loop.index }} external ext_ldap_{{ ACL.Priority }}_{{ loop.index }} "/usr/local/etc/squid/ACL_{{ ACL.Priority }}.txt"
|
||||
acl group_ldap_{{ACL.Priority}}_{{ loop.index }} external ext_ldap_{{ ACL.Priority }}_{{ loop.index }} "/usr/local/etc/squid/ACL_useracl_{{ ACL.Priority }}.txt"
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if local|length == 1 %}
|
||||
external_acl_type ext_group_local_{{ ACL.Priority }} ttl=300 negative_ttl=60 %LOGIN /usr/local/libexec/squid/ext_unix_group_acl -p
|
||||
acl group_local_{{ACL.Priority}} external ext_group_local_{{ ACL.Priority }} "/usr/local/etc/squid/ACL_{{ ACL.Priority }}.txt"
|
||||
acl group_local_{{ACL.Priority}} external ext_group_local_{{ ACL.Priority }} "/usr/local/etc/squid/ACL_useracl_{{ ACL.Priority }}.txt"
|
||||
{% endif %}
|
||||
{% else %}
|
||||
acl user_{{ACL.Priority}} proxy_auth "/usr/local/etc/squid/ACL_{{ ACL.Priority }}.txt"
|
||||
acl user_{{ACL.Priority}} proxy_auth "/usr/local/etc/squid/ACL_useracl_{{ ACL.Priority }}.txt"
|
||||
{% endif %}
|
||||
{% if ldap|length == 1 or local|length == 1 %}
|
||||
{% for element in ACL.Domains.split(",") %}
|
||||
|
||||
Reference in New Issue
Block a user