Univention Bugzilla – Attachment 5875 Details for
Bug 34557
Not possible to add one internet rule to multiple computer rooms
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
First version of a possible patch (UNTESTED!)
bug34557.patch (text/plain), 2.67 KB, created by
Sönke Schwardt-Krummrich
on 2014-04-15 18:00:55 CEST
(
hide
)
Description:
First version of a possible patch (UNTESTED!)
Filename:
MIME Type:
Creator:
Sönke Schwardt-Krummrich
Created:
2014-04-15 18:00:55 CEST
Size:
2.67 KB
patch
obsolete
>--- a/ucs-school-3.2r2/ucs-school-webproxy/conffiles/ucs-school-webproxy.py >+++ b/ucs-school-3.2r2/ucs-school-webproxy/conffiles/ucs-school-webproxy.py >@@ -132,8 +132,8 @@ def createTemporaryConfig(fn_temp_config, configRegistry, DIR_TEMP): > proxy_settinglist.add(match.group(1)) > proxy_settinglist = list(proxy_settinglist) > >- roomIPs = {} # { 'theBigRoom': ['127.0.0.1', '127.4.5.7'] } >- roomRule = {} # { 'kmiyagi': 'theBigRoom' } >+ roomIPs = {} # { 'theBigRoom': ['127.0.0.1', '127.4.5.7'], 'otherRoom': ['127.2.3.4'] } >+ roomRule = {} # { 'kmiyagi': ['theBigRoom', 'otherRoom'] } > roomRules = [] # [ 'kmiyagi' ] > for key in keylist: > if key.startswith('proxy/filter/room/'): >@@ -143,7 +143,7 @@ def createTemporaryConfig(fn_temp_config, configRegistry, DIR_TEMP): > if parts[-1] == 'ip': > roomIPs[room] = configRegistry[key].split() > elif parts[-1] == 'rule': >- roomRule[configRegistry[key]] = room >+ roomRule.setdefault(configRegistry[key], []).append(room) > if room not in roomIPs: > roomIPs[room] = [] > elif key.startswith('proxy/filter/setting-user/'): >@@ -229,20 +229,21 @@ def createTemporaryConfig(fn_temp_config, configRegistry, DIR_TEMP): > 'blacklist-pass': > '!blacklist-%(username)s all\n', > } >- for (username, room, ) in roomRule.items(): >- if username in roomRules: >- filtertype = configRegistry.get('proxy/filter/setting-user/%s/filtertype' % (username, ), 'whitelist-blacklist-pass') >- username = quote(username) + '-user' >- elif username in proxy_settinglist: >- filtertype = configRegistry.get('proxy/filter/setting/%s/filtertype' % (username, ), 'whitelist-blacklist-pass') >- username = quote(username) >- else: >- continue >- if filtertype in RULES: >- f.write(' room-%s {\n' % (quote(room), )) >- f.write(' pass %s\n' % (RULES[filtertype] % {'username': username, })) >- f.write(' redirect %s\n' % default_redirect) >- f.write(' }\n') >+ for (username, rooms, ) in roomRule.items(): >+ for room in rooms: >+ if username in roomRules: >+ filtertype = configRegistry.get('proxy/filter/setting-user/%s/filtertype' % (username, ), 'whitelist-blacklist-pass') >+ username = quote(username) + '-user' >+ elif username in proxy_settinglist: >+ filtertype = configRegistry.get('proxy/filter/setting/%s/filtertype' % (username, ), 'whitelist-blacklist-pass') >+ username = quote(username) >+ else: >+ continue >+ if filtertype in RULES: >+ f.write(' room-%s {\n' % (quote(room), )) >+ f.write(' pass %s\n' % (RULES[filtertype] % {'username': username, })) >+ f.write(' redirect %s\n' % default_redirect) >+ f.write(' }\n') > > # acl usergroup > for (priority, usergroupname, proxy_setting, ) in reversed(sorted(usergroupSetting)):
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 34557
:
5875
|
5889