mirror of
https://github.com/opnsense/plugins.git
synced 2026-06-03 13:59:06 -04:00
www/web-proxy-useracl: merge version 0.0.2 from master
This commit is contained in:
parent
9945b22e81
commit
1d4262579e
3 changed files with 6 additions and 6 deletions
|
|
@ -1,5 +1,5 @@
|
|||
PLUGIN_NAME= web-proxy-useracl
|
||||
PLUGIN_VERSION= 0.0.1
|
||||
PLUGIN_VERSION= 0.0.2
|
||||
PLUGIN_COMMENT= Group and user ACL for the web proxy
|
||||
PLUGIN_MAINTAINER= kekek2@ya.ru
|
||||
PLUGIN_WWW= http://smart-soft.ru
|
||||
|
|
|
|||
|
|
@ -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" : ""));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(",") %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue