Bug 43526 - Make it possible to disable certain elements of the netlogon script structure
Make it possible to disable certain elements of the netlogon script structure
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Netlogon scripts
UCS@school 4.1
Other Linux
: P5 normal (vote)
: UCS@school 4.1 R2 v10
Assigned To: Daniel Tröder
Sönke Schwardt-Krummrich
:
Depends on:
Blocks: 43729
  Show dependency treegraph
 
Reported: 2017-02-13 00:15 CET by Michel Smidt
Modified: 2017-03-21 12:35 CET (History)
2 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Smidt 2017-02-13 00:15:15 CET
Got this request by customer.
It would be nice to make it possible to disable certain elements of the netlogon script structure by UCR-Vars. E.g. the whole "Eigene Shares" folder, links in the folder (class links, work group links, home share link, marketplace link), drive mappings.
Comment 1 Benjamin Kümmel 2017-02-17 07:29:22 CET
We have tested the given implementation of ucs-school-netlogon-user-logonscripts. On our PC systems the desktop folder with the links the classroom share and the workgroup share works fine. On our thin clients wo got a error message on accesing the folder because of the restricted terminal server enviroment. For security reasons we restrict the user access to the local c: drive by group policies.
To use the links to the shares in our enviroment it will be neccesary that the folder to save the sharelinks in is free configurable. For example "%userprofile%\desktop\" or any other path.
Comment 2 Daniel Tröder univentionstaff 2017-02-28 09:59:55 CET
r77137: allow to set the parent path of the directory with the links:

ucr set ucsschool/userlogon/shares_folder_parent_path='%USERPROFILE%\Desktop'
Comment 3 Daniel Tröder univentionstaff 2017-02-28 15:19:04 CET
r77161:
* support switching off parts of logon script, introducing UCRVs (all create_* by default set to True, disabled_share_links by default empty):
  - ucsschool/userlogon/create_drive_mappings: 
  - ucsschool/userlogon/create_myfiles_link
  - ucsschool/userlogon/create_shortcuts
  - ucsschool/userlogon/create_teacher_umc_link
  - ucsschool/userlogon/disabled_share_links/*

ucsschool/userlogon/disabled_share_links/*: Comma separated list of shares per server for which not to create links. The shares names can contain regular expressions. Example: To prevent the creation of links to shares for the 1st class of the school "GS_Nord" on the server "mydc" and the link to "Marktplatz": ucsschool/userlogon/disabled_share_links/mydc='GS_Nord-1.*,Marktplatz'. The value "all" prevents the creation of all share links.

* refactor more code from generate_windows_link_script into separate methods
* move all VBS code into one template, format and call appropriately
* s/listener.baseConfig/listener.configRegistry/g

Package: ucs-school-netlogon-user-logonscripts
Version: 12.0.4-10.65.201702281511
Branch: ucs_4.1-0
Scope: ucs-school-4.1r2
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2017-03-06 00:49:27 CET
(In reply to Daniel Tröder from comment #3)
> r77161:
> * support switching off parts of logon script, introducing UCRVs (all
> create_* by default set to True, disabled_share_links by default empty):
>   - ucsschool/userlogon/create_drive_mappings: 
>   - ucsschool/userlogon/create_myfiles_link
>   - ucsschool/userlogon/create_shortcuts
>   - ucsschool/userlogon/create_teacher_umc_link

OK

>   - ucsschool/userlogon/disabled_share_links/*
>
> ucsschool/userlogon/disabled_share_links/*: Comma separated list of shares
> per server for which not to create links. The shares names can contain
> regular expressions. Example: To prevent the creation of links to shares for
> the 1st class of the school "GS_Nord" on the server "mydc" and the link to
> "Marktplatz":
> ucsschool/userlogon/disabled_share_links/mydc='GS_Nord-1.*,Marktplatz'. The
> value "all" prevents the creation of all share links.

Substrings have to end with "$" (or better they should be always enclosed by "^" and "$") to prevent matching problems. If only a substring is entered, it may also match to longer share names: e.g. if "Markt" is specified via UCR it would also match to "Marktplatz".

Tested with follwing value to filter out share "Markt" (but not "Marktplatz") and all class shares of second class: "gsmitte-2A" and "gsmitte-2B" but not e.g. "gsmitte-4C":
ucr set ucsschool/userlogon/disabled_share_links/master63='^.*-2.$,^Markt$'

→ fixed UCR variable description in SVN

> * refactor more code from generate_windows_link_script into separate methods

Chapeau! Big code change but the py/vbs code is now much more readable.

> * move all VBS code into one template, format and call appropriately
> * s/listener.baseConfig/listener.configRegistry/g

initialize() checks for templates shortcut-to-share.vbs and teacher-umc-link.vbs ,that have been removed via r77161, and emits an error message in listener.log.
→ fixed via r77368

I noticed that the .ico file for the teacher's UMC link is always missing. Reason is, that _mkdir() copies the ico file to the netlogon directory and afterwards clean() removes all files in that directory. Code has been altered that only files with suffix .vbs (case-insensitive) are removed.
→ fixed via r77359

ucs-school-netlogon-user-logonscripts (12.0.5-2):
r77359 | Bug #43526: only remove VBS files otherwise the icon for teacher's UMC link is always removed
r77358 | Bug #43526: removed check for non-existing VBS templates
r77357 | Bug #43526: fixed UCR variable description

Package: ucs-school-netlogon-user-logonscripts
Version: 12.0.5-2.66.201703060048
Branch: ucs_4.1-0
Scope: ucs-school-4.1r2

OK: YAML
FIXED: code change
FIXED: functional test
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2017-03-21 12:35:55 CET
UCS@school 4.1 R2 v10 has been released.

http://docs.software-univention.de/changelog-ucsschool-4.1R2v10-de.html

If this error occurs again, please clone this bug.