+++ /dev/null
-# The software in this package is distributed under the GNU General
-# Public License version 2 (with a special exception described below).
-#
-# A copy of GNU General Public License (GPL) is included in this distribution,
-# in the file COPYING.GPL.
-#
-# As a special exception, if other files instantiate templates or use macros
-# or inline functions from this file, or you compile this file and link it
-# with other works to produce a work based on this file, this file
-# does not by itself cause the resulting work to be covered
-# by the GNU General Public License.
-#
-# However the source code for this file must still be made available
-# in accordance with section (3) of the GNU General Public License.
-#
-# This exception does not invalidate any other reasons why a work based
-# on this file might be covered by the GNU General Public License.
-#
-# Copyright (c) 2016-2018 Intra2net AG <info@intra2net.com>
-
-"""
-.. note:: DEPRECATED! Please do not extend this or add new uses of this module,
- use :py:mod:`pyi2ncommon.arnied_api` or :py:mod:`pyi2ncommon.cnfvar`
- instead!
-"""
-
-from .build_cnfvar import BuildCnfVar
-"""Class to configure the webfilter cnfvars on the fly"""
-
-
-class ConfigureWebfilter(BuildCnfVar):
- def __init__(self, enabled='1', line_no=1):
- BuildCnfVar.__init__(self, 'PROXY_WEBFILTER_ENABLE',
- 0, enabled, line_no)
-
- def block_drugs(self, enabled='1'):
- line_no = self.update_cnf('PROXY_WEBFILTER_BLOCK_DRUGS', 0, enabled)
- self.mark_as_own_parent(line_no)
- return self
-
- def block_gambling(self, enabled='1'):
- line_no = self.update_cnf('PROXY_WEBFILTER_BLOCK_GAMBLING', 0, enabled)
- self.mark_as_own_parent(line_no)
- return self
-
- def block_pornography(self, enabled='1'):
- line_no = self.update_cnf('PROXY_WEBFILTER_BLOCK_PORNOGRAPHY',
- 0, enabled)
- self.mark_as_own_parent(line_no)
- return self
-
- def block_violence(self, enabled='1'):
- line_no = self.update_cnf('PROXY_WEBFILTER_BLOCK_VIOLENCE', 0, enabled)
- self.mark_as_own_parent(line_no)
- return self
-
- def block_warez(self, enabled='1'):
- line_no = self.update_cnf('PROXY_WEBFILTER_BLOCK_WAREZ', 0, enabled)
- self.mark_as_own_parent(line_no)
- return self
-
- def add_pass_site(self, url):
- sites_parent = self.update_cnf('PROXY_WEBFILTER_PASS_SITES', 0, '')
- self.mark_as_own_parent(sites_parent)
-
- self.add_cnf('PROXY_WEBFILTER_PASS_SITES_URL', -1, url, sites_parent)
- return self
-
- def clear_pass_sites(self):
- self.del_cnf('PROXY_WEBFILTER_PASS_SITES_URL')
- self.del_cnf('PROXY_WEBFILTER_PASS_SITES')
- return self