[PATCH] Reduce code duplication in class_environment - [PATCH] Extend features of user templates (Trac: #6032)
From 664cb21b051a21e816564003fb124998b8a621e2 Mon Sep 17 00:00:00 2001 From: Patrick Schoenfeld patrick.schoenfeld@credativ.de Date: Mon, 12 Mar 2012 13:23:04 +0100 Subject: [PATCH] Reduce code duplication in class_environment
-
Partially refactor code in class_environment to avoid duplicating code which expands shares/hotplug devices and scripts from LDAP
-
Add new functions prep_hotplug, prep_share, prep_LogonScript, prep_LogoffScript (using also added prep_script) which take an LDAP entry for the certain type and expands it into the data structure used in the environment class
-
On object initialisation in single edit and multi edit mode use the new functions to process hotplug devices, shares, scripts etc.
-
-
Add missing code in init_multiple_support to properly load single- and multi-used logoff scripts. Fixes bug with missing devices in multi edit mode.
From 0de5102c63dac25379fcf0e2c0f7372d9d9ac0fe Mon Sep 17 00:00:00 2001 From: Patrick Schoenfeld patrick.schoenfeld@credativ.de Date: Fri, 2 Mar 2012 14:18:20 +0100 Subject: [PATCH] Extend features of user templates (Trac: #6032 (closed))
-
Refactor large parts of the environment class to avoid further code duplication for the extension of template features:
- Add a generic method get_attrs_multi which implements the loop used for various multi attributes in a more generic fashion
- Add prep methods, which implement the expanding of LDAP attributes into full-fledged objects, like it is done in various places of the file.
- Add methods to get (expanded) list of printers, hotplug devices, Logon- and logoff-Scripts
- Use these methods wherever possible instead of building the list in-place and thus duplicating code
-
Add a function adapt_from_template which does two things:
- Make sure multi-attributes (gotoPrinter etc.) are not handled by plugin::adapt_from_template which is unable to properly cope with these attributes, especially since incremental template application is wanted
- Merge list of printers, logon-/logoff-scripts and hotplug devices of the objects to which a template is applied, with the corresponding list in the template
(from redmine: issue id 1138, created on 2012-07-04, closed on 2012-11-30)
- Changesets:
- Revision a1f5d5a4 by Benoit MORTIER on 2012-07-04T13:49:05.000Z:
Fixes: #1138 [PATCH] Reduce code duplication in class_environment - [PATCH] Extend features of user templates (Trac: #6032)
- Revision fd473ba0 by Benoit MORTIER on 2012-07-04T13:51:42.000Z:
Fixes: #1138 [PATCH] Reduce code duplication in class_environment - [PATCH] Extend features of user templates (Trac: #6032)
- Custom Fields:
- Bug in version: 1.0.4