View | Details | Raw Unified | Return to bug 41231 | Differences between
and this patch

Collapse All | Expand All

(-)doc/manual/import-hooks-de.xml (-1 / +9 lines)
 Lines 116-127    Link Here 
116
	  zugeordnet wird.
116
	  zugeordnet wird.
117
	</para>
117
	</para>
118
	<para>
118
	<para>
119
	  Über drei weitere &ucsUCR;-Variablen kann das Verhalten des Hooks gesteuert
119
	  Über vier weitere &ucsUCR;-Variablen kann das Verhalten des Hooks gesteuert
120
	  werden:
120
	  werden:
121
	</para>
121
	</para>
122
	  <itemizedlist>
122
	  <itemizedlist>
123
		<listitem>
123
		<listitem>
124
		  <para>
124
		  <para>
125
			<command>ucsschool/import/generate/share/marktplatz/name</command>
126
		  </para>
127
		  <para>
128
			Diese Variable definiert den Namen der Freigabe. Der Standard ist <literal>Marktplatz</literal>.
129
		  </para>
130
		</listitem>
131
		<listitem>
132
		  <para>
125
			<command>ucsschool/import/generate/share/marktplatz/sharepath</command>
133
			<command>ucsschool/import/generate/share/marktplatz/sharepath</command>
126
		  </para>
134
		  </para>
127
		  <para>
135
		  <para>
(-)doc/manual/performance-de.xml (+4 lines)
 Lines 93-98    Link Here 
93
  		  </simpara>
93
  		  </simpara>
94
  		</listitem>
94
  		</listitem>
95
  	  </itemizedlist>
95
  	  </itemizedlist>
96
  	  <note>
97
  	    Der Teil des Gruppennamens der hier &lt;Edukativnetz&gt; ist, kann seit &ucsUAS;-Version 4.1 R2 v7
98
  	    verändert werden. Siehe dazu auch <xref linkend="structure:ldap:container_names"/>.
99
  	  </note>
96
  	</para>
100
  	</para>
97
    </section>
101
    </section>
98
  
102
  
(-)doc/manual/setup-school-generic-de.xml (-17 / +23 lines)
 Lines 39-52    Link Here 
39
            Zugriffsrechte gesetzt werden. Dabei kann der Zugriff für einzelne Benutzer oder ganze Gruppen
39
            Zugriffsrechte gesetzt werden. Dabei kann der Zugriff für einzelne Benutzer oder ganze Gruppen
40
            erlaubt bzw. gesperrt werden. Um den Schülern den Zugriff auf die physikalischen Drucker zu
40
            erlaubt bzw. gesperrt werden. Um den Schülern den Zugriff auf die physikalischen Drucker zu
41
            verbieten, muss an den Druckerfreigaben für diese Drucker der Zugriff durch Benutzer der
41
            verbieten, muss an den Druckerfreigaben für diese Drucker der Zugriff durch Benutzer der
42
            OU-spezifischen Gruppe
42
            OU-spezifischen Gruppe <systemitem class="groupname">schueler-<replaceable>OU</replaceable></systemitem>
43
            <systemitem class="groupname">schueler-
43
            (z.B. <systemitem class="groupname">schueler-gsmitte</systemitem>) verboten werden. Für den PDF-Drucker
44
                <replaceable>OU</replaceable>
44
            <systemitem class="resource">PDFDrucker</systemitem> sollten keine Einschränkungen gemacht werden.
45
            </systemitem>
45
            <note>
46
            > (z.B. <systemitem class="groupname">schueler-gsmitte</systemitem>)
46
                Der Teil des Gruppennamens der hier &lt;schueler-&gt; ist, kann seit &ucsUAS;-Version 4.1 R2 v7 verändert
47
            verboten werden. Für den PDF-Drucker <systemitem class="resource">PDFDrucker</systemitem> sollten keine
47
                werden. Siehe dazu auch <xref linkend="structure:ldap:container_names"/>.
48
            Einschränkungen
48
            </note>
49
            gemacht werden.
50
        </para>
49
        </para>
51
        <para>
50
        <para>
52
            Schüler haben damit nur noch die Möglichkeit Druckaufträge an den
51
            Schüler haben damit nur noch die Möglichkeit Druckaufträge an den
 Lines 228-233    Link Here 
228
            Anlegen einer OU kann durch das Setzen der &ucsUCRV;
227
            Anlegen einer OU kann durch das Setzen der &ucsUCRV;
229
            <envar>ucsschool/import/generate/marktplatz</envar> auf den
228
            <envar>ucsschool/import/generate/marktplatz</envar> auf den
230
            Wert <literal>no</literal> verhindert werden.
229
            Wert <literal>no</literal> verhindert werden.
230
            <note>
231
                Weiterführnde Informationen zur <emphasis>Marktplatz</emphasis>-Freigabe finden sich unter <xref linkend="import:marketplace"/>.
232
            </note>
231
        </para>
233
        </para>
232
        <para>
234
        <para>
233
            Diese Freigaben müssen zwingend auf dem Schulserver bereitgestellt
235
            Diese Freigaben müssen zwingend auf dem Schulserver bereitgestellt
 Lines 280-285    Link Here 
280
            Die Freigabe erlaubt der Gruppe <systemitem class="resource">lehrer-&lt;OU&gt;</systemitem> den
282
            Die Freigabe erlaubt der Gruppe <systemitem class="resource">lehrer-&lt;OU&gt;</systemitem> den
281
            administrativen
283
            administrativen
282
            Zugriff auf das Basisverzeichnis <filename class="directory">/home/&lt;OU&gt;/schueler</filename>.
284
            Zugriff auf das Basisverzeichnis <filename class="directory">/home/&lt;OU&gt;/schueler</filename>.
285
            <note>
286
                Der Teil des Gruppennamens der hier &lt;schueler-&gt; bzw.&lt;lehrer-&gt; ist, kann seit
287
                &ucsUAS;-Version 4.1 R2 v7 verändert werden. Siehe dazu auch <xref linkend="structure:ldap:container_names"/>.
288
            </note>
283
        </para>
289
        </para>
284
        <para>
290
        <para>
285
            Per Voreinstellung wird der Lehrergruppe Lesezugriff gewährt.
291
            Per Voreinstellung wird der Lehrergruppe Lesezugriff gewährt.
 Lines 310-332    Link Here 
310
            Option zu Schuladministratoren umgewandelt werden.
316
            Option zu Schuladministratoren umgewandelt werden.
311
            <itemizedlist>
317
            <itemizedlist>
312
                <listitem>
318
                <listitem>
313
                    <simpara>
319
                    <para>
314
                        Die zusätzliche Gruppenmitgliedschaft muss manuell über das &ucsUMC;-Modul
320
                        Die zusätzliche Gruppenmitgliedschaft muss manuell über das &ucsUMC;-Modul
315
                        <guimenu>Benutzer</guimenu>
321
                        <guimenu>Benutzer</guimenu> auf dem &ucsMaster; hinzugefügt werden. Auf dem Reiter
316
                        auf dem &ucsMaster; hinzugefügt werden. Auf dem Reiter
322
                        <guimenu>Gruppen</guimenu> muss das Benutzerkonto in die Gruppe
317
                        <guimenu>Gruppen</guimenu>
318
                        muss das Benutzerkonto in die Gruppe
319
                        <systemitem class="groupname"><replaceable>admins-OU</replaceable></systemitem>
323
                        <systemitem class="groupname"><replaceable>admins-OU</replaceable></systemitem>
320
                        (für die OU <wordasword>gym17</wordasword> ist dies die Gruppe
324
                        (für die OU <wordasword>gym17</wordasword> ist dies die Gruppe
321
                        <systemitem class="groupname">admins-gym17</systemitem>) aufgenommen werden.
325
                        <systemitem class="groupname">admins-gym17</systemitem>) aufgenommen werden.
322
                    </simpara>
326
                        <note>
327
                            Der Teil des Gruppennamens der hier &lt;admins-&gt; ist, kann seit &ucsUAS;-Version 4.1 R2 v7
328
                            verändert werden. Siehe dazu auch <xref linkend="structure:ldap:container_names"/>.
329
                        </note>
330
                    </para>
323
                </listitem>
331
                </listitem>
324
                <listitem>
332
                <listitem>
325
                    <simpara>
333
                    <simpara>
326
                        Im &ucsUMC;-Modul <guimenu>Benutzer</guimenu> muss außerdem im Reiter
334
                        Im &ucsUMC;-Modul <guimenu>Benutzer</guimenu> muss außerdem im Reiter
327
                        <guimenu>Optionen</guimenu>
335
                        <guimenu>Optionen</guimenu> die Option <option>UCS@school-Administrator</option>
328
                        die Option
329
                        <option>UCS@school-Administrator</option>
330
                        eingeschaltet werden.
336
                        eingeschaltet werden.
331
                    </simpara>
337
                    </simpara>
332
                </listitem>
338
                </listitem>
(-)doc/manual/structure-de.xml (+78 lines)
 Lines 329-334    Link Here 
329
		</note>
329
		</note>
330
	  </section>
330
	  </section>
331
331
332
	  <section id="structure:ldap:container_names">
333
		<title>Gruppen-, Verzeichnis- und Containernamen</title>
334
		  <para>
335
		    Seit &ucsUAS;-Version 4.1 R2 v7 können mit Hilfe von UCR-Variablen Teile der Gruppen-, Verzeichnis- und Containernamen
336
		    <emphasis>vor der Installation der &ucsUAS;-App</emphasis> bestimmt werden.
337
		  </para>
338
		  <para>
339
			Beispielsweise wird die Gruppe <systemitem class="groupname">Member-Edukativnetz</systemitem> durch Setzen
340
			der UCR-Variablen <envar>ucsschool/ldap/default/groupname/all-educational-member=Membre-Enseignement</envar>
341
			mit dem Namen <systemitem class="groupname">Membre-Enseignement</systemitem> angelegt.
342
		  </para>
343
		  <para>
344
			  Sollen zum Beispiel die Benutzerkonten von Schülern nicht im Container
345
			  <uri>cn=schueler,cn=groups,ou=gymmitte,dc=example,dc=com</uri> gespeichert werden, sondern unter
346
			  <uri>cn=ecolier,cn=groups,ou=gymmitte,dc=example,dc=com</uri>, muss
347
			  <envar>ucsschool/ldap/default/container/pupils=ecolier</envar> gesetzt werden.
348
		  </para>
349
		  <para>
350
			  Die Bedeutung der aller UCR-Variablen können Sie durch das Lesen der Hilfetexte zu den UCR-Variablen erfahren
351
			  (siehe <biblioref linkend="ucs-handbuch"/>).
352
		  </para>
353
		  <para>
354
			  <simpara>
355
				Die folgenden Teile von Containernamen (z.B. in <uri>cn=admins,cn=groups,ou=gymmitte,dc=example,dc=com</uri>) können gesetzt werden:
356
			  </simpara>
357
			  <itemizedlist>
358
				  <listitem><simpara>admins:                 <envar>ucsschool/ldap/default/container/admins</envar></simpara></listitem>
359
				  <listitem><simpara>schueler:               <envar>ucsschool/ldap/default/container/pupils</envar></simpara></listitem>
360
				  <listitem><simpara>mitarbeiter:            <envar>ucsschool/ldap/default/container/staff</envar></simpara></listitem>
361
				  <listitem><simpara>lehrer und mitarbeiter: <envar>ucsschool/ldap/default/container/teachers-and-staff</envar></simpara></listitem>
362
				  <listitem><simpara>lehrer:                 <envar>ucsschool/ldap/default/container/teachers</envar></simpara></listitem>
363
				  <listitem><simpara>klassen:                <envar>ucsschool/ldap/default/container/class</envar></simpara></listitem>
364
				  <listitem><simpara>raeume:                 <envar>ucsschool/ldap/default/container/rooms</envar></simpara></listitem>
365
				  <listitem><simpara>examusers:              <envar>ucsschool/ldap/default/container/exam</envar></simpara></listitem>
366
			  </itemizedlist>
367
		  </para>
368
		  <para>
369
			  <simpara>
370
				Die folgenden Präfixe von Gruppennamen (z.B. in <systemitem class="groupname">schueler-gymmitte</systemitem>) können gesetzt werden:
371
			  </simpara>
372
			  <itemizedlist>
373
				  <listitem><simpara>schueler-:              <envar>ucsschool/ldap/default/groupprefix/pupils</envar></simpara></listitem>
374
				  <listitem><simpara>lehrer-:                <envar>ucsschool/ldap/default/groupprefix/teachers</envar></simpara></listitem>
375
				  <listitem><simpara>admins-:                <envar>ucsschool/ldap/default/groupprefix/admins</envar></simpara></listitem>
376
				  <listitem><simpara>mitarbeiter-:           <envar>ucsschool/ldap/default/groupprefix/staff</envar></simpara></listitem>
377
			  </itemizedlist>
378
			  <simpara>
379
				  Die folgenden Gruppennamen können per UCR gesetzt werden. Bei Namen die <replaceable>%(ou)s</replaceable> enthalten
380
				  wird dieses vom System durch das jeweilige Schulkürzel ersetzt (z.B. <uri>gymmitte</uri> in
381
				  <systemitem class="groupname">OUgymmitte-DC-Edukativnetz</systemitem>).
382
			  </simpara>
383
			  <itemizedlist>
384
				  <listitem><simpara>DC-Edukativnetz:                 <envar>ucsschool/ldap/default/groupname/all-educational-dc</envar></simpara></listitem>
385
				  <listitem><simpara>Member-Edukativnetz:             <envar>ucsschool/ldap/default/groupname/all-educational-member</envar></simpara></listitem>
386
				  <listitem><simpara>DC-Verwaltungsnetz:              <envar>ucsschool/ldap/default/groupname/all-administrativ-dc</envar></simpara></listitem>
387
				  <listitem><simpara>Member-Verwaltungsnetz:          <envar>ucsschool/ldap/default/groupname/all-administrativ-member</envar></simpara></listitem>
388
				  <listitem><simpara>OU%(ou)s-DC-Edukativnetz:        <envar>ucsschool/ldap/default/groupname/ou-educational-dc</envar></simpara></listitem>
389
				  <listitem><simpara>OU%(ou)s-Member-Edukativnetz:    <envar>ucsschool/ldap/default/groupname/ou-educational-member</envar></simpara></listitem>
390
				  <listitem><simpara>OU%(ou)s-DC-Verwaltungsnetz:     <envar>ucsschool/ldap/default/groupname/ou-administrativ-dc</envar></simpara></listitem>
391
				  <listitem><simpara>OU%(ou)s-Member-Verwaltungsnetz: <envar>ucsschool/ldap/default/groupname/ou-administrativ-member</envar></simpara></listitem>
392
				  <listitem><simpara>OU%(ou)s-Klassenarbeit:          <envar>ucsschool/ldap/default/groupname/exam</envar></simpara></listitem>
393
			  </itemizedlist>
394
			  <simpara>
395
				  Die folgenden Verzeichnisnamen können per UCR gesetzt werden (z.B. <envar>klassen</envar> in <filename class="directory">/home/groups/klassen/3b</filename>):
396
			  </simpara>
397
			  <itemizedlist>
398
				  <listitem><simpara>klassen:                <envar>ucsschool/ldap/default/share/class</envar></simpara></listitem>
399
				  <listitem><simpara>schueler:               <envar>ucsschool/ldap/default/share/pupils</envar></simpara></listitem>
400
				  <listitem><simpara>lehrer:                 <envar>ucsschool/ldap/default/share/teachers</envar></simpara></listitem>
401
				  <listitem><simpara>Unterrichtsmaterial:    <envar>ucsschool/datadistribution/datadir/sender</envar></simpara></listitem>
402
				  <listitem><simpara>Unterrichtsmaterial:    <envar>ucsschool/datadistribution/datadir/recipient</envar></simpara></listitem>
403
				  <listitem><simpara>Klassenarbeiten:        <envar>ucsschool/ldap/default/share/exams</envar></simpara></listitem>
404
				  <listitem><simpara>schueler, lehrer, mitarbeiter:  <envar>ucsschool/import/roleshare/.*/path</envar></simpara></listitem>
405
				  <listitem><simpara>Marktplatz:             <envar>ucsschool/import/generate/share/marktplatz/name</envar></simpara></listitem>
406
			  </itemizedlist>
407
		  </para>
408
	  </section>
409
332
	  <section id="structure:ldap:global">
410
	  <section id="structure:ldap:global">
333
		<title>Weitere &ucsUAS;-Objekte</title>
411
		<title>Weitere &ucsUAS;-Objekte</title>
334
		<para>
412
		<para>
(-)ucs-school-import/debian/ucs-school-import.univention-config-registry-variables (-21 / +123 lines)
 Lines 4-57    Link Here 
4
Type=str
4
Type=str
5
Categories=ucsschool-base
5
Categories=ucsschool-base
6
6
7
[ucsschool/ldap/default/container/admins]
8
Description[de]=Standard-Container-Name für Administratoren. Standard ist "admins".
9
Description[en]=Default container name for administrators. Default is "admins".
10
Type=str
11
Categories=ucsschool-base
12
13
[ucsschool/ldap/default/container/class]
14
Description[de]=Standard-Container-Name für Schulklassen. Standard ist "klassen".
15
Description[en]=Default container name for school classes. Default is "klassen".
16
Type=str
17
Categories=ucsschool-base
18
19
[ucsschool/ldap/default/container/exam]
20
Description[de]=Standard-Container-Name für Schüler in einer Prüfung. Standard ist "examusers".
21
Description[en]=Default container name name for pupils writing exams. Default is "examusers".
22
Type=str
23
Categories=ucsschool-base
24
7
[ucsschool/ldap/default/container/pupils]
25
[ucsschool/ldap/default/container/pupils]
8
Description[de]=Standard-Container für Schüler
26
Description[de]=Standard-Container-Name für Schüler. Standard ist "schueler".
9
Description[en]=Default container for pupils
27
Description[en]=Default container name for pupils. Default is "schueler".
10
Type=str
28
Type=str
11
Categories=ucsschool-base
29
Categories=ucsschool-base
12
30
31
[ucsschool/ldap/default/container/rooms]
32
Description[de]=Standard-Container-Name für Klassenräume. Standard ist "raeume".
33
Description[en]=Default container name for class rooms. Default is "raeume".
34
Type=str
35
Categories=ucsschool-base
36
37
[ucsschool/ldap/default/container/staff]
38
Description[de]=Standard-Container-Name für Mitarbeiter. Standard ist "mitarbeiter".
39
Description[en]=Default container name for staff members. Default is "mitarbeiter".
40
Type=str
41
Categories=ucsschool-base
42
13
[ucsschool/ldap/default/container/teachers]
43
[ucsschool/ldap/default/container/teachers]
14
Description[de]=Standard-Container für Lehrer
44
Description[de]=Standard-Container-Name für Lehrer. Standard ist "lehrer".
15
Description[en]=Default container for teachers
45
Description[en]=Default container name for teachers. Default is "lehrer".
16
Type=str
46
Type=str
17
Categories=ucsschool-base
47
Categories=ucsschool-base
18
48
19
[ucsschool/ldap/default/container/admins]
49
[ucsschool/ldap/default/container/teachers-and-staff]
20
Description[de]=Standard-Container für Administratoren
50
Description[de]=Standard-Container-Name für Benutzer die gleichzeitig Lehrer und Mitarbeiter sind. Standard ist "lehrer und mitarbeiter".
21
Description[en]=Default container for administrators
51
Description[en]=Default container name for users that are both teachers and staff members. Default is "lehrer und mitarbeiter".
22
Type=str
52
Type=str
23
Categories=ucsschool-base
53
Categories=ucsschool-base
24
54
25
[ucsschool/ldap/default/container/staff]
55
[ucsschool/ldap/default/groupname/exam]
26
Description[de]=Standard-Container für Mitarbeiter
56
Description[de]=Standard Gruppenname für Schüler in einer Prüfung. Das "%(ou)s" im Namen wird mit dem Schulkürzel (OU) ersetzt. Standard ist "OU%(ou)s-Klassenarbeit".
27
Description[en]=Default container for staff members
57
Description[en]=Default group name for pupils writing exams. The "%(ou)s" in the name will be replaced by the short name of the school (OU). Default is "OU%(ou)s-Klassenarbeit".
28
Type=str
58
Type=str
29
Categories=ucsschool-base
59
Categories=ucsschool-base
30
60
31
[ucsschool/ldap/default/groupprefix/pupils]
61
[ucsschool/ldap/default/groupname/all-administrativ-dc]
32
Description[de]=Standard-Prefix für die Schüler-Gruppen
62
Description[de]=Standard Gruppenname für Domain Controller in Verwaltungsnetzen. Standard ist "DC-Verwaltungsnetz".
33
Description[en]=Default prefix for pupils groups
63
Description[en]=Default group name for domain controllers in administrativ networks. Default is "DC-Verwaltungsnetz".
34
Type=str
64
Type=str
35
Categories=ucsschool-base
65
Categories=ucsschool-base
36
66
37
[ucsschool/ldap/default/groupprefix/teachers]
67
[ucsschool/ldap/default/groupname/all-administrativ-member]
38
Description[de]=Standard-Prefix für die Lehrer-Gruppen
68
Description[de]=Standard Gruppenname für Member Server in Verwaltungsnetzen. Standard ist "Member-Verwaltungsnetz".
39
Description[en]=Default prefix for teacher groups
69
Description[en]=Default group name for member servers in administrativ networks. Default is "Member-Verwaltungsnetz".
40
Type=str
70
Type=str
41
Categories=ucsschool-base
71
Categories=ucsschool-base
42
72
73
[ucsschool/ldap/default/groupname/all-educational-dc]
74
Description[de]=Standard Gruppenname für Domain Controller in Edukativnetzen. Standard ist "DC-Edukativnetz".
75
Description[en]=Default group name for domain controllers in educational networks. Default is "DC-Edukativnetz".
76
Type=str
77
Categories=ucsschool-base
78
79
[ucsschool/ldap/default/groupname/all-educational-member]
80
Description[de]=Standard Gruppenname für Member Server in Edukativnetzen. Standard ist "Member-Edukativnetz".
81
Description[en]=Default group name for member servers in educational networks. Default is "Member-Edukativnetz".
82
Type=str
83
Categories=ucsschool-base
84
85
[ucsschool/ldap/default/groupname/ou-administrativ-dc]
86
Description[de]=Standard Gruppenname für Domain Controller im Verwaltungsnetz einer bestimmten Schule. Das "%(ou)s" im Namen wird mit dem Schulkürzel (OU) ersetzt. Standard ist "OU%(ou)s-DC-Verwaltungsnetz".
87
Description[en]=Default group name for domain controllers in the administrativ network. The "%(ou)s" in the name will be replaced by the short name of the school (OU). Default is "OU%(ou)s-DC-Verwaltungsnetz".
88
Type=str
89
Categories=ucsschool-base
90
91
[ucsschool/ldap/default/groupname/ou-administrativ-member]
92
Description[de]=Standard Gruppenname für Member Server im Verwaltungsnetz einer bestimmten Schule. Das "%(ou)s" im Namen wird mit dem Schulkürzel (OU) ersetzt. Standard ist "OU%(ou)s-Member-Verwaltungsnetz".
93
Description[en]=Default group name for member servers in the administrativ network. The "%(ou)s" in the name will be replaced by the short name of the school (OU). Default is "OU%(ou)s-Member-Verwaltungsnetz".
94
Type=str
95
Categories=ucsschool-base
96
97
[ucsschool/ldap/default/groupname/ou-educational-dc]
98
Description[de]=Standard Gruppenname für Domain Controller im Edukativnetz einer bestimmten Schule. Das "%(ou)s" im Namen wird mit dem Schulkürzel (OU) ersetzt. Standard ist "OU%(ou)s-DC-Edukativnetz".
99
Description[en]=Default group name for domain controllers in the educational network. The "%(ou)s" in the name will be replaced by the short name of the school (OU). Default is "OU%(ou)s-DC-Edukativnetz".
100
Type=str
101
Categories=ucsschool-base
102
103
[ucsschool/ldap/default/groupname/ou-educational-member]
104
Description[de]=Standard Gruppenname für Member Server im Edukativnetz einer bestimmten Schule. Das "%(ou)s" im Namen wird mit dem Schulkürzel (OU) ersetzt. Standard ist "OU%(ou)s-Member-Edukativnetz".
105
Description[en]=Default group name for member servers in the educational network. The "%(ou)s" in the name will be replaced by the short name of the school (OU). Default is "OU%(ou)s-Member-Edukativnetz".
106
Type=str
107
Categories=ucsschool-base
108
43
[ucsschool/ldap/default/groupprefix/admins]
109
[ucsschool/ldap/default/groupprefix/admins]
44
Description[de]=Standard-Prefix für die Administrator-Gruppen
110
Description[de]=Standard-Prefix für die Administrator-Gruppen. Standard ist "admins-".
45
Description[en]=Default prefix for admin groups
111
Description[en]=Default prefix for admin groups. Default is "admins-".
46
Type=str
112
Type=str
47
Categories=ucsschool-base
113
Categories=ucsschool-base
48
114
115
[ucsschool/ldap/default/groupprefix/pupils]
116
Description[de]=Standard-Prefix für die Schüler-Gruppen. Standard ist "schueler-".
117
Description[en]=Default prefix for pupils groups. Default is "schueler-".
118
Type=str
119
Categories=ucsschool-base
120
49
[ucsschool/ldap/default/groupprefix/staff]
121
[ucsschool/ldap/default/groupprefix/staff]
50
Description[de]=Standard-Prefix für die Mitarbeiter-Gruppen
122
Description[de]=Standard-Prefix für die Mitarbeiter-Gruppen. Standard ist "mitarbeiter-".
51
Description[en]=Default prefix for staff groups
123
Description[en]=Default prefix for staff groups. Default is "mitarbeiter-".
52
Type=str
124
Type=str
53
Categories=ucsschool-base
125
Categories=ucsschool-base
54
126
127
[ucsschool/ldap/default/groupprefix/teachers]
128
Description[de]=Standard-Prefix für die Lehrer-Gruppen. Standard ist "lehrer-".
129
Description[en]=Default prefix for teacher groups. Default is "lehrer-".
130
Type=str
131
Categories=ucsschool-base
132
133
[ucsschool/ldap/default/share/class]
134
Description[de]=Standard Verzeichnisname für die Klassen-Freigabe. Standard ist "klassen".
135
Description[en]=Default directory name for the class share. Default is "klassen".
136
Type=str
137
Categories=ucsschool-base
138
139
[ucsschool/ldap/default/share/pupils]
140
Description[de]=Standard Verzeichnisname für die Schüler-Verzeichnisse. Standard ist "schueler".
141
Description[en]=Default directory name for the pupils directories. Default is "schueler".
142
Type=str
143
Categories=ucsschool-base
144
145
[ucsschool/ldap/default/share/teachers]
146
Description[de]=Standard Verzeichnisname für die Lehrer-Verzeichnisse. Standard ist "lehrer".
147
Description[en]=Default directory name for the teachers directories. Default is "lehrer".
148
Type=str
149
Categories=ucsschool-base
150
55
[ucsschool/ldap/default/dcs]
151
[ucsschool/ldap/default/dcs]
56
Description[de]=Spezifiziert welche Schul-DCs beim Erzeugen einer Schule angelegt werden sollen (Werte: edukativ und/oder verwaltung)
152
Description[de]=Spezifiziert welche Schul-DCs beim Erzeugen einer Schule angelegt werden sollen (Werte: edukativ und/oder verwaltung)
57
Description[en]=Specifies which school DCs are created during the school set up (values: edukativ and/or verwaltung)
153
Description[en]=Specifies which school DCs are created during the school set up (values: edukativ and/or verwaltung)
 Lines 64-69    Link Here 
64
Type=str
160
Type=str
65
Categories=ucsschool-base
161
Categories=ucsschool-base
66
162
163
[ucsschool/import/generate/share/marktplatz/name]
164
Description[de]=Name der Freigabe (Default: "Marktplatz").
165
Description[en]=Name of share (default: "Marktplatz").
166
Type=str
167
Categories=ucsschool-base
168
67
[ucsschool/import/generate/share/marktplatz/sharepath]
169
[ucsschool/import/generate/share/marktplatz/sharepath]
68
Description[de]=Vorgabepfad der Freigabe "Marktplatz" (Default: /home/$ou/groups/Marktplatz)
170
Description[de]=Vorgabepfad der Freigabe "Marktplatz" (Default: /home/$ou/groups/Marktplatz)
69
Description[en]=Default path of share "Marktplatz" (default: /home/$ou/groups/Marktplatz)
171
Description[en]=Default path of share "Marktplatz" (default: /home/$ou/groups/Marktplatz)
 Lines 125-131    Link Here 
125
Categories=ucsschool-base
227
Categories=ucsschool-base
126
228
127
[ucsschool/import/roleshare]
229
[ucsschool/import/roleshare]
128
Description[de]=Falls diese Variable nicht auf "false" oder "no" gesetzt, dann werden Homeverzeichnisse für Benutzer und Klassengruppen in einer rollen- und schulspezifischen Struktur von Unterverzeichnissen angelegt, z.B. unter /home/$ou/schueler/.
230
Description[de]=Falls diese Variable nicht auf "false" oder "no" gesetzt wird, werden Homeverzeichnisse für Benutzer und Klassengruppen in einer rollen- und schulspezifischen Struktur von Unterverzeichnissen angelegt, z.B. unter /home/$ou/schueler/.
129
Description[en]=If this variable is not set to "false" or "no", then home directories for users and class groups will be created in a role and school specific structure of subdirectories, e.g. in /home/$ou/schueler/.
231
Description[en]=If this variable is not set to "false" or "no", then home directories for users and class groups will be created in a role and school specific structure of subdirectories, e.g. in /home/$ou/schueler/.
130
Type=str
232
Type=str
131
Categories=ucsschool-base
233
Categories=ucsschool-base
(-)ucs-school-import/modules/ucsschool/importer/models/import_user.py (-1 / +1 lines)
 Lines 94-100    Link Here 
94
			self.config = Configuration()
94
			self.config = Configuration()
95
			self.reader = self.factory.make_reader()
95
			self.reader = self.factory.make_reader()
96
			self.logger = get_logger()
96
			self.logger = get_logger()
97
			self.username_max_length = 20 - len(self.ucr.get("ucsschool/ldap/default/userprefix/exam", "exam-"))
97
			self.username_max_length = 20 - len(Student.get_search_base(school).user_prefix_exam)
98
		self._lo = None
98
		self._lo = None
99
		self._userexpiry = None
99
		self._userexpiry = None
100
		super(ImportUser, self).__init__(name, school, **kwargs)
100
		super(ImportUser, self).__init__(name, school, **kwargs)
(-)ucs-school-import/tests/test_move_domaincontroller_to_ou (-1 / +5 lines)
 Lines 37-42    Link Here 
37
	exit 1
37
	exit 1
38
fi
38
fi
39
39
40
. /usr/share/ucs-school-lib/base.sh
41
40
eval "$(ucr shell)"
42
eval "$(ucr shell)"
41
43
42
./create_ou test1 dctest1
44
./create_ou test1 dctest1
 Lines 51-58    Link Here 
51
53
52
udm computers/domaincontroller_slave create --position "cn=computers,$ldap_base" --set name=dctest7-01
54
udm computers/domaincontroller_slave create --position "cn=computers,$ldap_base" --set name=dctest7-01
53
./create_ou test7
55
./create_ou test7
54
udm computers/domaincontroller_slave modify --dn "cn=dctest7-01,cn=computers,$ldap_base" --append groups="cn=OUtest7-DC-Edukativnetz,cn=ucsschool,cn=groups,$ldap_base"
55
56
57
test7_dc="$(ucr_names_default ucsschool/ldap/default/groupname/ou-educational-dc test7)"
58
udm computers/domaincontroller_slave modify --dn "cn=dctest7-01,cn=computers,$ldap_base" --append groups="cn=$test7_dc,cn=ucsschool,cn=groups,$ldap_base"
59
56
echo "TEST: DC is unknown"
60
echo "TEST: DC is unknown"
57
./move_domaincontroller_to_ou --dcname UnKnOwN --ou test1
61
./move_domaincontroller_to_ou --dcname UnKnOwN --ou test1
58
echo "EXITCODE: $?"
62
echo "EXITCODE: $?"
(-)ucs-school-import/usr/share/ucs-school-import/hooks/ou_create_post.d/52marktplatz_create (-6 / +9 lines)
 Lines 1-7    Link Here 
1
#!/bin/bash
1
#!/bin/bash
2
#
2
#
3
# 52marktplatz_create
3
# 52marktplatz_create
4
#  Creates a Markplatz share for the specified OUs
4
#  Creates a Marktplatz share for the specified OUs
5
#
5
#
6
# Depends: ucs-school-import
6
# Depends: ucs-school-import
7
#
7
#
 Lines 35-45    Link Here 
35
[ $# -ne 2 ] && echo "USAGE: $(basename $0) FILE DN" && exit 1
35
[ $# -ne 2 ] && echo "USAGE: $(basename $0) FILE DN" && exit 1
36
36
37
. /usr/share/univention-lib/ucr.sh
37
. /usr/share/univention-lib/ucr.sh
38
. /usr/share/ucs-school-lib/base.sh
38
39
39
eval "$(ucr shell)"
40
eval "$(ucr shell)"
40
41
42
name="$(ucr_names_default ucsschool/import/generate/share/marktplatz/name)"
43
41
if ! is_ucr_true "ucsschool/import/generate/share/marktplatz" ; then
44
if ! is_ucr_true "ucsschool/import/generate/share/marktplatz" ; then
42
	echo "$(basename $0): creation of share 'Marktplatz' has been disabled by ucsschool/import/generate/share/marktplatz"
45
	echo "$(basename $0): creation of share '$name' has been disabled by ucsschool/import/generate/share/marktplatz"
43
	exit 0
46
	exit 0
44
fi
47
fi
45
48
 Lines 58-66    Link Here 
58
sharepath="$ucsschool_import_generate_share_marktplatz_sharepath"
61
sharepath="$ucsschool_import_generate_share_marktplatz_sharepath"
59
if [ -z "$sharepath" ] ; then
62
if [ -z "$sharepath" ] ; then
60
	if [ -z "$ucsschool_import_roleshare" ] || is_ucr_true "ucsschool/import/roleshare"; then
63
	if [ -z "$ucsschool_import_roleshare" ] || is_ucr_true "ucsschool/import/roleshare"; then
61
		sharepath="/home/$ou/groups/Marktplatz"
64
		sharepath="/home/$ou/groups/$name"
62
	else
65
	else
63
		sharepath="/home/groups/Marktplatz"
66
		sharepath="/home/groups/$name"
64
	fi
67
	fi
65
fi
68
fi
66
69
 Lines 77-88    Link Here 
77
80
78
udm shares/share create --ignore_exists \
81
udm shares/share create --ignore_exists \
79
	--position "cn=shares,ou=${ou}${district},${ldap_base}" \
82
	--position "cn=shares,ou=${ou}${district},${ldap_base}" \
80
	--set name=Marktplatz \
83
	--set name="${name}" \
81
	--set "host=${dcname}" \
84
	--set "host=${dcname}" \
82
	--set "path=${sharepath}" \
85
	--set "path=${sharepath}" \
83
	--set "directorymode=${sharemode}" \
86
	--set "directorymode=${sharemode}" \
84
	--set "group=${grpuidnumber}"
87
	--set "group=${grpuidnumber}"
85
88
86
echo "$(basename $0): added new share Markplatz for server ${dcname}"
89
echo "$(basename $0): added new share '$name' for server ${dcname}"
87
90
88
exit 0
91
exit 0
(-)ucs-school-import/usr/share/ucs-school-import/scripts/ucs-school-import (-110 / +96 lines)
 Lines 77-84    Link Here 
77
import univention.lib.policy_result
77
import univention.lib.policy_result
78
from ucsschool.lib.roles import role_pupil, role_teacher, role_staff
78
from ucsschool.lib.roles import role_pupil, role_teacher, role_staff
79
from ucsschool.lib.roleshares import roleshare_home_subdir
79
from ucsschool.lib.roleshares import roleshare_home_subdir
80
from ucsschool.lib.models.utils import stopped_notifier, add_stream_logger_to_schoollib
80
from ucsschool.lib.models.utils import stopped_notifier, add_stream_logger_to_schoollib, create_passwd
81
from ucsschool.lib.models.utils import create_passwd
81
from ucsschool.lib.models import School, SchoolClass, ClassShare
82
82
83
83
84
ldap_errors = (ldap.LDAPError, univention.admin.uexceptions.base,)
84
ldap_errors = (ldap.LDAPError, univention.admin.uexceptions.base,)
 Lines 106-122    Link Here 
106
106
107
pwLengthOu = {}
107
pwLengthOu = {}
108
108
109
cn_pupils   = configRegistry.get('ucsschool/ldap/default/container/pupils', 'schueler')
110
cn_teachers = configRegistry.get('ucsschool/ldap/default/container/teachers', 'lehrer')
111
cn_teachers_staff = configRegistry.get('ucsschool/ldap/default/container/teachers-and-staff', 'lehrer und mitarbeiter')
112
cn_admins	= configRegistry.get('ucsschool/ldap/default/container/admins', 'admins')
113
cn_staff	= configRegistry.get('ucsschool/ldap/default/container/staff', 'mitarbeiter')
114
115
grp_prefix_pupils   = configRegistry.get('ucsschool/ldap/default/groupprefix/pupils', 'schueler-')
116
grp_prefix_teachers = configRegistry.get('ucsschool/ldap/default/groupprefix/teachers', 'lehrer-')
117
grp_prefix_admins	= configRegistry.get('ucsschool/ldap/default/groupprefix/admins', 'admins-')
118
grp_prefix_staff	= configRegistry.get('ucsschool/ldap/default/groupprefix/staff', 'mitarbeiter-')
119
120
grp_policy_pupils	= configRegistry.get('ucsschool/ldap/default/policy/umc/pupils', 'cn=ucsschool-umc-pupils-default,cn=UMC,cn=policies,%s' % baseDN)
109
grp_policy_pupils	= configRegistry.get('ucsschool/ldap/default/policy/umc/pupils', 'cn=ucsschool-umc-pupils-default,cn=UMC,cn=policies,%s' % baseDN)
121
grp_policy_teachers = configRegistry.get('ucsschool/ldap/default/policy/umc/teachers', 'cn=ucsschool-umc-teachers-default,cn=UMC,cn=policies,%s' % baseDN)
110
grp_policy_teachers = configRegistry.get('ucsschool/ldap/default/policy/umc/teachers', 'cn=ucsschool-umc-teachers-default,cn=UMC,cn=policies,%s' % baseDN)
122
grp_policy_admins	= configRegistry.get('ucsschool/ldap/default/policy/umc/admins', 'cn=ucsschool-umc-admins-default,cn=UMC,cn=policies,%s' % baseDN)
111
grp_policy_admins	= configRegistry.get('ucsschool/ldap/default/policy/umc/admins', 'cn=ucsschool-umc-admins-default,cn=UMC,cn=policies,%s' % baseDN)
 Lines 134-143    Link Here 
134
TYPE_DC_EDUCATIONAL = 'educational'
123
TYPE_DC_EDUCATIONAL = 'educational'
135
124
136
125
137
# IP address prefix len conecerning the netmask
126
# IP address prefix len concerning the netmask
138
default_prefixlen = 24
127
default_prefixlen = 24
139
128
140
if not (cn_pupils and cn_teachers and cn_teachers_staff and cn_admins and cn_staff):
129
if not (cn_pupils and cn_classes):
141
	print '''ERROR: Unable to proceed: one of the following UCR variables is not set correctly:
130
	print '''ERROR: Unable to proceed: one of the following UCR variables is not set correctly:
142
	ucsschool/ldap/default/container/pupils
131
	ucsschool/ldap/default/container/pupils
143
	ucsschool/ldap/default/container/teachers
132
	ucsschool/ldap/default/container/teachers
 Lines 265-270    Link Here 
265
		else:
254
		else:
266
			self.allsNrs=[self.sNr]
255
			self.allsNrs=[self.sNr]
267
			self.other_sNr=[]
256
			self.other_sNr=[]
257
		self.search_base = School.get_search_base(self.allsNrs[0])
268
258
269
		# split into multiple class number if comma is present
259
		# split into multiple class number if comma is present
270
		if ',' in self.cNr:
260
		if ',' in self.cNr:
 Lines 319-332    Link Here 
319
309
320
	def getPosition_dn(self):
310
	def getPosition_dn(self):
321
		# resolution order for the position is pupil, teacher, staff
311
		# resolution order for the position is pupil, teacher, staff
322
		cn = cn_pupils
323
		if role_teacher in self.getRole() and role_staff in self.getRole():
312
		if role_teacher in self.getRole() and role_staff in self.getRole():
324
			cn = cn_teachers_staff
313
			return self.search_base.teachersAndStaff
325
		elif role_teacher in self.getRole ():
314
		elif role_teacher in self.getRole ():
326
			cn = cn_teachers
315
			return self.search_base.teachers
327
		elif role_staff in self.getRole ():
316
		elif role_staff in self.getRole():
328
			cn = cn_staff
317
			return self.search_base.staff
329
		return "cn=%s,cn=users,%s" % (cn, getDN (self.sNr))
318
		return self.search_base.students
330
319
331
	def getDN(self):
320
	def getDN(self):
332
		return "uid="+self.login+","+self.getPosition_dn()
321
		return "uid="+self.login+","+self.getPosition_dn()
 Lines 335-353    Link Here 
335
		default_groups=[]
324
		default_groups=[]
336
325
337
		# default group
326
		# default group
338
		default_groups.append("cn=Domain Users "+self.sNr+",cn=groups,%s" % (getDN (self.sNr), ))
327
		default_groups.append("cn=Domain Users %s,%s" % (self.sNr, self.search_base.groups))
339
328
340
		for role in self.getRole ():
329
		grp_dns = {
341
			user_grp_prefix = { role_teacher:grp_prefix_teachers,
330
			role_teacher: self.search_base.teachers_ou_group,
342
							    role_pupil:grp_prefix_pupils,
331
			role_pupil: self.search_base.students_ou_group,
343
							    role_staff:grp_prefix_staff }[role]
332
			role_staff: self.search_base.staff_ou_group}
333
		for role in self.getRole():
344
			if role == role_staff and not configRegistry.is_true('ucsschool/ldap/noneducational/create/objects', True):
334
			if role == role_staff and not configRegistry.is_true('ucsschool/ldap/noneducational/create/objects', True):
345
				continue
335
				continue
346
			# class if available
336
			# class if available
347
			for cnr in self.cNr:
337
			for cnr in self.cNr:
348
				default_groups.append("cn=" + cnr + ",cn=klassen,cn=%s,cn=groups,%s" % (cn_pupils, getDN (self.sNr)))
338
				default_groups.append("cn=%s,%s" % (cnr, self.search_base.classes))
349
339
350
			default_groups.append("cn=%s%s,cn=groups,%s"%(user_grp_prefix, self.sNr, getDN (self.sNr)))
340
			default_groups.append(grp_dns[role])
351
341
352
		return default_groups
342
		return default_groups
353
343
 Lines 498-518    Link Here 
498
	if district_enabled:
488
	if district_enabled:
499
		verify_container(getDN (schoolNr, base='district'), ou_module, co, lo, superordinate, baseDN)
489
		verify_container(getDN (schoolNr, base='district'), ou_module, co, lo, superordinate, baseDN)
500
490
501
	print "verify ou for school nr %s"%schoolNr
491
	print "verify ou for school nr %s" % schoolNr
492
	search_base = School.get_search_base(schoolNr)
502
	# list of needed sub-containers, the dictionary-key adds the container as default during create in verify_container
493
	# list of needed sub-containers, the dictionary-key adds the container as default during create in verify_container
503
	container={'0printerPath':['cn=printers'],
494
	container = {
504
			   '1userPath':['cn=users','cn=%s,cn=users' % cn_pupils,'cn=%s,cn=users' % cn_teachers,'cn=%s,cn=users' % cn_admins],
495
		'0printerPath': [search_base.printers],
505
			   '2computerPath':['cn=computers','cn=server,cn=computers','cn=dc,cn=server,cn=computers'],
496
		'1userPath': [search_base.users, search_base.students, search_base.teachers, search_base.admins],
506
			   '3networkPath':['cn=networks'],
497
		'2computerPath': [search_base.computers, 'cn=server,{}'.format(search_base.computers), 'cn=dc,cn=server,{}'.format(search_base.computers)],
507
			   '4groupPath':['cn=groups','cn=%s,cn=groups' % cn_pupils,'cn=%s,cn=groups' % cn_teachers,'cn=klassen,cn=%s,cn=groups' % cn_pupils,'cn=raeume,cn=groups'],
498
		'3networkPath': [search_base.networks],
508
			   '5dhcpPath':['cn=dhcp'],
499
		'4groupPath': [search_base.groups, search_base.workgroups, search_base.teachers_group, search_base.classes, search_base.rooms],
509
			   '6policyPath':['cn=policies'],
500
		'5dhcpPath': [search_base.dhcp],
510
			   '7sharePath':['cn=shares','cn=klassen,cn=shares'],
501
		'6policyPath': [search_base.policies],
511
			   '8none':['cn=dc,cn=server,cn=computers']
502
		'7sharePath': [search_base.shares, search_base.classShares],
512
			   }
503
		'8none': ['cn=dc,cn=server,{}'.format(search_base.computers)]
504
	}
513
	if configRegistry.is_true('ucsschool/ldap/noneducational/create/objects', True):
505
	if configRegistry.is_true('ucsschool/ldap/noneducational/create/objects', True):
514
		container['1userPath'].extend(['cn=%s,cn=users' % cn_staff, 'cn=%s,cn=users' % cn_teachers_staff])
506
		container['1userPath'].extend([search_base.staff, search_base.teachersAndStaff])
515
		container['4groupPath'].append('cn=%s,cn=groups' % cn_staff)
507
		container['4groupPath'].append(search_base.staff_group)
516
	# FIXME: die Policies sollten besser mit der Gruppe verknüpft werden, um
508
	# FIXME: die Policies sollten besser mit der Gruppe verknüpft werden, um
517
	# z.B. Mitarbeiter und Lehrer im selben Container pflegen zu können
509
	# z.B. Mitarbeiter und Lehrer im selben Container pflegen zu können
518
	#container_policies = { 'cn=%s,cn=users' % cn_teachers: ['cn=default-lehrer,cn=UMC,cn=policies,' + baseDN] }
510
	#container_policies = { 'cn=%s,cn=users' % cn_teachers: ['cn=default-lehrer,cn=UMC,cn=policies,' + baseDN] }
 Lines 527-546    Link Here 
527
		dccn = ''
519
		dccn = ''
528
	myline = '%s\t%s' % ( schoolNr, dccn )
520
	myline = '%s\t%s' % ( schoolNr, dccn )
529
	hooks.pre( 'ou', 'A', line = myline )
521
	hooks.pre( 'ou', 'A', line = myline )
522
	search_base = School.get_search_base(schoolNr)
530
523
531
	# verify global dc groups
524
	# verify global dc groups
532
	groups_administrative = [
525
	groups_administrative = [search_base.administrative_dc_group, search_base.administrative_member_group]
533
		"cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s" % baseDN,
526
	groups_education = [search_base.educational_dc_group, search_base.educational_member_group]
534
		"cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,%s" % baseDN]
527
	groups_administrativeOU = [search_base.administrative_ou_dc_group, search_base.administrative_ou_member_group]
535
	groups_education=[
528
	groups_educationOU = [search_base.educational_ou_dc_group, search_base.educational_ou_member_group]
536
		"cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%s" % baseDN,
537
		"cn=Member-Edukativnetz,cn=ucsschool,cn=groups,%s" % baseDN]
538
	groups_administrativeOU=[
539
		"cn=OU%s-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s" % (schoolNr.lower(), baseDN),
540
		"cn=OU%s-Member-Verwaltungsnetz,cn=ucsschool,cn=groups,%s" % (schoolNr.lower(), baseDN)]
541
	groups_educationOU=[
542
		"cn=OU%s-DC-Edukativnetz,cn=ucsschool,cn=groups,%s" % (schoolNr.lower(), baseDN),
543
		"cn=OU%s-Member-Edukativnetz,cn=ucsschool,cn=groups,%s" % (schoolNr.lower(), baseDN)]
544
529
545
	if configRegistry.is_true('ucsschool/ldap/noneducational/create/objects', True):
530
	if configRegistry.is_true('ucsschool/ldap/noneducational/create/objects', True):
546
		groups = groups_administrative + groups_education + groups_administrativeOU + groups_educationOU
531
		groups = groups_administrative + groups_education + groups_administrativeOU + groups_educationOU
 Lines 555-561    Link Here 
555
		dcobject = object_exists(
540
		dcobject = object_exists(
556
			server_module, co, lo, 'sub', superordinate, baseDN,
541
			server_module, co, lo, 'sub', superordinate, baseDN,
557
			univention.admin.filter.expression('cn', dccn), None)
542
			univention.admin.filter.expression('cn', dccn), None)
558
	
543
559
		if dcobject:
544
		if dcobject:
560
			zone = "edukativ"
545
			zone = "edukativ"
561
			dcobject.open()
546
			dcobject.open()
 Lines 562-576    Link Here 
562
			# TODO FIXME The following snippet does not make any sense:
547
			# TODO FIXME The following snippet does not make any sense:
563
			# if the DC is member of DC-Verwaltungsnetz then is added again to that group?!? Looks like this code is unused.
548
			# if the DC is member of DC-Verwaltungsnetz then is added again to that group?!? Looks like this code is unused.
564
			for grp in dcobject['groups']:
549
			for grp in dcobject['groups']:
565
				if grp.startswith("cn=DC-Verwaltungsnetz,"):
550
				if grp.startswith(univention.admin.uldap.explodeDn(search_base.administrative_dc_group)[0]):
566
					zone = "verwaltung"
551
					zone = "verwaltung"
567
			groups = []
552
			groups = []
568
			if zone == "edukativ":
553
			if zone == "edukativ":
569
				groups.append("cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%s" % baseDN)
554
				groups.append(search_base.educational_dc_group)
570
				groups.append("cn=OU%s-DC-Edukativnetz,cn=ucsschool,cn=groups,%s" % (schoolNr.lower(), baseDN))
555
				groups.append(search_base.educational_ou_dc_group)
571
			if zone == "verwaltung":
556
			if zone == "verwaltung":
572
				groups.append("cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s" % baseDN)
557
				groups.append(search_base.administrative_dc_group)
573
				groups.append("cn=OU%s-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s" % (schoolNr.lower(), baseDN))
558
				groups.append(search_base.administrative_ou_dc_group)
574
			modified = False
559
			modified = False
575
			for grp in groups:
560
			for grp in groups:
576
				if not grp in dcobject['groups']:
561
				if not grp in dcobject['groups']:
 Lines 578-585    Link Here 
578
					dcobject['groups'].append(grp)
563
					dcobject['groups'].append(grp)
579
			if modified:
564
			if modified:
580
				dcobject.modify()
565
				dcobject.modify()
581
		
582
566
567
583
	created, dn = verify_container(ou_base, ou_module, co, lo, superordinate, baseDN, path='')
568
	created, dn = verify_container(ou_base, ou_module, co, lo, superordinate, baseDN, path='')
584
	if created:
569
	if created:
585
		# get name of new dc
570
		# get name of new dc
 Lines 619-642    Link Here 
619
		if displayName is not None:
604
		if displayName is not None:
620
			r = lo.modify(ou_base, [('displayName', lo.get(ou_base, ['displayName']).get('displayName',[]), [displayName])])
605
			r = lo.modify(ou_base, [('displayName', lo.get(ou_base, ['displayName']).get('displayName',[]), [displayName])])
621
606
622
	keys=container.keys()
607
	for path in sorted(container.keys()):
623
	keys.sort()
624
	for path in keys:
625
		for dn in container[path]:
608
		for dn in container[path]:
626
			if path[1:]=='none': path=' '
609
			if path[1:] == 'none':
627
			verify_container('%s,%s'%(dn,ou_base),cn_module, co, lo, superordinate, baseDN, path=path[1:])
610
				path=' '
611
			verify_container(dn, cn_module, co, lo, superordinate, baseDN, path=path[1:])
628
612
629
	# create groups if not existant
613
	# create groups if not existant
630
	grp_ouadmins = "cn=%s%s,cn=ouadmins,cn=groups,%s" % (grp_prefix_admins, schoolNr.lower(), baseDN)
614
	grp_ouadmins = search_base.admin_group
631
	groups=[ ( grp_ouadmins, grp_policy_admins ),
615
	groups = [
632
			 ( "cn=%s%s,cn=groups,%s" % (grp_prefix_pupils, schoolNr.lower(), getDN(schoolNr)),	grp_policy_pupils ),
616
		(grp_ouadmins, grp_policy_admins),
633
			 ( "cn=%s%s,cn=groups,%s" % (grp_prefix_teachers, schoolNr.lower(), getDN(schoolNr)),	grp_policy_teachers ),
617
		(search_base.students_ou_group, grp_policy_pupils),
634
		 ]
618
		(search_base.teachers_ou_group, grp_policy_teachers),
619
	]
635
620
636
	if configRegistry.is_true('ucsschool/ldap/noneducational/create/objects', True):
621
	if configRegistry.is_true('ucsschool/ldap/noneducational/create/objects', True):
637
		groups.append(
622
		groups.append((search_base.staff_ou_group, grp_policy_staff))
638
			 ( "cn=%s%s,cn=groups,%s" % (grp_prefix_staff, schoolNr.lower(), getDN(schoolNr)),	grp_policy_staff ),
639
			 )
640
	if configRegistry.is_true('ucsschool/import/attach/policy/default-umc-users', True):
623
	if configRegistry.is_true('ucsschool/import/attach/policy/default-umc-users', True):
641
		domain_users_school = "cn=Domain Users %s,cn=groups,%s" % (schoolNr.lower(), getDN(schoolNr))
624
		domain_users_school = "cn=Domain Users %s,cn=groups,%s" % (schoolNr.lower(), getDN(schoolNr))
642
		groups.append((domain_users_school, "cn=default-umc-users,cn=UMC,cn=policies,%s" % (baseDN,)))
625
		groups.append((domain_users_school, "cn=default-umc-users,cn=UMC,cn=policies,%s" % (baseDN,)))
 Lines 673-680    Link Here 
673
			else:
656
			else:
674
				dccn = 'dc%s-01' % schoolNr.lower ()
657
				dccn = 'dc%s-01' % schoolNr.lower ()
675
658
676
		dcgroups = ["cn=OU%s-DC-Edukativnetz,cn=ucsschool,cn=groups,%s" % (schoolNr.lower (), baseDN),
659
		dcgroups = [search_base.educational_ou_dc_group, search_base.educational_dc_group]
677
					"cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%s" % (baseDN, )]
678
660
679
		if dc == 'verwaltung':
661
		if dc == 'verwaltung':
680
			if not configRegistry.is_true('ucsschool/ldap/noneducational/create/objects', True):
662
			if not configRegistry.is_true('ucsschool/ldap/noneducational/create/objects', True):
 Lines 686-693    Link Here 
686
					dccn = configRegistry.get('hostname')
668
					dccn = configRegistry.get('hostname')
687
				else:
669
				else:
688
					dccn = 'dc%sv-01' % schoolNr.lower () # this is the naming convention, a trailing v for Verwaltungsnetz DCs
670
					dccn = 'dc%sv-01' % schoolNr.lower () # this is the naming convention, a trailing v for Verwaltungsnetz DCs
689
			dcgroups = ["cn=OU%s-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s" % (schoolNr.lower (), baseDN),
671
			dcgroups = [search_base.administrative_ou_dc_group, search_base.administrative_dc_group]
690
					"cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s" % (baseDN, )]
691
672
692
		# create server if not exsistant
673
		# create server if not exsistant
693
		objects = univention.admin.modules.lookup(computer_module, co, lo, scope='sub', superordinate=superordinate, base=baseDN,
674
		objects = univention.admin.modules.lookup(computer_module, co, lo, scope='sub', superordinate=superordinate, base=baseDN,
 Lines 708-716    Link Here 
708
		if not server_exists and not dcName:
689
		if not server_exists and not dcName:
709
			try:
690
			try:
710
				if dc == 'verwaltung':
691
				if dc == 'verwaltung':
711
					grpdn = 'cn=OU%s-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % (schoolNr.lower (), baseDN)
692
					grpdn = search_base.administrative_ou_dc_group
712
				else:
693
				else:
713
					grpdn = 'cn=OU%s-DC-Edukativnetz,cn=ucsschool,cn=groups,%s' % (schoolNr.lower (), baseDN)
694
					grpdn = search_base.educational_ou_dc_group
714
				hostlist = lo.get(grpdn, ['uniqueMember']).get('uniqueMember',[])
695
				hostlist = lo.get(grpdn, ['uniqueMember']).get('uniqueMember',[])
715
			except ldap.NO_SUCH_OBJECT:
696
			except ldap.NO_SUCH_OBJECT:
716
				hostlist = []
697
				hostlist = []
 Lines 1071-1077    Link Here 
1071
	if (schoolNr, classNr.lower()) in verified_group_shares:
1052
	if (schoolNr, classNr.lower()) in verified_group_shares:
1072
		return True
1053
		return True
1073
1054
1074
	position_dn="cn=%s,cn=klassen,cn=shares,%s"%(classNr, getDN (schoolNr, basedn=base))
1055
	position_dn = ClassShare(school=schoolNr, name=classNr).dn
1075
	module = univention.admin.modules.get("shares/share")
1056
	module = univention.admin.modules.get("shares/share")
1076
	position_basedn = univention.admin.uldap.position(baseDN)
1057
	position_basedn = univention.admin.uldap.position(baseDN)
1077
	univention.admin.modules.init (lo, position_basedn, module)
1058
	univention.admin.modules.init (lo, position_basedn, module)
 Lines 1104-1110    Link Here 
1104
		print "need to create groupshare %s"%position_dn
1085
		print "need to create groupshare %s"%position_dn
1105
1086
1106
		# get gid form corresponding group
1087
		# get gid form corresponding group
1107
		group_dn="cn=%s,cn=klassen,cn=%s,cn=groups,%s"%(classNr, cn_pupils, getDN (schoolNr, basedn=base))
1088
		school_class = SchoolClass(school=schoolNr, name=classNr)
1089
		class_share = ClassShare.from_school_class(school_class)
1090
		group_dn = school_class.dn
1108
		gids=lo.get(group_dn,['gidNumber'])
1091
		gids=lo.get(group_dn,['gidNumber'])
1109
		gid = 0
1092
		gid = 0
1110
		if len(gids) > 1: # TODO FIXME This doesn't look correct to me - gids is a dict and not a list!
1093
		if len(gids) > 1: # TODO FIXME This doesn't look correct to me - gids is a dict and not a list!
 Lines 1155-1164    Link Here 
1155
		object.open()
1138
		object.open()
1156
		object["name"] = "%s"%classNr
1139
		object["name"] = "%s"%classNr
1157
		object["host"] = serverfqdn
1140
		object["host"] = serverfqdn
1158
		if configRegistry.is_true('ucsschool/import/roleshare', True):
1141
		object["path"] = class_share.get_share_path()
1159
			object["path"] = "/home/" + os.path.join(schoolNr, "groups/klassen/%s" % (classNr,))
1160
		else:
1161
			object["path"] = "/home/groups/klassen/%s" % (classNr,)
1162
		object["writeable"] = "1"
1142
		object["writeable"] = "1"
1163
		object["sambaWriteable"] = "1"
1143
		object["sambaWriteable"] = "1"
1164
		object["sambaBrowseable"] = "1"
1144
		object["sambaBrowseable"] = "1"
 Lines 1315-1325    Link Here 
1315
			# FIXME / TODO
1295
			# FIXME / TODO
1316
			# Test should be following:
1296
			# Test should be following:
1317
			# if ( ( ( parts[0].startswith( 'cn=%s' % grp_prefix_pupils) or parts[0].startswith( 'cn=%s' % grp_prefix_pupils) ) and parts[1] == 'cn=groups' and parts[2].startswith('ou=') ) or
1297
			# if ( ( ( parts[0].startswith( 'cn=%s' % grp_prefix_pupils) or parts[0].startswith( 'cn=%s' % grp_prefix_pupils) ) and parts[1] == 'cn=groups' and parts[2].startswith('ou=') ) or
1318
			# 	 ( parts[1] == 'cn=klassen' and parts[2] == 'cn=%s' % cn_pupils and parts[3] == 'cn=groups' and parts[4].startswith('ou=') ) ):
1298
			# 	 ( parts[1] == 'cn=%s' % cn_classes and parts[2] == 'cn=%s' % cn_pupils and parts[3] == 'cn=groups' and parts[4].startswith('ou=') ) ):
1319
1299
1300
			search_base = School.get_search_base(None)
1301
			cn_pupils = ldap.explode_dn(search_base.students, True)[0]
1302
			cn_classes = ldap.explode_dn(search_base.classes, True)[0]
1303
			grp_prefix_pupils = search_base.group_prefix_students
1304
			grp_prefix_teachers = search_base.group_prefix_teachers
1305
1320
			if ( parts[0].startswith( 'cn=%s' % grp_prefix_pupils ) or
1306
			if ( parts[0].startswith( 'cn=%s' % grp_prefix_pupils ) or
1321
				 parts[0].startswith( 'cn=%s' % grp_prefix_teachers ) or
1307
				 parts[0].startswith( 'cn=%s' % grp_prefix_teachers ) or
1322
				 ( parts[1] == 'cn=klassen' and parts[2] == 'cn=%s' % cn_pupils ) ):
1308
				 (parts[1] == 'cn=%s' % cn_classes and parts[2] == 'cn=%s' % cn_pupils)):
1323
				# group looks like a default group, so we don't need it anymore
1309
				# group looks like a default group, so we don't need it anymore
1324
				print "remove from group: %s"%group
1310
				print "remove from group: %s"%group
1325
				remove_groups.append(group)
1311
				remove_groups.append(group)
 Lines 1600-1611    Link Here 
1600
					main_person.isTeacher = '0'
1586
					main_person.isTeacher = '0'
1601
					main_person.isStaff   = '0'
1587
					main_person.isStaff   = '0'
1602
1588
1603
					if object.dn.endswith(',cn=%s,cn=users,%s' % (cn_teachers_staff, getDN(ou))):
1589
					search_base = School.get_search_base(ou)
1590
					if object.dn.endswith(',%s' % search_base.teachersAndStaff):
1604
						main_person.isTeacher = '1'
1591
						main_person.isTeacher = '1'
1605
						main_person.isStaff = '1'
1592
						main_person.isStaff = '1'
1606
					elif object.dn.endswith(',cn=%s,cn=users,%s' % (cn_teachers, getDN(ou))):
1593
					elif object.dn.endswith(',%s' % search_base.teachers):
1607
						main_person.isTeacher = '1'
1594
						main_person.isTeacher = '1'
1608
					elif object.dn.endswith(',cn=%s,cn=users,%s' % (cn_staff, getDN(ou))):
1595
					elif object.dn.endswith(',%s' % search_base.staff):
1609
						main_person.isStaff = '1'
1596
						main_person.isStaff = '1'
1610
1597
1611
					if ou in main_person.allsNrs:
1598
					if ou in main_person.allsNrs:
 Lines 2208-2213    Link Here 
2208
				zone = parsed[6]
2195
				zone = parsed[6]
2209
2196
2210
			verify_school_ou(schoolNr, co, lo, baseDN)
2197
			verify_school_ou(schoolNr, co, lo, baseDN)
2198
			search_base = School.get_search_base(schoolNr)
2211
2199
2212
			try:
2200
			try:
2213
				ip = ipaddr.IPv4Network(IP)
2201
				ip = ipaddr.IPv4Network(IP)
 Lines 2224-2234    Link Here 
2224
			groups = {}
2212
			groups = {}
2225
			if ctype == "memberserver":
2213
			if ctype == "memberserver":
2226
				if zone == "edukativ":
2214
				if zone == "edukativ":
2227
					groups["cn=OU%s-Member-Edukativnetz,cn=ucsschool,cn=groups,%s" % (schoolNr.lower(), baseDN)] = 1
2215
					groups[search_base.educational_ou_member_group] = 1
2228
					groups["cn=Member-Edukativnetz,cn=ucsschool,cn=groups,%s" % baseDN] = 1
2216
					groups[search_base.educational_member_group] = 1
2229
				if zone == "verwaltung":
2217
				if zone == "verwaltung":
2230
					groups["cn=OU%s-Member-Verwaltungsnetz,cn=ucsschool,cn=groups,%s" % (schoolNr.lower(), baseDN)] = 1
2218
					groups[search_base.administrative_ou_member_group] = 1
2231
					groups["cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,%s" % baseDN] = 1
2219
					groups[search_base.administrative_member_group] = 1
2232
2220
2233
			# invoke pre hooks
2221
			# invoke pre hooks
2234
			hooks.pre( 'computer', 'A', line = line )
2222
			hooks.pre( 'computer', 'A', line = line )
 Lines 2331-2338    Link Here 
2331
			ClassID = parsed[2]
2319
			ClassID = parsed[2]
2332
			Descrpt = parsed[3]
2320
			Descrpt = parsed[3]
2333
2321
2334
			group_dn="cn=%s,cn=klassen,cn=%s,cn=groups,%s"%(ClassID, cn_pupils, getDN (schoolNr))
2322
			group_dn = SchoolClass(school=schoolNr, name=ClassID).dn
2335
			share_dn="cn=%s,cn=klassen,cn=shares,%s"%(ClassID, getDN (schoolNr))
2323
			share_dn = ClassShare(school=schoolNr, name=ClassID).dn
2336
2324
2337
			verify_school_ou(schoolNr, co, lo, baseDN)
2325
			verify_school_ou(schoolNr, co, lo, baseDN)
2338
2326
 Lines 2874-2887    Link Here 
2874
2862
2875
	slave = slaves[0]
2863
	slave = slaves[0]
2876
	ouDn = oulist[0].dn
2864
	ouDn = oulist[0].dn
2865
	search_base = School.get_search_base(options.ou)
2877
2866
2878
	group_filter = univention.admin.filter.conjunction('&', [
2867
	group_filter = univention.admin.filter.conjunction('&', [
2879
			univention.admin.filter.conjunction('|', [
2868
		univention.admin.filter.conjunction('|', [
2880
					univention.admin.filter.expression('cn', 'OU%s-DC-Edukativnetz' % options.ou),
2869
			univention.admin.uldap.explodeDn(search_base.educational_ou_dc_group)[0],
2881
					univention.admin.filter.expression('cn', 'OU%s-DC-Verwaltungsnetz' % options.ou),
2870
			univention.admin.uldap.explodeDn(search_base.administrative_ou_dc_group)[0],
2882
					]),
2871
		]),
2883
			univention.admin.filter.expression('uniqueMember', slave.dn),
2872
		univention.admin.filter.expression('uniqueMember', slave.dn),
2884
			])
2873
	])
2885
	groups = univention.admin.modules.lookup(group_module, co, lo, scope='sub', base=baseDN, filter=group_filter)
2874
	groups = univention.admin.modules.lookup(group_module, co, lo, scope='sub', base=baseDN, filter=group_filter)
2886
	if not groups:
2875
	if not groups:
2887
		print 'ERROR: cannot move domaincontroller slave with hostname "%s" to OU "%s"' % (options.dcname, options.ou)
2876
		print 'ERROR: cannot move domaincontroller slave with hostname "%s" to OU "%s"' % (options.dcname, options.ou)
 Lines 2980-2994    Link Here 
2980
		print 'ERROR: specified OU %r does not exist' % ou_name
2969
		print 'ERROR: specified OU %r does not exist' % ou_name
2981
		sys.exit(1)
2970
		sys.exit(1)
2982
2971
2983
2972
	search_base = School.get_search_base(ou_name)
2984
	# get list of desired group memberships
2973
	# get list of desired group memberships
2985
	group_dn_list = { TYPE_DC_ADMINISTRATIVE: ['cn=OU%s-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % (ou_name.lower(), baseDN),
2974
	group_dn_list = {
2986
										   'cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % (baseDN,),
2975
		TYPE_DC_ADMINISTRATIVE: [search_base.administrative_ou_dc_group, search_base.administrative_dc_group],
2987
										   ],
2976
		TYPE_DC_EDUCATIONAL: [search_base.educational_dc_group, search_base.educational_ou_dc_group]
2988
					  TYPE_DC_EDUCATIONAL: ['cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%s' % (baseDN,),
2977
	}[dc_type]
2989
										  'cn=OU%s-DC-Edukativnetz,cn=ucsschool,cn=groups,%s' % (ou_name.lower(), baseDN),
2990
										  ],
2991
					  }[dc_type]
2992
	for grpdn in group_dn_list:
2978
	for grpdn in group_dn_list:
2993
		verify_group(grpdn, co, lo, superordinate, baseDN)
2979
		verify_group(grpdn, co, lo, superordinate, baseDN)
2994
2980
(-)ucs-school-import/usr/share/ucs-school-import/scripts/ucs-school-join-secondary-samba4 (-6 / +9 lines)
 Lines 31-36    Link Here 
31
# <http://www.gnu.org/licenses/>.
31
# <http://www.gnu.org/licenses/>.
32
32
33
. /usr/share/univention-lib/all.sh
33
. /usr/share/univention-lib/all.sh
34
. /usr/share/ucs-school-lib/base.sh
34
35
35
display_help() {
36
display_help() {
36
	cat <<-EOL
37
	cat <<-EOL
 Lines 195-205    Link Here 
195
while read service; do
196
while read service; do
196
	case "$service" in
197
	case "$service" in
197
		"UCS@school Education")
198
		"UCS@school Education")
198
			target_server_ucsschool_type=Edukativnetz
199
			target_server_all_dcs="$(ucr_names_default ucsschool/ldap/default/groupname/all-educational-dc)"
200
			target_server_ou_dcs="$(ucr_names_default ucsschool/ldap/default/groupname/ou-educational-dc)"
199
			target_server_ucsschool_service="$service"
201
			target_server_ucsschool_service="$service"
200
			;;
202
			;;
201
		"UCS@school Administration")
203
		"UCS@school Administration")
202
			target_server_ucsschool_type=Verwaltungsnetz
204
			target_server_all_dcs="$(ucr_names_default ucsschool/ldap/default/groupname/all-administrativ-dc)"
205
			target_server_ou_dcs="$(ucr_names_default ucsschool/ldap/default/groupname/ou-administrativ-dc)"
203
			target_server_ucsschool_service="$service"
206
			target_server_ucsschool_service="$service"
204
			;;
207
			;;
205
	esac
208
	esac
 Lines 258-274    Link Here 
258
261
259
	echo -n "Check group memberschip : "
262
	echo -n "Check group memberschip : "
260
	test_output=$(univention-ssh "$ROOTPWD" "root@${target_school_dc_ip}" \
263
	test_output=$(univention-ssh "$ROOTPWD" "root@${target_school_dc_ip}" \
261
		/usr/sbin/udm groups/group list --filter name="DC-$target_server_ucsschool_type" | sed -n "/^ *hosts: $target_ldap_hostdn$/p")
264
		/usr/sbin/udm groups/group list --filter name="$target_server_all_dcs" | sed -n "/^ *hosts: $target_ldap_hostdn$/p")
262
	if [ -z "$test_output" ]; then
265
	if [ -z "$test_output" ]; then
263
		echo -e "\033[60Gfailed"
266
		echo -e "\033[60Gfailed"
264
		echo "$hostname is not member of the group DC-$target_server_ucsschool_type, this needs to be fixed first manually."
267
		echo "$hostname is not member of the group $target_server_all_dcs, this needs to be fixed first manually."
265
		exit 1
268
		exit 1
266
	fi
269
	fi
267
	test_output=$(univention-ssh "$ROOTPWD" "root@${target_school_dc_ip}" \
270
	test_output=$(univention-ssh "$ROOTPWD" "root@${target_school_dc_ip}" \
268
		/usr/sbin/udm groups/group list --filter name="OU$my_school_ou-DC-$target_server_ucsschool_type" | sed -n "/^ *hosts: $target_ldap_hostdn$/p")
271
		/usr/sbin/udm groups/group list --filter name="$(replace_ou "$target_server_ou_dcs" "$my_school_ou")" | sed -n "/^ *hosts: $target_ldap_hostdn$/p")
269
	if [ -z "$test_output" ]; then
272
	if [ -z "$test_output" ]; then
270
		echo -e "\033[60Gfailed"
273
		echo -e "\033[60Gfailed"
271
		echo "$hostname is not member of the group OU$my_school_ou-DC-$target_server_ucsschool_type, this needs to be fixed first manually."
274
		echo "$hostname is not member of the group $(replace_ou "$target_server_ou_dcs" "$my_school_ou"), this needs to be fixed first manually."
272
		exit 1
275
		exit 1
273
	else
276
	else
274
		echo -e "\033[60Gdone"
277
		echo -e "\033[60Gdone"
(-)ucs-school-import/usr/share/ucs-school-import/scripts/ucs-school-verify-class-memberships (-4 / +6 lines)
 Lines 42-47    Link Here 
42
import univention.admin.handlers.groups.group
42
import univention.admin.handlers.groups.group
43
import univention.admin.handlers.users.user
43
import univention.admin.handlers.users.user
44
import univention.admin.objects
44
import univention.admin.objects
45
from ucsschool.lib.models import School, SchoolClass, Staff, Student, Teacher
45
46
46
47
47
class Problem(Exception):
48
class Problem(Exception):
 Lines 160-166    Link Here 
160
161
161
162
162
def parse_line(lo, line):
163
def parse_line(lo, line):
163
	oubase = 'ou=%s,%s' % (line['school'], ucr['ldap/base'],)
164
	school = School(name=line['school'])
165
	oubase = school.dn
164
	uid = line['name']
166
	uid = line['name']
165
	try:
167
	try:
166
		dn = lo.search(filter_format('uid=%s', (uid,)), oubase, unique=True)[0][0]
168
		dn = lo.search(filter_format('uid=%s', (uid,)), oubase, unique=True)[0][0]
 Lines 173-180    Link Here 
173
			raise StudentDoesNotExists(line, uid)
175
			raise StudentDoesNotExists(line, uid)
174
		else:
176
		else:
175
			raise StudentIsInAnotherSchool(line, uid, dn)
177
			raise StudentIsInAnotherSchool(line, uid, dn)
176
	if not dn.endswith(',cn=schueler,cn=users,%s' % (oubase,)):
178
	if not dn.endswith(Student.get_container(school.name)):
177
		if not dn.endswith(',cn=lehrer,cn=users,%s' % (oubase,)) or not dn.endswith(',cn=mitarbeiter,cn=users,%s' % (oubase,)):
179
		if not dn.endswith(Teacher.get_container(school.name)) or not dn.endswith(Staff.get_container(school.name)):
178
			print('Ignoring teacher/staff %r' % (uid,))
180
			print('Ignoring teacher/staff %r' % (uid,))
179
			return
181
			return
180
		msg('ERROR: %s (%s %s) is not a student/teacher/staff.' % (uid, line['firstname'], line['lastname']))
182
		msg('ERROR: %s (%s %s) is not a student/teacher/staff.' % (uid, line['firstname'], line['lastname']))
 Lines 186-192    Link Here 
186
	correct = False
188
	correct = False
187
	invalid_groups = set()
189
	invalid_groups = set()
188
	for gdn, group in groups: # pylint: disable=W0612
190
	for gdn, group in groups: # pylint: disable=W0612
189
		if not gdn.endswith(',cn=klassen,cn=schueler,cn=groups,%s' % (oubase,)):
191
		if not gdn.endswith(SchoolClass.get_container(school.name)):
190
			if not gdn.endswith(oubase) and re.search(',ou=[^,]+,%s$' % (ucr['ldap/base'],), gdn, re.I):
192
			if not gdn.endswith(oubase) and re.search(',ou=[^,]+,%s$' % (ucr['ldap/base'],), gdn, re.I):
191
				raise StudentIsInAnotherClassInAnotherSchool(line, uid, dn, gdn)
193
				raise StudentIsInAnotherClassInAnotherSchool(line, uid, dn, gdn)
192
			continue  # ignore workgroups / Domain Users
194
			continue  # ignore workgroups / Domain Users
(-)ucs-school-ldap-acls-master/61ucsschool_presettings (-56 / +90 lines)
 Lines 1-65    Link Here 
1
@!@
2
# -*- coding: utf-8 -*-
3
import re
4
5
6
def replace_ucr_variables(template):
7
	variable_token = re.compile('@[$]@')
8
9
	dir_ucsschool = {
10
		'ALL_ADM_DC': configRegistry.get('ucsschool/ldap/default/groupname/all-administrativ-dc', 'DC-Verwaltungsnetz'),
11
		'ALL_ADM_MEMBER': configRegistry.get('ucsschool/ldap/default/groupname/all-administrativ-member', 'Member-Verwaltungsnetz'),
12
		'ALL_EDU_DC': configRegistry.get('ucsschool/ldap/default/groupname/all-educational-dc', 'DC-Edukativnetz'),
13
		'ALL_EDU_MEMBER': configRegistry.get('ucsschool/ldap/default/groupname/all-educational-member', 'Member-Edukativnetz'),
14
	}
15
16
	while 1:
17
		i = variable_token.finditer(template)
18
		try:
19
			start = i.next()
20
			end = i.next()
21
			name = template[start.end():end.start()]
22
23
			template = template[:start.start()] + dir_ucsschool.get(name,'') + template[end.end():]
24
		except StopIteration:
25
			break
26
27
	return template
28
29
30
aclset += """
1
# start 61ucsschool_presettings
31
# start 61ucsschool_presettings
2
32
3
# revert rule from UCS; Bug #41402
33
# revert rule from UCS; Bug #41402
4
access to attrs=entry,objectClass,uniqueMember,ou,uid,loginShell,homeDirectory,uidNumber,gidNumber,sn,cn,gecos,description,memberUid
34
access to attrs=entry,objectClass,uniqueMember,ou,uid,loginShell,homeDirectory,uidNumber,gidNumber,sn,cn,gecos,description,memberUid
5
	by dn.regex=".*cn=computers,ou=([^,]+),(ou=[^,]+,)?@%@ldap/base@%@" none break
35
	by dn.regex=".*cn=computers,ou=([^,]+),(ou=[^,]+,)?@%@ldap/base@%@" none break
6
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none break
36
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none break
7
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none break
37
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none break
8
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none break
38
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none break
9
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none break
39
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none break
10
	by set="user/objectClass & ([ucsschoolStudent] | [ucsschoolTeacher] | [ucsschoolStaff] | [ucsschoolAdministrator])" none break
40
	by set="user/objectClass & ([ucsschoolStudent] | [ucsschoolTeacher] | [ucsschoolStaff] | [ucsschoolAdministrator])" none break
11
	by * +0 break
41
	by * +0 break
12
42
13
# Slave-Controller und Member-Server duerfen Samba-Domaenenobjekt(e) modifizieren
43
# Slave-Controller und Member-Server duerfen Samba-Domaenenobjekt(e) modifizieren
14
access to filter="(objectClass=sambaDomain)"
44
access to filter="(objectClass=sambaDomain)"
15
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
45
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
16
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
46
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
17
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
47
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
18
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
48
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
19
	by * +0 break
49
	by * +0 break
20
50
21
# grant write access to domaincontroller slave/member server for certain univention app center settings
51
# grant write access to domaincontroller slave/member server for certain univention app center settings
22
access to dn.regex="^univentionAppID=([^,]+),cn=([^,]+),cn=apps,cn=univention,@%@ldap/base@%@$" filter="(objectClass=univentionApp)"
52
access to dn.regex="^univentionAppID=([^,]+),cn=([^,]+),cn=apps,cn=univention,@%@ldap/base@%@$" filter="(objectClass=univentionApp)"
23
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
53
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
24
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
54
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
25
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
55
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
26
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
56
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
27
	by * +0 break
57
	by * +0 break
28
58
29
access to dn.regex="^cn=([^,]+),cn=apps,cn=univention,@%@ldap/base@%@$" attrs=children,entry
59
access to dn.regex="^cn=([^,]+),cn=apps,cn=univention,@%@ldap/base@%@$" attrs=children,entry
30
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
60
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
31
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
61
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
32
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
62
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
33
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
63
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
34
	by * +0 break
64
	by * +0 break
35
65
36
access to dn="cn=apps,cn=univention,@%@ldap/base@%@" attrs=children,entry
66
access to dn="cn=apps,cn=univention,@%@ldap/base@%@" attrs=children,entry
37
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
67
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
38
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
68
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
39
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
69
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
40
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
70
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
41
	by * +0 break
71
	by * +0 break
42
72
43
# Slave controllers and memberservers require write access to virtual machine manager objects
73
# Slave controllers and memberservers require write access to virtual machine manager objects
44
access to dn.regex="^univentionVirtualMachineUUID=([^,]+),cn=Information,cn=Virtual Machine Manager,@%@ldap/base@%@" filter="(objectClass=univentionVirtualMachine)"
74
access to dn.regex="^univentionVirtualMachineUUID=([^,]+),cn=Information,cn=Virtual Machine Manager,@%@ldap/base@%@" filter="(objectClass=univentionVirtualMachine)"
45
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
75
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
46
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
76
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
47
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
77
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
48
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
78
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
49
	by * +0 break
79
	by * +0 break
50
80
51
access to dn.regex="^cn=([^,]+),cn=CloudConnection,cn=Virtual Machine Manager,@%@ldap/base@%@" filter="(objectClass=univentionVirtualMachineCloudConnection)"
81
access to dn.regex="^cn=([^,]+),cn=CloudConnection,cn=Virtual Machine Manager,@%@ldap/base@%@" filter="(objectClass=univentionVirtualMachineCloudConnection)"
52
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
82
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
53
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
83
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
54
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
84
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
55
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
85
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
56
	by * +0 break
86
	by * +0 break
57
87
58
access to dn="cn=(Information|CloudConnection),cn=Virtual Machine Manager,@%@ldap/base@%@" attrs=children,entry
88
access to dn="cn=(Information|CloudConnection),cn=Virtual Machine Manager,@%@ldap/base@%@" attrs=children,entry
59
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
89
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
60
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
90
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
61
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
91
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
62
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
92
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
63
	by dn.regex="^[^,]+,cn=dc,cn=computers,@%@ldap/base@%@$$" write
93
	by dn.regex="^[^,]+,cn=dc,cn=computers,@%@ldap/base@%@$$" write
64
	by dn.regex="^[^,]+,cn=memberserver,cn=computers,@%@ldap/base@%@$$" write
94
	by dn.regex="^[^,]+,cn=memberserver,cn=computers,@%@ldap/base@%@$$" write
65
	by * +0 break
95
	by * +0 break
 Lines 66-112    Link Here 
66
96
67
# Slave-Controller und Member-Server benoetigen idmap-Container
97
# Slave-Controller und Member-Server benoetigen idmap-Container
68
access to dn.base="cn=idmap,cn=univention,@%@ldap/base@%@"
98
access to dn.base="cn=idmap,cn=univention,@%@ldap/base@%@"
69
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
99
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
70
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
100
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
71
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
101
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
72
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
102
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
73
	by * +0 break
103
	by * +0 break
74
104
75
# Slave-Controller und Member-Server benoetigen ID-Mapping
105
# Slave-Controller und Member-Server benoetigen ID-Mapping
76
access to dn.subtree="cn=idmap,cn=univention,@%@ldap/base@%@" filter="(|(&(objectClass=sambaUnixIdPool)(objectClass=organizationalRole)(objectClass=top))(&(objectClass=sambaIdmapEntry)(objectClass=sambaSidEntry)))"
106
access to dn.subtree="cn=idmap,cn=univention,@%@ldap/base@%@" filter="(|(&(objectClass=sambaUnixIdPool)(objectClass=organizationalRole)(objectClass=top))(&(objectClass=sambaIdmapEntry)(objectClass=sambaSidEntry)))"
77
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
107
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
78
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
108
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
79
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
109
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
80
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
110
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
81
	by * +0 break
111
	by * +0 break
82
112
83
# Slave-Controller und Member-Server benoetigen nicht alle Container
113
# Slave-Controller und Member-Server benoetigen nicht alle Container
84
access to dn.subtree="cn=backup,@%@ldap/base@%@"
114
access to dn.subtree="cn=backup,@%@ldap/base@%@"
85
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
115
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
86
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
116
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
87
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
117
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
88
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
118
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
89
	by * +0 break
119
	by * +0 break
90
120
91
access to dn.subtree="cn=printers,@%@ldap/base@%@"
121
access to dn.subtree="cn=printers,@%@ldap/base@%@"
92
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
122
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
93
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
123
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
94
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
124
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
95
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
125
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
96
	by * +0 break
126
	by * +0 break
97
127
98
access to dn.subtree="cn=networks,@%@ldap/base@%@"
128
access to dn.subtree="cn=networks,@%@ldap/base@%@"
99
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
129
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
100
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
130
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
101
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
131
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
102
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
132
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
103
	by * +0 break
133
	by * +0 break
104
134
105
access to dn.regex="^(.*,)?cn=(cups|ppolicy|packages|services|templates|admin-settings|default containers|saml-serviceprovider),cn=univention,@%@ldap/base@%@$$"
135
access to dn.regex="^(.*,)?cn=(cups|ppolicy|packages|services|templates|admin-settings|default containers|saml-serviceprovider),cn=univention,@%@ldap/base@%@$$"
106
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
136
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
107
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
137
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
108
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
138
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
109
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
139
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
110
	by * +0 break
140
	by * +0 break
111
141
112
# end 61ucsschool_presettings
142
# end 61ucsschool_presettings
143
"""
144
145
print replace_ucr_variables(aclset)
146
@!@
(-)ucs-school-ldap-acls-master/65ucsschool (-57 / +61 lines)
 Lines 13-31    Link Here 
13
def replace_ucr_variables(template):
13
def replace_ucr_variables(template):
14
	variable_token = re.compile('@[$]@')
14
	variable_token = re.compile('@[$]@')
15
15
16
	dir_ucsschool = { }
16
	dir_ucsschool = {
17
	dir_ucsschool[ 'DISTRICT' ] = ''
17
		'DISTRICT':       'ou=[^,]+,' if configRegistry.is_true('ucsschool/ldap/district/enable') else '',
18
	if configRegistry.get('ucsschool/ldap/district/enable','no').lower() in ( 'yes', 'true', '1' ):
18
		'PUPILS':         configRegistry.get('ucsschool/ldap/default/container/pupils', 'schueler'),
19
		dir_ucsschool[ 'DISTRICT' ] = 'ou=[^,]+,'
19
		'TEACHERS':       configRegistry.get('ucsschool/ldap/default/container/teachers', 'lehrer'),
20
	dir_ucsschool[ 'PUPILS' ] =   configRegistry.get('ucsschool/ldap/default/container/pupils', 'schueler')
20
		'STAFF':          configRegistry.get('ucsschool/ldap/default/container/staff', 'mitarbeiter'),
21
	dir_ucsschool[ 'TEACHERS' ] = configRegistry.get('ucsschool/ldap/default/container/teachers', 'lehrer')
21
		'TEACHERS-STAFF': configRegistry.get('ucsschool/ldap/default/container/teachers-and-staff', 'lehrer und mitarbeiter'),
22
	dir_ucsschool[ 'STAFF' ] =	  configRegistry.get('ucsschool/ldap/default/container/staff', 'mitarbeiter')
22
		'ADMINS':         configRegistry.get('ucsschool/ldap/default/container/admins', 'admins'),
23
	dir_ucsschool[ 'TEACHERS-STAFF' ] = configRegistry.get('ucsschool/ldap/default/container/teachers-and-staff', 'lehrer und mitarbeiter')
23
		'GRPADMINS':      configRegistry.get('ucsschool/ldap/default/groupprefix/admins', 'admins-'),
24
	dir_ucsschool[ 'ADMINS' ] =	  configRegistry.get('ucsschool/ldap/default/container/admins', 'admins')
24
		'EXAM':           configRegistry.get('ucsschool/ldap/default/container/exam', 'examusers'),
25
	dir_ucsschool[ 'GRPADMINS' ] =	  configRegistry.get('ucsschool/ldap/default/groupprefix/admins', 'admins-')
25
		'CLASS':          configRegistry.get('ucsschool/ldap/default/container/class', 'klassen'),
26
	dir_ucsschool[ 'EXAM' ] = configRegistry.get('ucsschool/ldap/default/container/exam', 'examusers')
26
		'ROOMS':          configRegistry.get('ucsschool/ldap/default/container/rooms', 'raeume'),
27
		'ALL_ADM_DC': configRegistry.get('ucsschool/ldap/default/groupname/all-administrativ-dc', 'DC-Verwaltungsnetz'),
28
		'ALL_ADM_MEMBER': configRegistry.get('ucsschool/ldap/default/groupname/all-administrativ-member', 'Member-Verwaltungsnetz'),
29
		'ALL_EDU_DC': configRegistry.get('ucsschool/ldap/default/groupname/all-educational-dc', 'DC-Edukativnetz'),
30
		'ALL_EDU_MEMBER': configRegistry.get('ucsschool/ldap/default/groupname/all-educational-member', 'Member-Edukativnetz'),
31
	}
27
32
28
29
	while 1:
33
	while 1:
30
		i = variable_token.finditer(template)
34
		i = variable_token.finditer(template)
31
		try:
35
		try:
 Lines 43-62    Link Here 
43
aclset += """
47
aclset += """
44
# DC Slaves need write access to the members of the group Domain Computers
48
# DC Slaves need write access to the members of the group Domain Computers
45
access to dn.exact="cn=Domain Computers,cn=groups,@%@ldap/base@%@" attrs="uniqueMember,memberUid"
49
access to dn.exact="cn=Domain Computers,cn=groups,@%@ldap/base@%@" attrs="uniqueMember,memberUid"
46
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
50
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
47
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
51
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
48
	by * +0 break
52
	by * +0 break
49
53
50
# Slave DCs can read and write policy containers for MS GPOs and msPrintConnectionPolicy objects
54
# Slave DCs can read and write policy containers for MS GPOs and msPrintConnectionPolicy objects
51
access to dn.subtree="cn=policies,cn=system,@%@ldap/base@%@" filter="(|(objectClass=msGPOContainer)(objectClass=organizationalRole)(objectClass=msPrintConnectionPolicy))"
55
access to dn.subtree="cn=policies,cn=system,@%@ldap/base@%@" filter="(|(objectClass=msGPOContainer)(objectClass=organizationalRole)(objectClass=msPrintConnectionPolicy))"
52
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
56
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
53
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
57
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
54
	by * +0 break
58
	by * +0 break
55
59
56
# Slave DCs can read and write policy containers for MS WMI filter objects
60
# Slave DCs can read and write policy containers for MS WMI filter objects
57
access to dn.subtree="cn=WMIPolicy,cn=system,@%@ldap/base@%@" filter="(|(objectClass=msWMISom)(objectClass=organizationalRole))"
61
access to dn.subtree="cn=WMIPolicy,cn=system,@%@ldap/base@%@" filter="(|(objectClass=msWMISom)(objectClass=organizationalRole))"
58
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
62
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
59
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
63
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
60
	by * +0 break
64
	by * +0 break
61
65
62
# Lehrer, Mitarbeiter und OU-Admins duerfen Schueler-Passwoerter aendern
66
# Lehrer, Mitarbeiter und OU-Admins duerfen Schueler-Passwoerter aendern
 Lines 70-81    Link Here 
70
	by * +0 break
74
	by * +0 break
71
75
72
# Lehrer, Mitarbeiter und OU-Admins duerfen Raum-Gruppen anlegen und bearbeiten
76
# Lehrer, Mitarbeiter und OU-Admins duerfen Raum-Gruppen anlegen und bearbeiten
73
access to dn.regex="^cn=raeume,cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" attrs=children,entry
77
access to dn.regex="^cn=@$@ROOMS@$@,cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" attrs=children,entry
74
	by set.expand="[$1] & ([ldap:///]+user/entryDN+[?entryDN?base?%28%7C%28objectClass%3DucsschoolTeacher%29%28objectClass%3DucsschoolAdministrator%29%28objectClass%3DucsschoolStaff%29%29])/ucsschoolSchool" write
78
	by set.expand="[$1] & ([ldap:///]+user/entryDN+[?entryDN?base?%28%7C%28objectClass%3DucsschoolTeacher%29%28objectClass%3DucsschoolAdministrator%29%28objectClass%3DucsschoolStaff%29%29])/ucsschoolSchool" write
75
@$@# old rule@$@	by dn.regex="^uid=([^,]+),cn=(@$@TEACHERS@$@|@$@TEACHERS-STAFF@$@|@$@STAFF@$@|@$@ADMINS@$@),cn=users,ou=$1,@$@DISTRICT@$@@%@ldap/base@%@$$" write
79
@$@# old rule@$@	by dn.regex="^uid=([^,]+),cn=(@$@TEACHERS@$@|@$@TEACHERS-STAFF@$@|@$@STAFF@$@|@$@ADMINS@$@),cn=users,ou=$1,@$@DISTRICT@$@@%@ldap/base@%@$$" write
76
	by * +0 break
80
	by * +0 break
77
81
78
access to dn.regex="^cn=([^,]+),cn=raeume,cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" filter="(&(!(|(uidNumber=*)(objectClass=SambaSamAccount)))(objectClass=univentionGroup))"
82
access to dn.regex="^cn=([^,]+),cn=@$@ROOMS@$@,cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" filter="(&(!(|(uidNumber=*)(objectClass=SambaSamAccount)))(objectClass=univentionGroup))"
79
	by set.expand="[$2] & ([ldap:///]+user/entryDN+[?entryDN?base?%28%7C%28objectClass%3DucsschoolTeacher%29%28objectClass%3DucsschoolAdministrator%29%28objectClass%3DucsschoolStaff%29%29])/ucsschoolSchool" write
83
	by set.expand="[$2] & ([ldap:///]+user/entryDN+[?entryDN?base?%28%7C%28objectClass%3DucsschoolTeacher%29%28objectClass%3DucsschoolAdministrator%29%28objectClass%3DucsschoolStaff%29%29])/ucsschoolSchool" write
80
@$@# old rule@$@	by dn.regex="^uid=([^,]+),cn=(@$@TEACHERS@$@|@$@TEACHERS-STAFF@$@|@$@STAFF@$@|@$@ADMINS@$@),cn=users,ou=$2,@$@DISTRICT@$@@%@ldap/base@%@$$" write
84
@$@# old rule@$@	by dn.regex="^uid=([^,]+),cn=(@$@TEACHERS@$@|@$@TEACHERS-STAFF@$@|@$@STAFF@$@|@$@ADMINS@$@),cn=users,ou=$2,@$@DISTRICT@$@@%@ldap/base@%@$$" write
81
	by * +0 break
85
	by * +0 break
 Lines 145-154    Link Here 
145
	by * +0 break
149
	by * +0 break
146
150
147
access to dn.subtree="cn=temporary,cn=univention,@%@ldap/base@%@"
151
access to dn.subtree="cn=temporary,cn=univention,@%@ldap/base@%@"
148
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
152
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
149
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
153
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
150
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
154
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
151
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
155
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
152
	by * +0 break
156
	by * +0 break
153
157
154
# OU-Admins duerfen MAC-Adressen im Rechner- und DHCP-Objekt aendern
158
# OU-Admins duerfen MAC-Adressen im Rechner- und DHCP-Objekt aendern
 Lines 172-195    Link Here 
172
176
173
# domaincontroller slaves and memberservers of management group are not allowed to replicate pupils and teachers
177
# domaincontroller slaves and memberservers of management group are not allowed to replicate pupils and teachers
174
access to dn.regex="^.+,cn=(@$@TEACHERS@$@|@$@PUPILS@$@),cn=users,ou=[^,]+,@$@DISTRICT@$@@%@ldap/base@%@$$"
178
access to dn.regex="^.+,cn=(@$@TEACHERS@$@|@$@PUPILS@$@),cn=users,ou=[^,]+,@$@DISTRICT@$@@%@ldap/base@%@$$"
175
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
179
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
176
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
180
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
177
	by * +0 break
181
	by * +0 break
178
182
179
access to filter="(|(objectClass=ucsschoolStudent)(&(objectClass=ucsschoolTeacher)(!(objectClass=ucsschoolStaff))))"
183
access to filter="(|(objectClass=ucsschoolStudent)(&(objectClass=ucsschoolTeacher)(!(objectClass=ucsschoolStaff))))"
180
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
184
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
181
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
185
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
182
	by * +0 break
186
	by * +0 break
183
187
184
# domaincontroller slaves and memberservers of educational group are not allowed to replicate staff users
188
# domaincontroller slaves and memberservers of educational group are not allowed to replicate staff users
185
access to dn.regex="^.+,cn=@$@STAFF@$@,cn=users,ou=[^,]+,@$@DISTRICT@$@@%@ldap/base@%@$$"
189
access to dn.regex="^.+,cn=@$@STAFF@$@,cn=users,ou=[^,]+,@$@DISTRICT@$@@%@ldap/base@%@$$"
186
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
190
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
187
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
191
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
188
	by * +0 break
192
	by * +0 break
189
193
190
access to filter="(&(objectClass=ucsschoolStaff)(!(objectClass=ucsschoolTeacher))(!(objectClass=ucsschoolAdministrator)))"
194
access to filter="(&(objectClass=ucsschoolStaff)(!(objectClass=ucsschoolTeacher))(!(objectClass=ucsschoolAdministrator)))"
191
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
195
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
192
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
196
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
193
	by * +0 break
197
	by * +0 break
194
198
195
# FIXME: this rule allows to read all passwords underneath of all OU's instead of only the password belonging to the OU; explain why or fix it
199
# FIXME: this rule allows to read all passwords underneath of all OU's instead of only the password belonging to the OU; explain why or fix it
 Lines 196-236    Link Here 
196
# TODO: are the following attributes missing here?: 'sambaBadPasswordCount', 'krb5PasswordEnd', 'shadowMax', 'sambaAcctFlags', 'sambaPasswordHistory'
200
# TODO: are the following attributes missing here?: 'sambaBadPasswordCount', 'krb5PasswordEnd', 'shadowMax', 'sambaAcctFlags', 'sambaPasswordHistory'
197
# Memberserver duerfen Passwoerter aller Objekte unterhalb einer Schule lesen
201
# Memberserver duerfen Passwoerter aller Objekte unterhalb einer Schule lesen
198
access to dn.regex="^(.+,)?ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" attrs=userPassword,krb5Key,krb5KDCFlags,sambaNTPassword,sambaLMPassword,shadowLastChange,sambaPwdLastSet,pwhistory,krb5KeyVersionNumber,sambaPwdCanChange,sambaPwdMustChange
202
access to dn.regex="^(.+,)?ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" attrs=userPassword,krb5Key,krb5KDCFlags,sambaNTPassword,sambaLMPassword,shadowLastChange,sambaPwdLastSet,pwhistory,krb5KeyVersionNumber,sambaPwdCanChange,sambaPwdMustChange
199
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" +rscxd
203
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" +rscxd
200
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" +rscxd
204
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" +rscxd
201
	by * +0 break
205
	by * +0 break
202
206
203
# Alle DC-Slaves muessen alle Benutzercontainer und Gruppen jeder Schule lesen koennen
207
# Alle DC-Slaves muessen alle Benutzercontainer und Gruppen jeder Schule lesen koennen
204
access to dn.regex="^ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" filter="objectClass=ucsschoolOrganizationalUnit"
208
access to dn.regex="^ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" filter="objectClass=ucsschoolOrganizationalUnit"
205
	by group/univentionGroup/uniqueMember.expand="cn=OU$1-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
209
	by group/univentionGroup/uniqueMember.expand="cn=OU$1-@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
206
	by group/univentionGroup/uniqueMember.expand="cn=OU$1-DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
210
	by group/univentionGroup/uniqueMember.expand="cn=OU$1-@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
207
	by dn.regex="^cn=.*,cn=server,cn=computers,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" +rscxd
211
	by dn.regex="^cn=.*,cn=server,cn=computers,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" +rscxd
208
	by * +0 break
212
	by * +0 break
209
213
210
access to dn.regex="^cn=(users|groups|@$@EXAM@$@),ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$"
214
access to dn.regex="^cn=(users|groups|@$@EXAM@$@),ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$"
211
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
215
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
212
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
216
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
213
	by dn.regex="^cn=.*,cn=server,cn=computers,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" +rscxd
217
	by dn.regex="^cn=.*,cn=server,cn=computers,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" +rscxd
214
	by * +0 break
218
	by * +0 break
215
219
216
access to dn.regex="^([^,]+),cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$"
220
access to dn.regex="^([^,]+),cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$"
217
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
221
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
218
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
222
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
219
	by dn.regex="^cn=.*,cn=server,cn=computers,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" +rscxd
223
	by dn.regex="^cn=.*,cn=server,cn=computers,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" +rscxd
220
	by * +0 break
224
	by * +0 break
221
225
222
access to dn.regex="^cn=(@$@PUPILS@$@|@$@TEACHERS@$@|@$@TEACHERS-STAFF@$@|@$@STAFF@$@|@$@ADMINS@$@),cn=users,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$"
226
access to dn.regex="^cn=(@$@PUPILS@$@|@$@TEACHERS@$@|@$@TEACHERS-STAFF@$@|@$@STAFF@$@|@$@ADMINS@$@),cn=users,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$"
223
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
227
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
224
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
228
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
225
	by dn.regex="^cn=.*,cn=server,cn=computers,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" +rscxd
229
	by dn.regex="^cn=.*,cn=server,cn=computers,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" +rscxd
226
	by * +0 break
230
	by * +0 break
227
231
228
# DC-Slaves muessen die Benutzer ihrer Schule lesen und schreiben duerfen
232
# DC-Slaves muessen die Benutzer ihrer Schule lesen und schreiben duerfen
229
access to dn.regex="^uid=([^,]+),cn=(@$@PUPILS@$@|@$@TEACHERS@$@|@$@TEACHERS-STAFF@$@|@$@STAFF@$@|@$@ADMINS@$@),cn=users,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$"
233
access to dn.regex="^uid=([^,]+),cn=(@$@PUPILS@$@|@$@TEACHERS@$@|@$@TEACHERS-STAFF@$@|@$@STAFF@$@|@$@ADMINS@$@),cn=users,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$"
230
	by set="([cn=OU]+this/ucsschoolSchool+[-DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@])/uniqueMember & user" write
234
	by set="([cn=OU]+this/ucsschoolSchool+[-@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@])/uniqueMember & user" write
231
	by * +0 break
235
	by * +0 break
232
access to dn.regex="^uid=([^,]+),cn=@$@EXAM@$@,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$"
236
access to dn.regex="^uid=([^,]+),cn=@$@EXAM@$@,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$"
233
	by set="([cn=OU]+this/ucsschoolSchool+[-DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@])/uniqueMember & user" write
237
	by set="([cn=OU]+this/ucsschoolSchool+[-@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@])/uniqueMember & user" write
234
	by * +0 break
238
	by * +0 break
235
239
236
# Schul-Slave-Server duerfen nur Eintraege ihrer OU lesen und schreiben (Passwortaenderungen etc.)
240
# Schul-Slave-Server duerfen nur Eintraege ihrer OU lesen und schreiben (Passwortaenderungen etc.)
 Lines 237-249    Link Here 
237
# Lehrer und Memberserver duerfen sie lesen, ou-eigene bekommen Standard-ACLs, ou-fremde Server/user duerfen nichts
241
# Lehrer und Memberserver duerfen sie lesen, ou-eigene bekommen Standard-ACLs, ou-fremde Server/user duerfen nichts
238
access to dn.regex="^(.+,)?ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$"
242
access to dn.regex="^(.+,)?ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$"
239
	by set.expand="[ldap:///ou=$2,@%@ldap/base@%@?ou?base?%28%21%28objectClass%3DucsschoolOrganizationalUnit%29%29]/ou" +0 break
243
	by set.expand="[ldap:///ou=$2,@%@ldap/base@%@?ou?base?%28%21%28objectClass%3DucsschoolOrganizationalUnit%29%29]/ou" +0 break
240
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
244
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
241
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
245
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
242
	by group/univentionLDAPACL/univentionLDAPAccessWrite.expand="ou=$2,@$@DISTRICT@$@@%@ldap/base@%@" write
246
	by group/univentionLDAPACL/univentionLDAPAccessWrite.expand="ou=$2,@$@DISTRICT@$@@%@ldap/base@%@" write
243
	by dn.regex="^uid=([^,]+),cn=(@$@TEACHERS@$@|@$@TEACHERS-STAFF@$@|@$@STAFF@$@|@$@ADMINS@$@),cn=users,ou=$2,@$@DISTRICT@$@@%@ldap/base@%@$$" +rscxd continue
247
	by dn.regex="^uid=([^,]+),cn=(@$@TEACHERS@$@|@$@TEACHERS-STAFF@$@|@$@STAFF@$@|@$@ADMINS@$@),cn=users,ou=$2,@$@DISTRICT@$@@%@ldap/base@%@$$" +rscxd continue
244
	by set.expand="[$2] & ([ldap:///]+user/entryDN+[?entryDN?base?%28%7C%28objectClass%3DucsschoolTeacher%29%28objectClass%3DucsschoolAdministrator%29%28objectClass%3DucsschoolStaff%29%29])/ucsschoolSchool" +rscxd continue
248
	by set.expand="[$2] & ([ldap:///]+user/entryDN+[?entryDN?base?%28%7C%28objectClass%3DucsschoolTeacher%29%28objectClass%3DucsschoolAdministrator%29%28objectClass%3DucsschoolStaff%29%29])/ucsschoolSchool" +rscxd continue
245
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" +0 stop
249
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" +0 stop
246
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" +0 stop
250
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" +0 stop
247
	by set.expand="([ldap:///]+user/entryDN+[?entryDN?base?%28%7C%28objectClass%3DucsschoolTeacher%29%28objectClass%3DucsschoolAdministrator%29%28objectClass%3DucsschoolStaff%29%29])/ucsschoolSchool" +0 stop
251
	by set.expand="([ldap:///]+user/entryDN+[?entryDN?base?%28%7C%28objectClass%3DucsschoolTeacher%29%28objectClass%3DucsschoolAdministrator%29%28objectClass%3DucsschoolStaff%29%29])/ucsschoolSchool" +0 stop
248
	by dn.regex="^.*,ou=$2,@$@DISTRICT@$@@%@ldap/base@%@$$" +rscxd break
252
	by dn.regex="^.*,ou=$2,@$@DISTRICT@$@@%@ldap/base@%@$$" +rscxd break
249
	by dn.regex="^.*,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" +0 stop
253
	by dn.regex="^.*,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" +0 stop
 Lines 250-271    Link Here 
250
	by * +0 break
254
	by * +0 break
251
255
252
# Slave-Controller duerfen Klassen-Gruppen bearbeiten (AUSNAHME! Wird fuer Lehrerzuordnung in UMC benoetigt!)
256
# Slave-Controller duerfen Klassen-Gruppen bearbeiten (AUSNAHME! Wird fuer Lehrerzuordnung in UMC benoetigt!)
253
access to dn.regex="^cn=klassen,cn=@$@PUPILS@$@,cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" attrs=children,entry
257
access to dn.regex="^cn=@$@CLASS@$@,cn=@$@PUPILS@$@,cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" attrs=children,entry
254
	by group/univentionGroup/uniqueMember.expand="cn=OU$1-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
258
	by group/univentionGroup/uniqueMember.expand="cn=OU$1-@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
255
	by group/univentionGroup/uniqueMember.expand="cn=OU$1-DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
259
	by group/univentionGroup/uniqueMember.expand="cn=OU$1-@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
256
	by * +0 break
260
	by * +0 break
257
261
258
access to dn.regex="^cn=([^,]+),cn=klassen,cn=@$@PUPILS@$@,cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" filter="(&(!(|(uidNumber=*)(objectClass=SambaSamAccount)))(objectClass=univentionGroup))"
262
access to dn.regex="^cn=([^,]+),cn=klassen,cn=@$@PUPILS@$@,cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" filter="(&(!(|(uidNumber=*)(objectClass=SambaSamAccount)))(objectClass=univentionGroup))"
259
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
263
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
260
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
264
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
261
	by * +0 break
265
	by * +0 break
262
266
263
# Schulserver duerfen die Passwoerter aller globalen Objekte replizieren
267
# Schulserver duerfen die Passwoerter aller globalen Objekte replizieren
264
access to dn.regex="^(.+,)?cn=(users|kerberos|computers),@%@ldap/base@%@$$"
268
access to dn.regex="^(.+,)?cn=(users|kerberos|computers),@%@ldap/base@%@$$"
265
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" +rscxd
269
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" +rscxd
266
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" +rscxd
270
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" +rscxd
267
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" +rscxd
271
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" +rscxd
268
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" +rscxd
272
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" +rscxd
269
	by * +0 break
273
	by * +0 break
270
"""
274
"""
271
275
(-)ucs-school-ldap-acls-master/70ucsschool-ldap-acls-master.inst (-1 / +7 lines)
 Lines 32-37    Link Here 
32
VERSION=7
32
VERSION=7
33
. /usr/share/univention-join/joinscripthelper.lib
33
. /usr/share/univention-join/joinscripthelper.lib
34
. /usr/share/univention-lib/ldap.sh
34
. /usr/share/univention-lib/ldap.sh
35
. /usr/share/ucs-school-lib/base.sh
36
35
joinscript_init
37
joinscript_init
36
38
37
eval "$(univention-config-registry shell)"
39
eval "$(univention-config-registry shell)"
 Lines 43-49    Link Here 
43
	--set name="ucsschool"
45
	--set name="ucsschool"
44
46
45
# create global groups required for LDAP ACLs for UCS@school
47
# create global groups required for LDAP ACLs for UCS@school
46
for grp in "DC-Verwaltungsnetz" "Member-Verwaltungsnetz" "DC-Edukativnetz" "Member-Edukativnetz" ; do
48
for grp in \
49
		"$(ucr_names_default ucsschool/ldap/default/groupname/all-administrativ-dc)" \
50
		"$(ucr_names_default ucsschool/ldap/default/groupname/all-administrativ-member)" \
51
		"$(ucr_names_default ucsschool/ldap/default/groupname/all-educational-dc)" \
52
		"$(ucr_names_default ucsschool/ldap/default/groupname/all-educational-member)"; do
47
	univention-directory-manager groups/group create "$@" \
53
	univention-directory-manager groups/group create "$@" \
48
		--ignore_exist \
54
		--ignore_exist \
49
		--position="cn=ucsschool,cn=groups,$ldap_base" \
55
		--position="cn=ucsschool,cn=groups,$ldap_base" \
(-)ucs-school-ldap-acls-master/debian/control (-1 / +1 lines)
 Lines 9-15    Link Here 
9
9
10
Package: ucs-school-ldap-acls-master
10
Package: ucs-school-ldap-acls-master
11
Architecture: all
11
Architecture: all
12
Depends: univention-ldap-server, univention-ldap-config
12
Depends: univention-ldap-server, univention-ldap-config, shell-ucs-school
13
Conflicts: univention-server-slave, univention-server-member, univention-mobile-client, univention-managed-client, univention-basesystem
13
Conflicts: univention-server-slave, univention-server-member, univention-mobile-client, univention-managed-client, univention-basesystem
14
Description: Special LDAP ACLs for UCS@school
14
Description: Special LDAP ACLs for UCS@school
15
 This package provides additional LDAP ACLs for slapd
15
 This package provides additional LDAP ACLs for slapd
(-)ucs-school-lib/python/models/school.py (-33 / +37 lines)
 Lines 79-100    Link Here 
79
	def get_container(cls, school=None):
79
	def get_container(cls, school=None):
80
		return ucr.get('ldap/base')
80
		return ucr.get('ldap/base')
81
81
82
	@classmethod
83
	def cn_name(cls, name, default):
84
		ucr_var = 'ucsschool/ldap/default/container/%s' % name
85
		return ucr.get(ucr_var, default)
86
87
	def create_default_containers(self, lo):
82
	def create_default_containers(self, lo):
88
		cn_pupils = self.cn_name('pupils', 'schueler')
83
		search_base = self.get_search_base(self.name)
89
		cn_teachers = self.cn_name('teachers', 'lehrer')
84
		cn_pupils = ldap.explode_dn(search_base.students, True)[0]
90
		cn_admins = self.cn_name('admins', 'admins')
85
		cn_teachers = ldap.explode_dn(search_base.teachers, True)[0]
91
		cn_classes = self.cn_name('class', 'klassen')
86
		cn_admins = ldap.explode_dn(search_base.admins, True)[0]
92
		cn_rooms = self.cn_name('rooms', 'raeume')
87
		cn_classes = ldap.explode_dn(search_base.classes, True)[0]
88
		cn_rooms = ldap.explode_dn(search_base.rooms, True)[0]
93
		user_containers = [cn_pupils, cn_teachers, cn_admins]
89
		user_containers = [cn_pupils, cn_teachers, cn_admins]
94
		group_containers = [cn_pupils, [cn_classes], cn_teachers, cn_rooms]
90
		group_containers = [cn_pupils, [cn_classes], cn_teachers, cn_rooms]
95
		if self.shall_create_administrative_objects():
91
		if self.shall_create_administrative_objects():
96
			cn_staff = self.cn_name('staff', 'mitarbeiter')
92
			cn_staff = ldap.explode_dn(search_base.staff, True)[0]
97
			cn_teachers_staff = self.cn_name('teachers-and-staff', 'lehrer und mitarbeiter')
93
			cn_teachers_staff = ldap.explode_dn(search_base.teachersAndStaff, True)[0]
98
			user_containers.extend([cn_staff, cn_teachers_staff])
94
			user_containers.extend([cn_staff, cn_teachers_staff])
99
			group_containers.append(cn_staff)
95
			group_containers.append(cn_staff)
100
		containers_with_path = {
96
		containers_with_path = {
 Lines 126-137    Link Here 
126
			for cn in containers:
122
			for cn in containers:
127
				last_dn = _add_container(cn, last_dn, self.dn, path, lo)
123
				last_dn = _add_container(cn, last_dn, self.dn, path, lo)
128
124
129
	def group_name(self, prefix_var, default_prefix):
130
		ucr_var = 'ucsschool/ldap/default/groupprefix/%s' % prefix_var
131
		name_part = ucr.get(ucr_var, default_prefix)
132
		school_part = self.name.lower()
133
		return '%s%s' % (name_part, school_part)
134
135
	def get_umc_policy_dn(self, name):
125
	def get_umc_policy_dn(self, name):
136
		# at least the default ones should exist due to the join script
126
		# at least the default ones should exist due to the join script
137
		return ucr.get('ucsschool/ldap/default/policy/umc/%s' % name, 'cn=ucsschool-umc-%s-default,cn=UMC,cn=policies,%s' % (name, ucr.get('ldap/base')))
127
		return ucr.get('ucsschool/ldap/default/policy/umc/%s' % name, 'cn=ucsschool-umc-%s-default,cn=UMC,cn=policies,%s' % (name, ucr.get('ldap/base')))
 Lines 152-159    Link Here 
152
			group.create(lo)
142
			group.create(lo)
153
143
154
		# cn=ouadmins
144
		# cn=ouadmins
155
		admin_group_container = 'cn=ouadmins,cn=groups,%s' % ucr.get('ldap/base')
145
		search_base = self.get_search_base(self.name)
156
		group = BasicGroup.cache(self.group_name('admins', 'admins-'), container=admin_group_container)
146
		group = BasicGroup.cache("{}{}".format(search_base.group_prefix_admins, self.name.lower()), container=search_base.globalGroupContainer)
157
		group.create(lo)
147
		group.create(lo)
158
		group.add_umc_policy(self.get_umc_policy_dn('admins'), lo)
148
		group.add_umc_policy(self.get_umc_policy_dn('admins'), lo)
159
		try:
149
		try:
 Lines 168-185    Link Here 
168
			udm_obj.modify()
158
			udm_obj.modify()
169
159
170
		# cn=schueler
160
		# cn=schueler
171
		group = Group.cache(self.group_name('pupils', 'schueler-'), self.name)
161
		group = Group.cache("{}{}".format(search_base.group_prefix_students, self.name.lower()), self.name)
172
		group.create(lo)
162
		group.create(lo)
173
		group.add_umc_policy(self.get_umc_policy_dn('pupils'), lo)
163
		group.add_umc_policy(self.get_umc_policy_dn('pupils'), lo)
174
164
175
		# cn=lehrer
165
		# cn=lehrer
176
		group = Group.cache(self.group_name('teachers', 'lehrer-'), self.name)
166
		group = Group.cache("{}{}".format(search_base.group_prefix_teachers, self.name.lower()), self.name)
177
		group.create(lo)
167
		group.create(lo)
178
		group.add_umc_policy(self.get_umc_policy_dn('teachers'), lo)
168
		group.add_umc_policy(self.get_umc_policy_dn('teachers'), lo)
179
169
180
		# cn=mitarbeiter
170
		# cn=mitarbeiter
181
		if self.shall_create_administrative_objects():
171
		if self.shall_create_administrative_objects():
182
			group = Group.cache(self.group_name('staff', 'mitarbeiter-'), self.name)
172
			group = Group.cache("{}{}".format(search_base.group_prefix_staff, self.name.lower()), self.name)
183
			group.create(lo)
173
			group.create(lo)
184
			group.add_umc_policy(self.get_umc_policy_dn('staff'), lo)
174
			group.add_umc_policy(self.get_umc_policy_dn('staff'), lo)
185
175
 Lines 236-255    Link Here 
236
			return flatten([self.get_administrative_group_name(group_type, True, ou_specific, as_dn), self.get_administrative_group_name(group_type, False, ou_specific, as_dn)])
226
			return flatten([self.get_administrative_group_name(group_type, True, ou_specific, as_dn), self.get_administrative_group_name(group_type, False, ou_specific, as_dn)])
237
		if ou_specific == 'both':
227
		if ou_specific == 'both':
238
			return flatten([self.get_administrative_group_name(group_type, domain_controller, False, as_dn), self.get_administrative_group_name(group_type, domain_controller, True, as_dn)])
228
			return flatten([self.get_administrative_group_name(group_type, domain_controller, False, as_dn), self.get_administrative_group_name(group_type, domain_controller, True, as_dn)])
229
		search_base = self.get_search_base(self.name)
230
		base_dn = ucr.get('ldap/base')
239
		if group_type == 'administrative':
231
		if group_type == 'administrative':
240
			name = 'Verwaltungsnetz'
232
			if domain_controller:
233
				if ou_specific:
234
					dn = search_base.administrative_ou_dc_group
235
				else:
236
					dn = search_base.administrative_dc_group
237
			else:
238
				if ou_specific:
239
					dn = search_base.administrative_ou_member_group
240
				else:
241
					dn = search_base.administrative_member_group
241
		else:
242
		else:
242
			name = 'Edukativnetz'
243
			if domain_controller:
243
		if domain_controller:
244
				if ou_specific:
244
			name = 'DC-%s' % name
245
					dn = search_base.educational_ou_dc_group
245
		else:
246
				else:
246
			name = 'Member-%s' % name
247
					dn = search_base.educational_dc_group
247
		if ou_specific:
248
			else:
248
			name = 'OU%s-%s' % (self.name.lower(), name)
249
				if ou_specific:
250
					dn = search_base.educational_ou_member_group
251
				else:
252
					dn = search_base.educational_member_group
249
		if as_dn:
253
		if as_dn:
250
			return 'cn=%s,cn=ucsschool,cn=groups,%s' % (name, ucr.get('ldap/base'))
254
			return dn
251
		else:
255
		else:
252
			return name
256
			return ldap.explode_dn(dn, True)[0]
253
257
254
	def get_administrative_server_names(self, lo):
258
	def get_administrative_server_names(self, lo):
255
		dn = self.get_administrative_group_name('administrative', ou_specific=True, as_dn=True)
259
		dn = self.get_administrative_group_name('administrative', ou_specific=True, as_dn=True)
(-)ucs-school-lib/python/models/share.py (-2 / +2 lines)
 Lines 138-143    Link Here 
138
138
139
	def get_share_path(self):
139
	def get_share_path(self):
140
		if ucr.is_true('ucsschool/import/roleshare', True):
140
		if ucr.is_true('ucsschool/import/roleshare', True):
141
			return '/home/%s/groups/klassen/%s' % (self.school_group.school, self.name)
141
			return '/home/%s/groups/%s/%s' % (self.school_group.school, self.get_search_base(self.school).share_name_class, self.name)
142
		else:
142
		else:
143
			return '/home/groups/klassen/%s' % self.name
143
			return '/home/groups/%s/%s' % (self.get_search_base(self.school).share_name_class, self.name)
(-)ucs-school-lib/python/models/user.py (-4 / +4 lines)
 Lines 445-459    Link Here 
445
		return [self.get_group_dn('Domain Users %s' % school, school) for school in self.schools]
445
		return [self.get_group_dn('Domain Users %s' % school, school) for school in self.schools]
446
446
447
	def get_students_groups(self):
447
	def get_students_groups(self):
448
		prefix = ucr.get('ucsschool/ldap/default/groupprefix/pupils', 'schueler-')
448
		prefix = self.get_search_base(self.school).group_prefix_students
449
		return [self.get_group_dn('%s%s' % (prefix, school), school) for school in self.schools]
449
		return [self.get_group_dn('%s%s' % (prefix, school), school) for school in self.schools]
450
450
451
	def get_teachers_groups(self):
451
	def get_teachers_groups(self):
452
		prefix = ucr.get('ucsschool/ldap/default/groupprefix/teachers', 'lehrer-')
452
		prefix = self.get_search_base(self.school).group_prefix_teachers
453
		return [self.get_group_dn('%s%s' % (prefix, school), school) for school in self.schools]
453
		return [self.get_group_dn('%s%s' % (prefix, school), school) for school in self.schools]
454
454
455
	def get_staff_groups(self):
455
	def get_staff_groups(self):
456
		prefix = ucr.get('ucsschool/ldap/default/groupprefix/staff', 'mitarbeiter-')
456
		prefix = self.get_search_base(self.school).group_prefix_staff
457
		return [self.get_group_dn('%s%s' % (prefix, school), school) for school in self.schools]
457
		return [self.get_group_dn('%s%s' % (prefix, school), school) for school in self.schools]
458
458
459
	def groups_used(self, lo):
459
	def groups_used(self, lo):
 Lines 677-682    Link Here 
677
677
678
	@classmethod
678
	@classmethod
679
	def from_student_dn(cls, lo, school, dn):
679
	def from_student_dn(cls, lo, school, dn):
680
		examUserPrefix = ucr.get('ucsschool/ldap/default/userprefix/exam', 'exam-')
680
		examUserPrefix = cls.get_search_base(school).user_prefix_exam
681
		dn = 'uid=%s%s,%s' % (escape_dn_chars(examUserPrefix), explode_dn(dn, True)[0], cls.get_container(school))
681
		dn = 'uid=%s%s,%s' % (escape_dn_chars(examUserPrefix), explode_dn(dn, True)[0], cls.get_container(school))
682
		return cls.from_dn(dn, school, lo)
682
		return cls.from_dn(dn, school, lo)
(-)ucs-school-lib/python/roleshares.py (-2 / +2 lines)
 Lines 36-42    Link Here 
36
import univention.config_registry
36
import univention.config_registry
37
from ucsschool.lib.roles import role_pupil, role_teacher, role_staff
37
from ucsschool.lib.roles import role_pupil, role_teacher, role_staff
38
from ucsschool.lib.i18n import ucs_school_name_i18n
38
from ucsschool.lib.i18n import ucs_school_name_i18n
39
from ucsschool.lib.models import Group, School
39
from ucsschool.lib.models import Group, School, Share
40
from ucsschool.lib.schoolldap import LDAP_Connection, USER_READ, USER_WRITE, MACHINE_READ
40
from ucsschool.lib.schoolldap import LDAP_Connection, USER_READ, USER_WRITE, MACHINE_READ
41
import univention.admin.uexceptions
41
import univention.admin.uexceptions
42
import univention.admin.uldap as udm_uldap
42
import univention.admin.uldap as udm_uldap
 Lines 147-153    Link Here 
147
		ucr.load()
147
		ucr.load()
148
		
148
		
149
	school_ou = school.name
149
	school_ou = school.name
150
	share_container_dn = school.get_search_base(school.name).shares
150
	share_container_dn = Share.get_container(school.name)
151
151
152
	teacher_groupname = '-'.join((ucs_school_name_i18n(role_teacher), school_ou))
152
	teacher_groupname = '-'.join((ucs_school_name_i18n(role_teacher), school_ou))
153
	teacher_group = Group(name=teacher_groupname, school=school_ou).get_udm_object(ldap_user_read)
153
	teacher_group = Group(name=teacher_groupname, school=school_ou).get_udm_object(ldap_user_read)
(-)ucs-school-lib/python/schoolldap.py (-23 / +139 lines)
 Lines 30-58    Link Here 
30
# /usr/share/common-licenses/AGPL-3; if not, see
30
# /usr/share/common-licenses/AGPL-3; if not, see
31
# <http://www.gnu.org/licenses/>.
31
# <http://www.gnu.org/licenses/>.
32
32
33
import inspect
34
import re
35
from functools import wraps
36
from ldap.filter import escape_filter_chars, filter_format
37
38
import univention.admin.config
39
import univention.admin.modules
40
import univention.admin.modules as udm_modules
33
import univention.config_registry
41
import univention.config_registry
34
import univention.uldap
42
import univention.uldap
35
import univention.admin.config
36
import univention.admin.modules
37
from univention.admin.filter import conjunction, parse
43
from univention.admin.filter import conjunction, parse
38
from univention.admin.uexceptions import noObject
44
from univention.admin.uexceptions import noObject
39
40
import univention.admin.modules as udm_modules
41
from univention.management.console.protocol.message import Message
42
43
from univention.lib.i18n import Translation
45
from univention.lib.i18n import Translation
44
45
from functools import wraps
46
import re
47
import inspect
48
from ldap.filter import escape_filter_chars, filter_format
49
50
from univention.management.console.config import ucr
46
from univention.management.console.config import ucr
47
from univention.management.console.ldap import get_machine_connection, get_admin_connection, get_user_connection#, reset_cache as reset_connection_cache
51
from univention.management.console.log import MODULE
48
from univention.management.console.log import MODULE
52
from univention.management.console.ldap import get_machine_connection, get_admin_connection, get_user_connection#, reset_cache as reset_connection_cache
53
from univention.management.console.modules import Base, UMC_Error
49
from univention.management.console.modules import Base, UMC_Error
54
from univention.management.console.modules.decorators import sanitize
50
from univention.management.console.modules.decorators import sanitize
55
from univention.management.console.modules.sanitizers import StringSanitizer
51
from univention.management.console.modules.sanitizers import StringSanitizer
52
from univention.management.console.protocol.message import Message
56
53
57
# load UDM modules
54
# load UDM modules
58
udm_modules.update()
55
udm_modules.update()
 Lines 161-167    Link Here 
161
		self._school = school or availableSchools[0]
158
		self._school = school or availableSchools[0]
162
		self._schoolDN = dn or School.cache(self.school).dn
159
		self._schoolDN = dn or School.cache(self.school).dn
163
160
164
		# prefixes
161
		#
162
		# When adding/updating UCRV defaults, also add/update them in shell/base.sh.
163
		#
164
165
		#
166
		# When changing any of ucsschool/ldap/default/groupname/all-{administrativ, educational}-{dc, member}
167
		# copy the changes to ucs-school-ldap-acls-master/{61ucsschool_presettings, 65ucsschool}.
168
		#
169
170
		# containers
165
		self._containerAdmins = ucr.get('ucsschool/ldap/default/container/admins', 'admins')
171
		self._containerAdmins = ucr.get('ucsschool/ldap/default/container/admins', 'admins')
166
		self._containerStudents = ucr.get('ucsschool/ldap/default/container/pupils', 'schueler')
172
		self._containerStudents = ucr.get('ucsschool/ldap/default/container/pupils', 'schueler')
167
		self._containerStaff = ucr.get('ucsschool/ldap/default/container/staff', 'mitarbeiter')
173
		self._containerStaff = ucr.get('ucsschool/ldap/default/container/staff', 'mitarbeiter')
 Lines 170-181    Link Here 
170
		self._containerClass = ucr.get('ucsschool/ldap/default/container/class', 'klassen')
176
		self._containerClass = ucr.get('ucsschool/ldap/default/container/class', 'klassen')
171
		self._containerRooms = ucr.get('ucsschool/ldap/default/container/rooms', 'raeume')
177
		self._containerRooms = ucr.get('ucsschool/ldap/default/container/rooms', 'raeume')
172
		self._examUserContainerName = ucr.get('ucsschool/ldap/default/container/exam', 'examusers')
178
		self._examUserContainerName = ucr.get('ucsschool/ldap/default/container/exam', 'examusers')
173
		self._examGroupNameTemplate = ucr.get('ucsschool/ldap/default/groupname/exam', 'OU%(ou)s-Klassenarbeit')
179
		# group names
174
180
		self._examGroupName = ucr.get('ucsschool/ldap/default/groupname/exam',
181
			'OU%(ou)s-Klassenarbeit') % {'ou': self._school.lower()}
182
		self._all_administrativ_dc = ucr.get('ucsschool/ldap/default/groupname/all-administrativ-dc',
183
			'DC-Verwaltungsnetz')
184
		self._all_administrativ_member = ucr.get('ucsschool/ldap/default/groupname/all-administrativ-member',
185
			'Member-Verwaltungsnetz')
186
		self._all_educational_dc = ucr.get('ucsschool/ldap/default/groupname/all-educational-dc',
187
			'DC-Edukativnetz')
188
		self._all_educational_member = ucr.get('ucsschool/ldap/default/groupname/all-educational-member',
189
			'Member-Edukativnetz')
190
		self._ou_administrativ_dc = ucr.get('ucsschool/ldap/default/groupname/ou-administrativ-dc',
191
			'OU%(ou)s-DC-Verwaltungsnetz') % {'ou': self._school.lower()}
192
		self._ou_administrativ_member = ucr.get('ucsschool/ldap/default/groupname/ou-administrativ-member',
193
			'OU%(ou)s-Member-Verwaltungsnetz') % {'ou': self._school.lower()}
194
		self._ou_educational_dc = ucr.get('ucsschool/ldap/default/groupname/ou-educational-dc',
195
			'OU%(ou)s-DC-Edukativnetz') % {'ou': self._school.lower()}
196
		self._ou_educational_member = ucr.get('ucsschool/ldap/default/groupname/ou-educational-member',
197
			'OU%(ou)s-Member-Edukativnetz') % {'ou': self._school.lower()}
198
		# group prefixes
175
		self.group_prefix_students = ucr.get('ucsschool/ldap/default/groupprefix/pupils', 'schueler-')
199
		self.group_prefix_students = ucr.get('ucsschool/ldap/default/groupprefix/pupils', 'schueler-')
176
		self.group_prefix_teachers = ucr.get('ucsschool/ldap/default/groupprefix/teachers', 'lehrer-')
200
		self.group_prefix_teachers = ucr.get('ucsschool/ldap/default/groupprefix/teachers', 'lehrer-')
177
		self.group_prefix_admins = ucr.get('ucsschool/ldap/default/groupprefix/admins', 'admins-')
201
		self.group_prefix_admins = ucr.get('ucsschool/ldap/default/groupprefix/admins', 'admins-')
178
		self.group_prefix_staff = ucr.get('ucsschool/ldap/default/groupprefix/staff', 'mitarbeiter-')
202
		self.group_prefix_staff = ucr.get('ucsschool/ldap/default/groupprefix/staff', 'mitarbeiter-')
203
		# user prefix
204
		self.user_prefix_exam = ucr.get('ucsschool/ldap/default/userprefix/exam', 'exam-')
205
		# share/directory names
206
		self.share_name_class = ucr.get('ucsschool/ldap/default/share/class', 'klassen')
207
		self.share_name_pupils = ucr.get('ucsschool/ldap/default/share/pupils', 'schueler')
208
		self.share_name_teachers = ucr.get('ucsschool/ldap/default/share/teachers', 'lehrer')
209
		self.share_name_exams = ucr.get('ucsschool/ldap/default/share/exams', 'Klassenarbeiten')
210
		self.share_name_marktplatz = ucr.get('ucsschool/import/generate/share/marktplatz/name', 'Marktplatz')
179
211
180
	@classmethod
212
	@classmethod
181
	def getOU(cls, dn):
213
	def getOU(cls, dn):
 Lines 244-268    Link Here 
244
276
245
	@property
277
	@property
246
	def students(self):
278
	def students(self):
279
		"""cn=schueler,cn=users,<ou dn>"""
247
		return "cn=%s,cn=users,%s" % (self._containerStudents, self.schoolDN)
280
		return "cn=%s,cn=users,%s" % (self._containerStudents, self.schoolDN)
248
281
249
	@property
282
	@property
283
	def students_group(self):
284
		"""cn=schueler,cn=groups,<ou dn>"""
285
		return "cn=%s,cn=groups,%s" % (self._containerStudents, self.schoolDN)
286
287
	@property
288
	def students_ou_group(self):
289
		"""cn=schueler-%(ou)s,cn=groups,<ou dn> (ou already replaced)"""
290
		return "cn=%s%s,cn=groups,%s" % (self.group_prefix_students, self.school, self.schoolDN)
291
292
	@property
250
	def teachers(self):
293
	def teachers(self):
294
		"""cn=lehrer,cn=users,<ou dn>"""
251
		return "cn=%s,cn=users,%s" % (self._containerTeachers, self.schoolDN)
295
		return "cn=%s,cn=users,%s" % (self._containerTeachers, self.schoolDN)
252
296
253
	@property
297
	@property
298
	def teachers_group(self):
299
		"""cn=lehrer,cn=groups,<ou dn>"""
300
		return "cn=%s,cn=groups,%s" % (self._containerTeachers, self.schoolDN)
301
302
	@property
303
	def teachers_ou_group(self):
304
		"""cn=lehrer-%(ou)s,cn=groups,<ou dn> (ou already replaced)"""
305
		return "cn=%s%s,cn=groups,%s" % (self.group_prefix_teachers, self.school, self.schoolDN)
306
307
	@property
254
	def teachersAndStaff(self):
308
	def teachersAndStaff(self):
309
		"""cn=lehrer und mitarbeiter,cn=users,<ou dn>"""
255
		return "cn=%s,cn=users,%s" % (self._containerTeachersAndStaff, self.schoolDN)
310
		return "cn=%s,cn=users,%s" % (self._containerTeachersAndStaff, self.schoolDN)
256
311
257
	@property
312
	@property
258
	def staff(self):
313
	def staff(self):
314
		"""cn=mitarbeiter,cn=users,<ou dn>"""
259
		return "cn=%s,cn=users,%s" % (self._containerStaff, self.schoolDN)
315
		return "cn=%s,cn=users,%s" % (self._containerStaff, self.schoolDN)
260
316
261
	@property
317
	@property
318
	def staff_group(self):
319
		"""cn=mitarbeiter,cn=groups,<ou dn>"""
320
		return "cn=%s,cn=groups,%s" % (self._containerStaff, self.schoolDN)
321
322
	@property
323
	def staff_ou_group(self):
324
		"""cn=mitarbeiter-%(ou)s,cn=groups,<ou dn> (ou already replaced)"""
325
		return "cn=%s%s,cn=groups,%s" % (self.group_prefix_staff, self.school, self.schoolDN)
326
327
	@property
262
	def admins(self):
328
	def admins(self):
329
		"""cn=admins,cn=users,<ou dn>"""
263
		return "cn=%s,cn=users,%s" % (self._containerAdmins, self.schoolDN)
330
		return "cn=%s,cn=users,%s" % (self._containerAdmins, self.schoolDN)
264
331
265
	@property
332
	@property
333
	def admin_group(self):
334
		"""cn=admins-%(ou)s,cn=ouadmins,cn=groups,<ou dn> (ou already replaced)"""
335
		return "cn=%s%s,cn=ouadmins,cn=groups,%s" % (self.group_prefix_admins, self.school, self.schoolDN)
336
337
	@property
266
	def classShares(self):
338
	def classShares(self):
267
		return "cn=%s,cn=shares,%s" % (self._containerClass, self.schoolDN)
339
		return "cn=%s,cn=shares,%s" % (self._containerClass, self.schoolDN)
268
340
 Lines 288-315    Link Here 
288
360
289
	@property
361
	@property
290
	def educationalDCGroup(self):
362
	def educationalDCGroup(self):
291
		return "cn=OU%s-DC-Edukativnetz,cn=ucsschool,cn=groups,%s" % (self.school, self._ldapBase)
363
		"""deprecated, please use educational_ou_dc_group"""
364
		return self.educational_ou_dc_group
292
365
293
	@property
366
	@property
294
	def educationalMemberGroup(self):
367
	def educationalMemberGroup(self):
295
		return "cn=OU%s-Member-Edukativnetz,cn=ucsschool,cn=groups,%s" % (self.school, self._ldapBase)
368
		"""deprecated, please use educational_ou_member_group"""
369
		return self.educational_ou_member_group
296
370
297
	@property
371
	@property
298
	def administrativeDCGroup(self):
372
	def administrativeDCGroup(self):
299
		return "cn=OU%s-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s" % (self.school, self._ldapBase)
373
		"""deprecated, please use administrative_ou_dc_group"""
374
		return self.administrative_ou_dc_group
300
375
301
	@property
376
	@property
302
	def administrativeMemberGroup(self):
377
	def administrativeMemberGroup(self):
303
		return "cn=OU%s-Member-Verwaltungsnetz,cn=ucsschool,cn=groups,%s" % (self.school, self._ldapBase)
378
		"""deprecated, please use administrative_ou_member_group"""
379
		return self.administrative_ou_member_group
304
380
305
	@property
381
	@property
382
	def administrative_dc_group(self):
383
		"""cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,<ldap base>"""
384
		return "cn=%s,cn=ucsschool,cn=groups,%s" % (self._all_administrativ_dc, self._ldapBase)
385
386
	@property
387
	def administrative_member_group(self):
388
		"""cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,<ldap base>"""
389
		return "cn=%s,cn=ucsschool,cn=groups,%s" % (self._all_administrativ_member, self._ldapBase)
390
391
	@property
392
	def educational_dc_group(self):
393
		"""cn=DC-Edukativnetz,cn=ucsschool,cn=groups,<ldap base>"""
394
		return "cn=%s,cn=ucsschool,cn=groups,%s" % (self._all_educational_dc, self._ldapBase)
395
396
	@property
397
	def educational_member_group(self):
398
		"""cn=Member-Edukativnetz,cn=ucsschool,cn=groups,<ldap base>"""
399
		return "cn=%s,cn=ucsschool,cn=groups,%s" % (self._all_educational_member, self._ldapBase)
400
401
	@property
402
	def educational_ou_dc_group(self):
403
		"""cn=OU%(ou)s-DC-Edukativnetz,cn=ucsschool,cn=groups,<ldap base> (ou already replaced)"""
404
		return "cn=%s,cn=ucsschool,cn=groups,%s" % (self._ou_educational_dc, self._ldapBase)
405
406
	@property
407
	def educational_ou_member_group(self):
408
		"""cn=OU%(ou)s-Member-Edukativnetz,cn=ucsschool,cn=groups,<ldap base> (ou already replaced)"""
409
		return "cn=%s,cn=ucsschool,cn=groups,%s" % (self._ou_educational_member, self._ldapBase)
410
411
	@property
412
	def administrative_ou_dc_group(self):
413
		"""cn=OU%(ou)s-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,<ldap base> (ou already replaced)"""
414
		return "cn=%s,cn=ucsschool,cn=groups,%s" % (self._ou_administrativ_dc, self._ldapBase)
415
416
	@property
417
	def administrative_ou_member_group(self):
418
		"""cn=OU%(ou)s-Member-Verwaltungsnetz,cn=ucsschool,cn=groups,<ldap base> (ou already replaced)"""
419
		return "cn=%s,cn=ucsschool,cn=groups,%s" % (self._ou_administrativ_member, self._ldapBase)
420
421
	@property
306
	def examGroupName(self):
422
	def examGroupName(self):
307
		## replace '%(ou)s' strings in generic exam_group_name
423
		"""OU%(ou)s-Klassenarbeit (only name, not a DN, ou already replaced)"""
308
		ucr_value_keywords = { 'ou': self.school }
424
		return self._examGroupName
309
		return self._examGroupNameTemplate % ucr_value_keywords
310
425
311
	@property
426
	@property
312
	def examGroup(self):
427
	def examGroup(self):
428
		"""cn=OU%(ou)s-Klassenarbeit,cn=ucsschool,cn=groups,<ldap base> (ou already replaced)"""
313
		return "cn=%s,cn=ucsschool,cn=groups,%s" % (self.examGroupName, self._ldapBase)
429
		return "cn=%s,cn=ucsschool,cn=groups,%s" % (self.examGroupName, self._ldapBase)
314
430
315
	def isWorkgroup(self, groupDN):
431
	def isWorkgroup(self, groupDN):
(-)ucs-school-lib/shell/base.sh (-5 / +93 lines)
 Lines 110-116    Link Here 
110
	#
110
	#
111
	# $ servers_school_ous -h $(ucr get ldap/master) -p $(ucr get ldap/master/port)
111
	# $ servers_school_ous -h $(ucr get ldap/master) -p $(ucr get ldap/master/port)
112
	# ou=bar,dc=example,dc=com
112
	# ou=bar,dc=example,dc=com
113
	local ldap_hostdn ldap_base ldap_server ldap_port IFS
113
	local ldap_hostdn ldap_base ldap_server ldap_port IFS res
114
	. /usr/share/univention-lib/ucr.sh
114
	. /usr/share/univention-lib/ucr.sh
115
115
116
	ldap_base="$(/usr/sbin/univention-config-registry get ldap/base)"
116
	ldap_base="$(/usr/sbin/univention-config-registry get ldap/base)"
 Lines 140-149    Link Here 
140
	res=""
140
	res=""
141
	for oudn in $(univention-ldapsearch $ldap_server $ldap_port -xLLL -b "$ldap_base" 'objectClass=ucsschoolOrganizationalUnit' dn | ldapsearch-wrapper | sed -nre 's/^dn: //p') ; do
141
	for oudn in $(univention-ldapsearch $ldap_server $ldap_port -xLLL -b "$ldap_base" 'objectClass=ucsschoolOrganizationalUnit' dn | ldapsearch-wrapper | sed -nre 's/^dn: //p') ; do
142
		ouname="$(school_ou "$oudn")"
142
		ouname="$(school_ou "$oudn")"
143
		if is_ucr_true ucsschool/singlemaster; then
143
		search_str="(|(cn=$(ucr_names_default ucsschool/ldap/default/groupname/ou-educational-dc ${ouname}))(cn=$(ucr_names_default ucsschool/ldap/default/groupname/ou-administrativ-dc OU${ouname})))"
144
			search_str="(|(cn=OU${ouname}-DC-Edukativnetz)(cn=OU${ouname}-DC-Verwaltungsnetz))"
144
		if ! is_ucr_true ucsschool/singlemaster; then
145
		else
145
			search_str="(&${search_str}(uniqueMember=${ldap_hostdn}))"
146
			search_str="(&(|(cn=OU${ouname}-DC-Edukativnetz)(cn=OU${ouname}-DC-Verwaltungsnetz))(uniqueMember=${ldap_hostdn}))"
147
		fi
146
		fi
148
		if univention-ldapsearch $ldap_server $ldap_port -xLLL "$search_str" dn | grep -q "^dn: "; then
147
		if univention-ldapsearch $ldap_server $ldap_port -xLLL "$search_str" dn | grep -q "^dn: "; then
149
			res="$res
148
			res="$res
 Lines 152-154    Link Here 
152
	done
151
	done
153
	echo -n "${res}" | egrep -v "^\s*$"
152
	echo -n "${res}" | egrep -v "^\s*$"
154
}
153
}
154
155
replace_ou() {
156
	# syntax: replace_ou <template> <ou>
157
	#
158
	# Replace '%(ou)s' in <template> with <ou>
159
	#
160
	# example:
161
	# $ replace_ou "OU%(ou)s-DC-Edukativnetz" "myschool"
162
	# "OUmyschool-DC-Edukativnetz
163
	if [ "$#" != 2 ]; then
164
		echo "syntax: replace_ou <template> <ou>"
165
		return 1
166
	fi
167
	echo -n "$1" | sed "s/%(ou)s/$2/"
168
}
169
170
ucr_names_default() {
171
	# syntax: ucr_names_default <ucr> [ou]
172
	#
173
	# Get UCR value or default, optionally replace '%(ou)s'.
174
	#
175
	# example:
176
	# $ ucr_names_default "ucsschool/ldap/default/container/pupils"
177
	# "schueler
178
	# $ ucr_names_default "ucsschool/ldap/default/groupname/ou-administrativ-dc" "myschool"
179
	# "OUmyschool-DC-Verwaltungsnetz"
180
	local res
181
182
	if [ "$#" -lt 1 -o "$#" -gt 2 ]; then
183
		echo "syntax: ucr_names_default <ucr> [ou]"
184
		return 1
185
	fi
186
	if [ $(echo -n "$1" | cut -f 1-3 -d '/') != 'ucsschool/ldap/default' ]; then
187
		echo "<ucr> must be a UCR variable from ucsschool/ldap/default/*/*"
188
		return 1
189
	fi
190
191
	#
192
	# When adding/updating UCRV defaults, also add/update them in python/schoolldap.py.
193
	#
194
195
	res="$(ucr get $1)"
196
	if [ -z "$res" ]; then
197
		case "$1" in
198
			# containers
199
			'ucsschool/ldap/default/container/admins') res='admins';;
200
			'ucsschool/ldap/default/container/pupils') res='schueler';;
201
			'ucsschool/ldap/default/container/staff') res='mitarbeiter';;
202
			'ucsschool/ldap/default/container/teachers-and-staff') res='lehrer und mitarbeiter';;
203
			'ucsschool/ldap/default/container/teachers') res='lehrer';;
204
			'ucsschool/ldap/default/container/class') res='klassen';;
205
			'ucsschool/ldap/default/container/rooms') res='raeume';;
206
			'ucsschool/ldap/default/container/exam') res='examusers';;
207
			# group names
208
			'ucsschool/ldap/default/groupname/exam') res='OU%(ou)%s-Klassenarbeit';;
209
			'ucsschool/ldap/default/groupname/all-administrativ-dc') res='DC-Verwaltungsnetz';;
210
			'ucsschool/ldap/default/groupname/all-administrativ-member') res='Member-Verwaltungsnetz';;
211
			'ucsschool/ldap/default/groupname/all-educational-dc') res='DC-Edukativnetz';;
212
			'ucsschool/ldap/default/groupname/all-educational-member') res='Member-Edukativnetz';;
213
			'ucsschool/ldap/default/groupname/ou-administrativ-dc') res='OU%(ou)s-DC-Verwaltungsnetz';;
214
			'ucsschool/ldap/default/groupname/ou-administrativ-member') res='OU%(ou)s-Member-Verwaltungsnetz';;
215
			'ucsschool/ldap/default/groupname/ou-educational-dc') res='OU%(ou)s-DC-Edukativnetz';;
216
			'ucsschool/ldap/default/groupname/ou-educational-member') res='OU%(ou)s-Member-Edukativnetz';;
217
			# group prefixes
218
			'ucsschool/ldap/default/groupprefix/pupils') res='schueler-';;
219
			'ucsschool/ldap/default/groupprefix/teachers') res='lehrer-';;
220
			'ucsschool/ldap/default/groupprefix/admins') res='admins-';;
221
			'ucsschool/ldap/default/groupprefix/staff') res='mitarbeiter-';;
222
			# user prefix
223
			'ucsschool/ldap/default/userprefix/exam') res='exam-';;
224
			# share/directory names
225
			'ucsschool/ldap/default/share/class') res='klassen';;
226
			'ucsschool/ldap/default/share/pupils') res='schueler';;
227
			'ucsschool/ldap/default/share/teachers') res='lehrer';;
228
			'ucsschool/ldap/default/share/exams') res='Klassenarbeiten';;
229
			'ucsschool/import/generate/share/marktplatz/name') res='Marktplatz';;
230
		esac
231
	fi
232
	if [ -z "$res" ]; then
233
		echo "Error: Unknown UCR $1."
234
		return 1
235
	fi
236
237
	if [ -z "$2" ]; then
238
		echo -n "$res"
239
	else
240
		replace_ou "$res" "$2"
241
	fi
242
}
(-)ucs-school-netlogon-user-logonscripts/99ucs-school-netlogon-user-logonscripts.inst (-3 / +6 lines)
 Lines 32-40    Link Here 
32
VERSION="1"
32
VERSION="1"
33
33
34
. /usr/share/univention-join/joinscripthelper.lib
34
. /usr/share/univention-join/joinscripthelper.lib
35
. /usr/share/ucs-school-lib/base.sh
36
35
joinscript_init
37
joinscript_init
36
38
37
eval "$(univention-config-registry shell)"
39
eval "$(univention-config-registry shell)"
40
share_name="$(ucr_names_default ucsschool/import/generate/share/marktplatz/name)"
38
41
39
# samba 4 netlogon share
42
# samba 4 netlogon share
40
myrealm=$(echo $kerberos_realm |  awk '{print tolower($0)}')
43
myrealm=$(echo $kerberos_realm |  awk '{print tolower($0)}')
 Lines 43-51    Link Here 
43
fi
46
fi
44
47
45
univention-config-registry set \
48
univention-config-registry set \
46
    ucsschool/userlogon/commonshares?"Marktplatz" \
49
    ucsschool/userlogon/commonshares?"$share_name" \
47
    ucsschool/userlogon/commonshares/server/Marktplatz?"$hostname" \
50
    "ucsschool/userlogon/commonshares/server/$share_name?$hostname" \
48
    ucsschool/userlogon/commonshares/letter/Marktplatz?"M" \
51
    "ucsschool/userlogon/commonshares/letter/$share_name?M" \
49
    ucsschool/userlogon/classshareletter?"K" \
52
    ucsschool/userlogon/classshareletter?"K" \
50
    ucsschool/netlogon/ucs-school-netlogon-user-logonscripts/script?'user\%USERNAME%.vbs'
53
    ucsschool/netlogon/ucs-school-netlogon-user-logonscripts/script?'user\%USERNAME%.vbs'
51
54
(-)ucs-school-netlogon-user-logonscripts/debian/control (+1 lines)
 Lines 13-18    Link Here 
13
 univention-directory-listener,
13
 univention-directory-listener,
14
 ucs-school-netlogon,
14
 ucs-school-netlogon,
15
 shell-univention-lib,
15
 shell-univention-lib,
16
 shell-ucs-school,
16
 univention-config
17
 univention-config
17
Description: ucs@school userspecific netlogon scripts
18
Description: ucs@school userspecific netlogon scripts
18
 This package provides a listener-module that creates
19
 This package provides a listener-module that creates
(-)ucs-school-netlogon-user-logonscripts/debian/ucs-school-netlogon-user-logonscripts.postinst (-3 / +5 lines)
 Lines 33-46    Link Here 
33
#DEBHELPER#
33
#DEBHELPER#
34
34
35
. /usr/share/univention-lib/all.sh
35
. /usr/share/univention-lib/all.sh
36
. /usr/share/ucs-school-lib/base.sh
36
37
37
eval "$(ucr shell)"
38
eval "$(ucr shell)"
39
share_name="$(ucr_names_default ucsschool/import/generate/share/marktplatz/name)"
38
40
39
univention-config-registry set \
41
univention-config-registry set \
40
	samba/homedirletter?I \
42
	samba/homedirletter?I \
41
    ucsschool/userlogon/commonshares?"Marktplatz" \
43
    ucsschool/userlogon/commonshares?"$share_name" \
42
    ucsschool/userlogon/commonshares/server/Marktplatz?"$hostname" \
44
    "ucsschool/userlogon/commonshares/server/$share_name?$hostname" \
43
    ucsschool/userlogon/commonshares/letter/Marktplatz?"M" \
45
    "ucsschool/userlogon/commonshares/letter/$share_name?M" \
44
    ucsschool/userlogon/classshareletter?"K" \
46
    ucsschool/userlogon/classshareletter?"K" \
45
    ucsschool/netlogon/ucs-school-netlogon-user-logonscripts/script?'user\%USERNAME%.vbs' \
47
    ucsschool/netlogon/ucs-school-netlogon-user-logonscripts/script?'user\%USERNAME%.vbs' \
46
	ucsschool/userlogon/myshares/enabled?no
48
	ucsschool/userlogon/myshares/enabled?no
(-)ucs-school-umc-computerroom/umc/python/computerroom/__init__.py (-1 / +1 lines)
 Lines 727-733    Link Here 
727
			vset[vunset[-1]] = shareMode
727
			vset[vunset[-1]] = shareMode
728
			vextract.append('samba/othershares/hosts/deny')
728
			vextract.append('samba/othershares/hosts/deny')
729
			vappend[vextract[-1]] = hosts
729
			vappend[vextract[-1]] = hosts
730
			vextract.append('samba/share/Marktplatz/hosts/deny')
730
			vextract.append('samba/share/{}/hosts/deny'.format(School.get_search_base(self._italc.school).share_name_marktplatz))
731
			vappend[vextract[-1]] = hosts
731
			vappend[vextract[-1]] = hosts
732
		else:
732
		else:
733
			vunset_now.append('samba/sharemode/room/%s' % self._italc.room)
733
			vunset_now.append('samba/sharemode/room/%s' % self._italc.room)
(-)ucs-school-umc-csv-import/umc/python/schoolcsvimport/util.py (-1 / +1 lines)
 Lines 117-123    Link Here 
117
			firstname = firstname[:5] + '.'
117
			firstname = firstname[:5] + '.'
118
118
119
		username = firstname + lastname[:5]
119
		username = firstname + lastname[:5]
120
		maxlength = 20 - len(ucr.get('ucsschool/ldap/default/userprefix/exam', 'exam-'))
120
		maxlength = 20 - len(self.get_search_base(self.school).user_prefix_exam)
121
		return replace_invalid_chars(username[:maxlength])
121
		return replace_invalid_chars(username[:maxlength])
122
122
123
	@classmethod
123
	@classmethod
(-)ucs-school-umc-distribution/debian/ucs-school-umc-distribution.univention-config-registry-variables (+11 lines)
Line 0    Link Here 
1
[ucsschool/datadistribution/datadir/recipient]
2
Description[de]=Standardname für das Projektverzeichnis in das Unterrichtsmaterial verteilt wird. Standard ist "Unterrichtsmaterial".
3
Description[en]=Default name for the project directory into which teaching material will be distributed. Default is "Unterrichtsmaterial".
4
Type=str
5
Categories=ucsschool-base
6
7
[ucsschool/datadistribution/datadir/sender]
8
Description[de]=Standardname für das Projektverzeichnis aus dem Unterrichtsmaterial eingesammelt wird. Standard ist "Unterrichtsmaterial".
9
Description[en]=Default name for the project directory from which teaching material will be collected. Default is "Unterrichtsmaterial".
10
Type=str
11
Categories=ucsschool-base
(-)ucs-school-umc-distribution/umc/python/distribution/util.py (-1 / +1 lines)
 Lines 291-297    Link Here 
291
	@property
291
	@property
292
	def isDistributed(self):
292
	def isDistributed(self):
293
		'''True if files have already been distributed.'''
293
		'''True if files have already been distributed.'''
294
		# distributed files can still be found in the internal property 'files',
294
		# distributed files can still be found in the internal property 'files',Unterrichtsmaterial
295
		# however, upon distribution they are removed from the cache directory;
295
		# however, upon distribution they are removed from the cache directory;
296
		# thus, if one of the specified files does not exist, the project has
296
		# thus, if one of the specified files does not exist, the project has
297
		# already been distributed
297
		# already been distributed
(-)ucs-school-umc-exam/debian/control (+1 lines)
 Lines 31-36    Link Here 
31
 python-ucs-school,
31
 python-ucs-school,
32
 ucs-school-import,
32
 ucs-school-import,
33
 shell-univention-lib,
33
 shell-univention-lib,
34
 shell-ucs-school,
34
 univention-ldap-config (>= 9.0.27-3),
35
 univention-ldap-config (>= 9.0.27-3),
35
Description: UMC module delivering backend services for ucs-school-umc-exam
36
Description: UMC module delivering backend services for ucs-school-umc-exam
36
 UMC module delivering backend services for ucs-school-umc-exam
37
 UMC module delivering backend services for ucs-school-umc-exam
(-)ucs-school-umc-exam/hooks/ou_create_post.d/60schoolexam-master (-9 / +3 lines)
 Lines 35-40    Link Here 
35
[ $# -ne 2 ] && echo "USAGE: $(basename $0) FILE DN" && exit 1
35
[ $# -ne 2 ] && echo "USAGE: $(basename $0) FILE DN" && exit 1
36
36
37
. /usr/share/univention-lib/ucr.sh
37
. /usr/share/univention-lib/ucr.sh
38
. /usr/share/ucs-school-lib/base.sh
38
39
39
eval "$(ucr shell)"
40
eval "$(ucr shell)"
40
41
 Lines 43-62    Link Here 
43
	district=",ou=${ou:0:2}"
44
	district=",ou=${ou:0:2}"
44
fi
45
fi
45
46
46
examusers="$ucsschool_ldap_default_container_exam"
47
examusers="$(ucr_names_default ucsschool/ldap/default/container/exam)"
47
if [ -z "$examusers" ] ; then
48
	examusers='examusers'
49
fi
50
48
51
udm container/cn create --ignore_exists \
49
udm container/cn create --ignore_exists \
52
	--position "ou=${ou}${district},${ldap_base}" \
50
	--position "ou=${ou}${district},${ldap_base}" \
53
	--set name="${examusers}" \
51
	--set name="${examusers}" \
54
52
55
examgroupname="$ucsschool_ldap_default_groupname_exam"
53
ou_specific_examgroupname="$(ucr_names_default ucsschool/ldap/default/groupname/exam)"
56
if [ -z "$examgroupname" ] ; then
57
	examgroupname='OU%(ou)s-Klassenarbeit'
58
fi
59
ou_specific_examgroupname=$(python -c "print '$examgroupname' % {'ou': '$ou'}")
60
54
61
udm groups/group create --ignore_exists \
55
udm groups/group create --ignore_exists \
62
	--position "cn=ucsschool,cn=groups,${ldap_base}" \
56
	--position "cn=ucsschool,cn=groups,${ldap_base}" \
(-)ucs-school-umc-exam/share/exam-and-room-cleanup (-4 / +3 lines)
 Lines 39-45    Link Here 
39
import univention.config_registry
39
import univention.config_registry
40
import univention.uldap
40
import univention.uldap
41
import univention.admin.uldap
41
import univention.admin.uldap
42
from ucsschool.lib.schoolldap import SchoolSearchBase
42
from ucsschool.lib.models import ExamStudent
43
from univention.lib.umc_connection import UMCConnection
43
from univention.lib.umc_connection import UMCConnection
44
from univention.admin.uexceptions import noObject
44
from univention.admin.uexceptions import noObject
45
from ldap.filter import escape_filter_chars
45
from ldap.filter import escape_filter_chars
 Lines 58-64    Link Here 
58
		self.hostname = self.ucr.get('hostname')
58
		self.hostname = self.ucr.get('hostname')
59
		self.umcp = self.get_UMCP_connection()
59
		self.umcp = self.get_UMCP_connection()
60
		self.lo = self.get_LDAP_connection()
60
		self.lo = self.get_LDAP_connection()
61
		self.exam_prefix = self.ucr.get('ucsschool/ldap/default/userprefix/exam', 'exam-')
62
		self.DIR_ROOMS = '/var/cache/ucs-school-umc-computerroom'
61
		self.DIR_ROOMS = '/var/cache/ucs-school-umc-computerroom'
63
		self.DIR_EXAMS = self.ucr.get('ucsschool/exam/cache', '/var/lib/ucs-school-umc-schoolexam')
62
		self.DIR_EXAMS = self.ucr.get('ucsschool/exam/cache', '/var/lib/ucs-school-umc-schoolexam')
64
63
 Lines 142-150    Link Here 
142
			ou_list = self.lo.search(filter='(objectClass=ucsschoolOrganizationalUnit)')
141
			ou_list = self.lo.search(filter='(objectClass=ucsschoolOrganizationalUnit)')
143
			for ou_dn, ou_attrs in ou_list:
142
			for ou_dn, ou_attrs in ou_list:
144
				ou_name = ou_attrs['ou'][0]
143
				ou_name = ou_attrs['ou'][0]
145
				searchbase = SchoolSearchBase([ou_name], dn=ou_dn)
144
				exam_prefix = ExamStudent.get_search_base(ou_name).user_prefix_exam
146
				try:
145
				try:
147
					userlist = mod_user.lookup({}, lo, 'uid=%s*' % (escape_filter_chars(self.exam_prefix),), base=searchbase.examUsers)
146
					userlist = mod_user.lookup({}, lo, 'uid=%s*' % (escape_filter_chars(exam_prefix),), base=ExamStudent.get_container(ou_name))
148
				except noObject:
147
				except noObject:
149
					# no exam users container in this OU
148
					# no exam users container in this OU
150
					continue
149
					continue
(-)ucs-school-umc-exam/umc/python/schoolexam-master/__init__.py (-6 / +5 lines)
 Lines 38-43    Link Here 
38
import traceback
38
import traceback
39
import re
39
import re
40
from ldap.filter import filter_format
40
from ldap.filter import filter_format
41
from ldap import explode_dn
41
42
42
from univention.management.console.config import ucr
43
from univention.management.console.config import ucr
43
from univention.management.console.log import MODULE
44
from univention.management.console.log import MODULE
 Lines 60-67    Link Here 
60
	def __init__(self):
61
	def __init__(self):
61
		SchoolBaseModule.__init__(self)
62
		SchoolBaseModule.__init__(self)
62
63
63
		self._examUserPrefix = ucr.get('ucsschool/ldap/default/userprefix/exam', 'exam-')
64
65
		## cache objects
64
		## cache objects
66
		self._udm_modules = dict()
65
		self._udm_modules = dict()
67
		self._examGroup = None
66
		self._examGroup = None
 Lines 103-111    Link Here 
103
	def examUserContainerDN(self, ldap_admin_write, ldap_position, school):
102
	def examUserContainerDN(self, ldap_admin_write, ldap_position, school):
104
		'''lookup examUserContainerDN, create it if missing'''
103
		'''lookup examUserContainerDN, create it if missing'''
105
		if not self._examUserContainerDN:
104
		if not self._examUserContainerDN:
106
			search_base = School.get_search_base(school)
105
			examUsers = ExamStudent.get_container(school)
107
			examUsers = search_base.examUsers
106
			examUserContainerName = explode_dn(ExamStudent.get_search_base(school).examUsers, True)[0]
108
			examUserContainerName = search_base._examUserContainerName
109
			try:
107
			try:
110
				ldap_admin_write.searchDn('(objectClass=organizationalRole)', examUsers, scope='base')
108
				ldap_admin_write.searchDn('(objectClass=organizationalRole)', examUsers, scope='base')
111
			except univention.admin.uexceptions.noObject:
109
			except univention.admin.uexceptions.noObject:
 Lines 149-155    Link Here 
149
		user_orig = user.get_udm_object(ldap_admin_write)
147
		user_orig = user.get_udm_object(ldap_admin_write)
150
148
151
		### uid and DN of exam_user
149
		### uid and DN of exam_user
152
		exam_user_uid = "".join((self._examUserPrefix, user_orig['username']))
150
		exam_user_prefix = ExamStudent.get_search_base(school).user_prefix_exam
151
		exam_user_uid = "".join((exam_user_prefix, user_orig['username']))
153
		exam_user_dn = "uid=%s,%s" % (exam_user_uid, self.examUserContainerDN(ldap_admin_write, ldap_position, user.school))
152
		exam_user_dn = "uid=%s,%s" % (exam_user_uid, self.examUserContainerDN(ldap_admin_write, ldap_position, user.school))
154
153
155
		try:
154
		try:
(-)ucs-school-umc-installer/umc/python/schoolinstaller/__init__.py (-2 / +2 lines)
 Lines 572-580    Link Here 
572
				for islave in slaves:
572
				for islave in slaves:
573
					islave.open()
573
					islave.open()
574
					# compare group DNs case insensitive
574
					# compare group DNs case insensitive
575
					if search_base.educationalDCGroup.lower() in [x.lower() for x in islave['groups']]:
575
					if search_base.educational_ou_dc_group.lower() in [x.lower() for x in islave['groups']]:
576
						values['educational_slaves'].append(islave['name'])
576
						values['educational_slaves'].append(islave['name'])
577
					if search_base.administrativeDCGroup.lower() in [x.lower() for x in islave['groups']]:
577
					if search_base.administrative_ou_dc_group.lower() in [x.lower() for x in islave['groups']]:
578
						values['administrative_slaves'].append(islave['name'])
578
						values['administrative_slaves'].append(islave['name'])
579
		except univention.uldap.ldap.LDAPError as err:
579
		except univention.uldap.ldap.LDAPError as err:
580
			MODULE.warn('LDAP connection to %s failed: %s' % (master, err))
580
			MODULE.warn('LDAP connection to %s failed: %s' % (master, err))
(-)ucs-test-ucsschool/90_ucsschool/07_printermoderation_check (-6 / +4 lines)
 Lines 21-26    Link Here 
21
import univention.testing.udm
21
import univention.testing.udm
22
import univention.testing.utils as utils
22
import univention.testing.utils as utils
23
from univention.testing.ucsschool import UMCConnection
23
from univention.testing.ucsschool import UMCConnection
24
from ucsschool.lib.models import SchoolClass
24
25
25
26
26
def _dir(userName):
27
def _dir(userName):
 Lines 107-116    Link Here 
107
		pattern,
108
		pattern,
108
		basedn):
109
		basedn):
109
	if cName != 'None':
110
	if cName != 'None':
110
		cdn = 'cn=%s,cn=klassen,cn=schueler,cn=groups,ou=%s,%s' % (
111
		cdn = SchoolClass(school=school, name=cName).dn
111
			cName,
112
			school,
113
			basedn)
114
	else:
112
	else:
115
		cdn = cName
113
		cdn = cName
116
	param = {'school': school,
114
	param = {'school': school,
 Lines 197-208    Link Here 
197
				klasse1_dn = udm.create_object(
195
				klasse1_dn = udm.create_object(
198
					'groups/group',
196
					'groups/group',
199
					name='%s-1A' % school,
197
					name='%s-1A' % school,
200
					position="cn=klassen,cn=schueler,cn=groups,%s" % oudn
198
					position=SchoolClass.get_container(oudn)
201
				)
199
				)
202
				klasse2_dn = udm.create_object(
200
				klasse2_dn = udm.create_object(
203
					'groups/group',
201
					'groups/group',
204
					name='%s-2B' % school,
202
					name='%s-2B' % school,
205
					position="cn=klassen,cn=schueler,cn=groups,%s" % oudn
203
					position=SchoolClass.get_container(school)
206
				)
204
				)
207
				tea, teadn = schoolenv.create_user(school, is_teacher=True)
205
				tea, teadn = schoolenv.create_user(school, is_teacher=True)
208
				stu1, stu1_dn = schoolenv.create_user(school)
206
				stu1, stu1_dn = schoolenv.create_user(school)
(-)ucs-test-ucsschool/90_ucsschool/101_exam_mode (-1 / +2 lines)
 Lines 13-18    Link Here 
13
import univention.testing.ucr as ucr_test
13
import univention.testing.ucr as ucr_test
14
import univention.testing.ucsschool as utu
14
import univention.testing.ucsschool as utu
15
import univention.testing.udm
15
import univention.testing.udm
16
from ucsschool.lib.models import SchoolClass
16
17
17
def main():
18
def main():
18
	with univention.testing.udm.UCSTestUDM() as udm:
19
	with univention.testing.udm.UCSTestUDM() as udm:
 Lines 27-33    Link Here 
27
				else:
28
				else:
28
					edudc = ucr.get('hostname')
29
					edudc = ucr.get('hostname')
29
				school, oudn = schoolenv.create_ou(name_edudc=edudc)
30
				school, oudn = schoolenv.create_ou(name_edudc=edudc)
30
				klasse_dn = udm.create_object('groups/group',name='%s-AA1' % school, position="cn=klassen,cn=schueler,cn=groups,%s" % oudn)
31
				klasse_dn = udm.create_object('groups/group',name='%s-AA1' % school, position=SchoolClass.get_container(school))
31
32
32
				tea, teadn = schoolenv.create_user(school, is_teacher=True)
33
				tea, teadn = schoolenv.create_user(school, is_teacher=True)
33
				stu, studn = schoolenv.create_user(school)
34
				stu, studn = schoolenv.create_user(school)
(-)ucs-test-ucsschool/90_ucsschool/101_exam_mode_group_members (-3 / +5 lines)
 Lines 15-21    Link Here 
15
import univention.testing.ucsschool as utu
15
import univention.testing.ucsschool as utu
16
import univention.testing.udm
16
import univention.testing.udm
17
import univention.testing.utils as utils
17
import univention.testing.utils as utils
18
from ucsschool.lib.models import ExamStudent, SchoolClass
18
19
20
19
def main():
21
def main():
20
	with univention.testing.udm.UCSTestUDM() as udm:
22
	with univention.testing.udm.UCSTestUDM() as udm:
21
		with utu.UCSTestSchool() as schoolenv:
23
		with utu.UCSTestSchool() as schoolenv:
 Lines 29-35    Link Here 
29
				klasse_dn = udm.create_object(
31
				klasse_dn = udm.create_object(
30
						'groups/group',
32
						'groups/group',
31
						name='%s-AA1' % school,
33
						name='%s-AA1' % school,
32
						position="cn=klassen,cn=schueler,cn=groups,%s" % oudn
34
						position=SchoolClass.get_container(school)
33
						)
35
						)
34
				tea, teadn = schoolenv.create_user(school, is_teacher=True)
36
				tea, teadn = schoolenv.create_user(school, is_teacher=True)
35
				stu, studn = schoolenv.create_user(school)
37
				stu, studn = schoolenv.create_user(school)
 Lines 65-75    Link Here 
65
67
66
				try:
68
				try:
67
					expected_memberUid = ["%s$" % pc2.name, "exam-%s" % stu]
69
					expected_memberUid = ["%s$" % pc2.name, "exam-%s" % stu]
68
					expected_uniqueMember = ["%s" % pc2.dn, "uid=exam-%s,cn=examusers,%s" % (stu, oudn)]
70
					expected_uniqueMember = [pc2.dn, ExamStudent(school=school, name=stu).dn]
69
71
70
					# Get the current attributes values
72
					# Get the current attributes values
71
					lo = getMachineConnection()
73
					lo = getMachineConnection()
72
					exam_group_dn = "cn=OU%s-Klassenarbeit,cn=ucsschool,cn=groups,%s" % (school, ucr.get('ldap/base'))
74
					exam_group_dn = ExamStudent.get_search_base(school).examGroup
73
					memberUid = lo.search(base=exam_group_dn)[0][1].get('memberUid')
75
					memberUid = lo.search(base=exam_group_dn)[0][1].get('memberUid')
74
					uniqueMember = lo.search(base=exam_group_dn)[0][1].get('uniqueMember')
76
					uniqueMember = lo.search(base=exam_group_dn)[0][1].get('uniqueMember')
75
					
77
					
(-)ucs-test-ucsschool/90_ucsschool/101_exam_mode_settings (-1 / +3 lines)
 Lines 17-23    Link Here 
17
import univention.testing.ucr as ucr_test
17
import univention.testing.ucr as ucr_test
18
import univention.testing.ucsschool as utu
18
import univention.testing.ucsschool as utu
19
import univention.testing.udm
19
import univention.testing.udm
20
from ucsschool.lib.models import SchoolClass
20
21
22
21
def main():
23
def main():
22
	with univention.testing.udm.UCSTestUDM() as udm:
24
	with univention.testing.udm.UCSTestUDM() as udm:
23
		with utu.UCSTestSchool() as schoolenv:
25
		with utu.UCSTestSchool() as schoolenv:
 Lines 32-38    Link Here 
32
					edudc = ucr.get('hostname')
34
					edudc = ucr.get('hostname')
33
35
34
				school, oudn = schoolenv.create_ou(name_edudc=edudc)
36
				school, oudn = schoolenv.create_ou(name_edudc=edudc)
35
				klasse_dn = udm.create_object('groups/group',name='%s-AA1' % school, position="cn=klassen,cn=schueler,cn=groups,%s" % oudn)
37
				klasse_dn = udm.create_object('groups/group',name='%s-AA1' % school, position=SchoolClass.get_container(school))
36
38
37
				tea, teadn = schoolenv.create_user(school, is_teacher=True)
39
				tea, teadn = schoolenv.create_user(school, is_teacher=True)
38
				stu, studn = schoolenv.create_user(school)
40
				stu, studn = schoolenv.create_user(school)
(-)ucs-test-ucsschool/90_ucsschool/102_rename_class (-7 / +6 lines)
 Lines 16-22    Link Here 
16
import univention.testing.ucr as ucr_test
16
import univention.testing.ucr as ucr_test
17
import univention.testing.ucsschool as utu
17
import univention.testing.ucsschool as utu
18
import univention.testing.utils as utils
18
import univention.testing.utils as utils
19
from ucsschool.lib.models import ClassShare, SchoolClass
19
20
21
20
BACKUP_PATH = '/home/backup/groups'
22
BACKUP_PATH = '/home/backup/groups'
21
23
22
def ldap_info(cn):
24
def ldap_info(cn):
 Lines 46-62    Link Here 
46
	utils.verify_ldap_object(share_dn(new_name, school), should_exist=True)
48
	utils.verify_ldap_object(share_dn(new_name, school), should_exist=True)
47
49
48
def share_dn(class_name, school):
50
def share_dn(class_name, school):
49
	with ucr_test.UCSTestConfigRegistry() as ucr:
51
	return ClassShare(school=school, name=class_name).dn
50
		return 'cn=%s,cn=klassen,cn=shares,ou=%s,%s' % (
51
				class_name, school,ucr.get('ldap/base'))
52
52
53
def class_dn(class_name, school):
53
def class_dn(class_name, school):
54
	with ucr_test.UCSTestConfigRegistry() as ucr:
54
	return SchoolClass(school=school, name=class_name).dn
55
		return 'cn=%s,cn=klassen,cn=schueler,cn=groups,ou=%s,%s' % (
56
				class_name, school,ucr.get('ldap/base'))
57
55
58
def share_path(class_name, school):
56
def share_path(class_name, school):
59
	path = '/home/%s/groups/klassen/%s' % (school, class_name)
57
	sc = SchoolClass(school=school, name=class_name)
58
	path = ClassShare(school=school, name=class_name, school_group=sc).get_share_path()
60
	if os.path.exists(path):
59
	if os.path.exists(path):
61
		return path
60
		return path
62
61
(-)ucs-test-ucsschool/90_ucsschool/110_set_default-umc-users (-1 / +2 lines)
 Lines 10-15    Link Here 
10
import ldap
10
import ldap
11
import univention.testing.ucr as ucr_test
11
import univention.testing.ucr as ucr_test
12
import univention.testing.utils as utils
12
import univention.testing.utils as utils
13
from ucsschool.lib.models import Group
13
14
14
15
15
def main():
16
def main():
 Lines 45-51    Link Here 
45
					utils.fail('Attribute %s was not found in ldap object %r' % (
46
					utils.fail('Attribute %s was not found in ldap object %r' % (
46
						'univentionPolicyReference', base))
47
						'univentionPolicyReference', base))
47
				except ldap.NO_SUCH_OBJECT as e:
48
				except ldap.NO_SUCH_OBJECT as e:
48
					if "cn=groups,%s" % (schoolenv.get_ou_base_dn(school),) in str(e):
49
					if Group.get_container(school) in str(e):
49
						print ('* Cought an expected exception: %r' % e)
50
						print ('* Cought an expected exception: %r' % e)
50
					else:
51
					else:
51
						utils.fail('Unexpected Exception: %r' % e)
52
						utils.fail('Unexpected Exception: %r' % e)
(-)ucs-test-ucsschool/90_ucsschool/131_check_for_nfs_shares (-1 / +1 lines)
 Lines 19-25    Link Here 
19
			for share in Share.get_all(lo, school.name):
19
			for share in Share.get_all(lo, school.name):
20
				share_udm = share.get_udm_object(lo)
20
				share_udm = share.get_udm_object(lo)
21
				if "nfs" in share_udm.options:
21
				if "nfs" in share_udm.options:
22
					if share.name in ["Marktplatz", "iTALC-Installation"]:
22
					if share.name in [Share.get_search_base(school).share_name_marktplatz, "iTALC-Installation"]:
23
						print("*** Ignoring //{}/{} (Bug #42514)".format(school.name, share.name))
23
						print("*** Ignoring //{}/{} (Bug #42514)".format(school.name, share.name))
24
					else:
24
					else:
25
						nfs_shares.append((school.name, share.name))
25
						nfs_shares.append((school.name, share.name))
(-)ucs-test-ucsschool/90_ucsschool/16_s4_slave_automatic_srv_record (-2 / +2 lines)
 Lines 132-138    Link Here 
132
					position = "cn=dc,cn=server,cn=computers,%s" % (school.dn,),
132
					position = "cn=dc,cn=server,cn=computers,%s" % (school.dn,),
133
					domain = ucr.get('domainname'),
133
					domain = ucr.get('domainname'),
134
					service = ("S4 SlavePDC", _local_ucsschool_service),
134
					service = ("S4 SlavePDC", _local_ucsschool_service),
135
					groups = ("cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%(ldap/base)s" % ucr)
135
					groups = (school.get_search_base(school.name).educational_dc_group)
136
					)
136
					)
137
137
138
				positive_test_fqdn = ".".join((positive_test_hostname, ucr.get('domainname')))
138
				positive_test_fqdn = ".".join((positive_test_hostname, ucr.get('domainname')))
 Lines 144-150    Link Here 
144
					position = "cn=dc,cn=server,cn=computers,%s" % (school.dn,),
144
					position = "cn=dc,cn=server,cn=computers,%s" % (school.dn,),
145
					domain = ucr.get('domainname'),
145
					domain = ucr.get('domainname'),
146
					service = ("S4 SlavePDC", _not_local_ucsschool_service),
146
					service = ("S4 SlavePDC", _not_local_ucsschool_service),
147
					groups = ("cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%(ldap/base)s" % ucr)
147
					groups = (school.get_search_base(school.name).educational_dc_group)
148
					)
148
					)
149
149
150
				negative_test_fqdn = ".".join((negative_test_hostname, ucr.get('domainname')))
150
				negative_test_fqdn = ".".join((negative_test_hostname, ucr.get('domainname')))
(-)ucs-test-ucsschool/90_ucsschool/19_available_umc_modules (-2 / +5 lines)
 Lines 11-17    Link Here 
11
import univention.testing.ucsschool as utu
11
import univention.testing.ucsschool as utu
12
import univention.testing.udm as udm_test
12
import univention.testing.udm as udm_test
13
import univention.testing.utils as utils
13
import univention.testing.utils as utils
14
from ucsschool.lib.models import School
14
15
16
15
def listUnion(firstList, secondList):
17
def listUnion(firstList, secondList):
16
	return list(set(firstList).union(set(secondList)))
18
	return list(set(firstList).union(set(secondList)))
17
19
 Lines 161-168    Link Here 
161
				utils.wait_for_replication_and_postrun()
163
				utils.wait_for_replication_and_postrun()
162
164
163
				basedn = ucr.get('ldap/base')
165
				basedn = ucr.get('ldap/base')
164
				position = 'cn=admins,cn=users,ou=%s,%s' % (school, basedn )
166
				search_base = School.get_search_base(school)
165
				groups = ["cn=admins-%s,cn=ouadmins,cn=groups,%s" % (school, basedn)]
167
				position = search_base.admins
168
				groups = [search_base.admin_group]
166
				dn, schooladmin = udm.create_user(position=position, groups=groups)
169
				dn, schooladmin = udm.create_user(position=position, groups=groups)
167
				groups = ["cn=Domain Admins,cn=groups,%s" % (basedn,)]
170
				groups = ["cn=Domain Admins,cn=groups,%s" % (basedn,)]
168
				dn, domainadmin = udm.create_user(position=position, groups=groups)
171
				dn, domainadmin = udm.create_user(position=position, groups=groups)
(-)ucs-test-ucsschool/90_ucsschool/213_import-users_modify_with_several_groups (-4 / +5 lines)
 Lines 12-17    Link Here 
12
import univention.testing.utils as utils
12
import univention.testing.utils as utils
13
from essential.importusers_cli_v2 import CLI_Import_v2_Tester
13
from essential.importusers_cli_v2 import CLI_Import_v2_Tester
14
from essential.importusers import Person
14
from essential.importusers import Person
15
from ucsschool.lib.models import SchoolClass, WorkGroup
15
16
16
17
17
class Test(CLI_Import_v2_Tester):
18
class Test(CLI_Import_v2_Tester):
 Lines 38-47    Link Here 
38
		self.log.debug('*** Creating groups...')
39
		self.log.debug('*** Creating groups...')
39
		global_group_dn, global_group_name = self.udm.create_group()
40
		global_group_dn, global_group_name = self.udm.create_group()
40
		workgroup_A_dn, workgroup_A_name = self.udm.create_group(
41
		workgroup_A_dn, workgroup_A_name = self.udm.create_group(
41
			position='cn=schueler,cn=groups,%s' % (self.ou_A.dn,),
42
			position=WorkGroup.get_container(self.ou_A.name),
42
			name="{}-{}".format(self.ou_A.name, uts.random_groupname()))
43
			name="{}-{}".format(self.ou_A.name, uts.random_groupname()))
43
		class_A_dn, class_A_name = self.udm.create_group(
44
		class_A_dn, class_A_name = self.udm.create_group(
44
			position='cn=klassen,cn=schueler,cn=groups,%s' % (self.ou_A.dn,),
45
			position=SchoolClass.get_container(self.ou_A.name),
45
			name="{}-{}".format(self.ou_A.name, uts.random_groupname()))
46
			name="{}-{}".format(self.ou_A.name, uts.random_groupname()))
46
		cn_A_dn = self.udm.create_object('container/cn', position=self.ou_A.dn, name='kurs-%s' % uts.random_string())
47
		cn_A_dn = self.udm.create_object('container/cn', position=self.ou_A.dn, name='kurs-%s' % uts.random_string())
47
		extra_A_group1_dn, extra_A_group1_name = self.udm.create_group(position=cn_A_dn)
48
		extra_A_group1_dn, extra_A_group1_name = self.udm.create_group(position=cn_A_dn)
 Lines 50-59    Link Here 
50
			name="{}-{}".format(self.ou_A.name, uts.random_groupname()))
51
			name="{}-{}".format(self.ou_A.name, uts.random_groupname()))
51
52
52
		workgroup_B_dn, workgroup_B_name = self.udm.create_group(
53
		workgroup_B_dn, workgroup_B_name = self.udm.create_group(
53
			position='cn=schueler,cn=groups,%s' % (self.ou_B.dn,),
54
			position=WorkGroup.get_container(self.ou_B.name),
54
			name="{}-{}".format(self.ou_B.name, uts.random_groupname()))
55
			name="{}-{}".format(self.ou_B.name, uts.random_groupname()))
55
		class_B_dn, class_B_name = self.udm.create_group(
56
		class_B_dn, class_B_name = self.udm.create_group(
56
			position='cn=klassen,cn=schueler,cn=groups,%s' % (self.ou_B.dn,),
57
			position=SchoolClass.get_container(self.ou_B.name),
57
			name="{}-{}".format(self.ou_B.name, uts.random_groupname()))
58
			name="{}-{}".format(self.ou_B.name, uts.random_groupname()))
58
		cn_B_dn = self.udm.create_object('container/cn', position=self.ou_B.dn, name='kurs-%s' % uts.random_string())
59
		cn_B_dn = self.udm.create_object('container/cn', position=self.ou_B.dn, name='kurs-%s' % uts.random_string())
59
		extra_B_group1_dn, extra_B_group1_name = self.udm.create_group(position=cn_B_dn)
60
		extra_B_group1_dn, extra_B_group1_name = self.udm.create_group(position=cn_B_dn)
(-)ucs-test-ucsschool/90_ucsschool/214_import-users_empty_class_column (-2 / +3 lines)
 Lines 13-18    Link Here 
13
import univention.testing.utils as utils
13
import univention.testing.utils as utils
14
from essential.importusers_cli_v2 import CLI_Import_v2_Tester
14
from essential.importusers_cli_v2 import CLI_Import_v2_Tester
15
from essential.importusers import Person
15
from essential.importusers import Person
16
from ucsschool.lib.models import SchoolClass
16
17
17
18
18
class Test(CLI_Import_v2_Tester):
19
class Test(CLI_Import_v2_Tester):
 Lines 44-50    Link Here 
44
45
45
		def create_user_w_two_classes(record_uid, source_uid, same_ou=True):
46
		def create_user_w_two_classes(record_uid, source_uid, same_ou=True):
46
			cls1_dn, cls1_name = self.udm.create_group(
47
			cls1_dn, cls1_name = self.udm.create_group(
47
				position='cn=klassen,cn=schueler,cn=groups,%s' % (self.ou_A.dn,),
48
				position=SchoolClass.get_container(self.ou_A.name),
48
				name="{}-{}".format(self.ou_A.name, uts.random_groupname()))
49
				name="{}-{}".format(self.ou_A.name, uts.random_groupname()))
49
			if same_ou:
50
			if same_ou:
50
				dn = self.ou_A.dn
51
				dn = self.ou_A.dn
 Lines 55-61    Link Here 
55
				name = self.ou_B.name
56
				name = self.ou_B.name
56
				school = sorted([self.ou_A.name, self.ou_B.name])[0]
57
				school = sorted([self.ou_A.name, self.ou_B.name])[0]
57
			cls2_dn, cls2_name = self.udm.create_group(
58
			cls2_dn, cls2_name = self.udm.create_group(
58
				position='cn=klassen,cn=schueler,cn=groups,%s' % (dn,),
59
				position=SchoolClass.get_container(name),
59
				name="{}-{}".format(name, uts.random_groupname()))
60
				name="{}-{}".format(name, uts.random_groupname()))
60
			person = Person(school, role)
61
			person = Person(school, role)
61
			person.update(record_uid=record_uid, source_uid=source_uid, username=uts.random_username())
62
			person.update(record_uid=record_uid, source_uid=source_uid, username=uts.random_username())
(-)ucs-test-ucsschool/90_ucsschool/22_computerroom_two_rooms_settings_interference (-1 / +2 lines)
 Lines 11-16    Link Here 
11
from essential.computerroom import Room, Computers, add_printer, remove_printer, clean_folder, run_commands
11
from essential.computerroom import Room, Computers, add_printer, remove_printer, clean_folder, run_commands
12
from essential.internetrule import InternetRule
12
from essential.internetrule import InternetRule
13
from essential.workgroup import Workgroup
13
from essential.workgroup import Workgroup
14
from ucsschool.lib.models import Share
14
from univention.testing.ucsschool import UMCConnection
15
from univention.testing.ucsschool import UMCConnection
15
from univention.testing.network import NetworkRedirector
16
from univention.testing.network import NetworkRedirector
16
import datetime
17
import datetime
 Lines 153-159    Link Here 
153
										ucr)
154
										ucr)
154
								# For DEBUG purposes
155
								# For DEBUG purposes
155
								# run_commands([['ucr', 'search', room1.name], ['ucr','search', room2.name], ['atq']], {})
156
								# run_commands([['ucr', 'search', room1.name], ['ucr','search', room2.name], ['atq']], {})
156
								clean_folder('/home/gsmitte/groups/Marktplatz/')
157
								clean_folder('/home/gsmitte/groups/{}/'.format(Share.get_search_base(school).share_name_marktplatz))
157
								clean_folder('/home/%s/lehrer/%s/' % (school, tea))
158
								clean_folder('/home/%s/lehrer/%s/' % (school, tea))
158
							#TODO Exception Errno4
159
							#TODO Exception Errno4
159
							except httplib.HTTPException as e:
160
							except httplib.HTTPException as e:
(-)ucs-test-ucsschool/90_ucsschool/40_schoolwizard_school_create (-52 / +22 lines)
 Lines 9-14    Link Here 
9
9
10
import subprocess
10
import subprocess
11
import simplejson as json
11
import simplejson as json
12
from ucsschool.lib.models import Group
12
import univention.testing.ucr as ucr_test
13
import univention.testing.ucr as ucr_test
13
import univention.testing.utils as utils
14
import univention.testing.utils as utils
14
import univention.testing.strings as uts
15
import univention.testing.strings as uts
 Lines 46-51    Link Here 
46
	return stdout, stderr, pipe.returncode
47
	return stdout, stderr, pipe.returncode
47
48
48
49
50
def grp_dns(ou_name, edu=True):
51
	search_base = Group.get_search_base(ou_name)
52
	if edu:
53
		return [search_base.educational_ou_dc_group, search_base.educational_dc_group]
54
	else:
55
		return [search_base.administrative_ou_dc_group, search_base.administrative_dc_group]
56
57
49
def main():
58
def main():
50
	remove_ous = []
59
	remove_ous = []
51
	testschool = UCSTestSchool()
60
	testschool = UCSTestSchool()
 Lines 64-73    Link Here 
64
			utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=False)
73
			utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=False)
65
		else:
74
		else:
66
			utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=True)
75
			utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=True)
67
			for grp_dn in ('cn=OU%(ou)s-DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
76
			for grp_dn in grp_dns(ou_name):
68
						   'cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
69
						   ):
70
				grp_dn = grp_dn % {'ou': ou_name, 'basedn': ucr.get('ldap/base')}
71
				utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
77
				utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
72
78
73
		msg = 'new random OU, new random DC'
79
		msg = 'new random OU, new random DC'
 Lines 80-89    Link Here 
80
			utils.fail('Cannot create %s' % msg)
86
			utils.fail('Cannot create %s' % msg)
81
		dc_dn = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name, testschool.get_ou_base_dn(ou_name))
87
		dc_dn = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name, testschool.get_ou_base_dn(ou_name))
82
		utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=True)
88
		utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=True)
83
		for grp_dn in ('cn=OU%(ou)s-DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
89
		for grp_dn in grp_dns(ou_name):
84
					   'cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
85
					  ):
86
			grp_dn = grp_dn % {'ou': ou_name, 'basedn': ucr.get('ldap/base')}
87
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
90
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
88
91
89
		msg = 'new random OU, existing DC in other OU'
92
		msg = 'new random OU, existing DC in other OU'
 Lines 95-104    Link Here 
95
			utils.fail('Cannot create %s' % msg)
98
			utils.fail('Cannot create %s' % msg)
96
		# reusing first DC
99
		# reusing first DC
97
		utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=True)
100
		utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=True)
98
		for grp_dn in ('cn=OU%(ou)s-DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
101
		for grp_dn in grp_dns(ou_name):
99
					   'cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
100
					  ):
101
			grp_dn = grp_dn % {'ou': ou_name, 'basedn': ucr.get('ldap/base')}
102
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
102
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
103
103
104
		msg = 'new random OU with existing DC in cn=computers,BASEDN'
104
		msg = 'new random OU with existing DC in cn=computers,BASEDN'
 Lines 119-128    Link Here 
119
				utils.fail('Cannot create %s' % msg)
119
				utils.fail('Cannot create %s' % msg)
120
120
121
			utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=True)
121
			utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=True)
122
			for grp_dn in ('cn=OU%(ou)s-DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
122
			for grp_dn in grp_dns(ou_name):
123
						   'cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
124
					  ):
125
				grp_dn = grp_dn % {'ou': ou_name, 'basedn': ucr.get('ldap/base')}
126
				utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
123
				utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
127
124
128
125
 Lines 136-145    Link Here 
136
			utils.fail('Cannot create %s' % msg)
133
			utils.fail('Cannot create %s' % msg)
137
		dc_dn = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name, testschool.get_ou_base_dn(ou_name))
134
		dc_dn = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name, testschool.get_ou_base_dn(ou_name))
138
		utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=True)
135
		utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=True)
139
		for grp_dn in ('cn=OU%(ou)s-DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
136
		for grp_dn in grp_dns(ou_name):
140
					   'cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
141
					  ):
142
			grp_dn = grp_dn % {'ou': ou_name, 'basedn': ucr.get('ldap/base')}
143
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
137
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
144
138
145
		dc_name = uts.random_string()
139
		dc_name = uts.random_string()
 Lines 148-157    Link Here 
148
			utils.fail('Cannot create %s' % msg)
142
			utils.fail('Cannot create %s' % msg)
149
		dc_dn = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name, testschool.get_ou_base_dn(ou_name))
143
		dc_dn = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name, testschool.get_ou_base_dn(ou_name))
150
		utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=True)
144
		utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=True)
151
		for grp_dn in ('cn=OU%(ou)s-DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
145
		for grp_dn in grp_dns(ou_name):
152
					   'cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
153
					  ):
154
			grp_dn = grp_dn % {'ou': ou_name, 'basedn': ucr.get('ldap/base')}
155
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
146
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
156
147
157
148
 Lines 167-181    Link Here 
167
		dc_dn = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name, testschool.get_ou_base_dn(ou_name))
158
		dc_dn = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name, testschool.get_ou_base_dn(ou_name))
168
		dc_dn_administrative = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name_administrative, testschool.get_ou_base_dn(ou_name))
159
		dc_dn_administrative = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name_administrative, testschool.get_ou_base_dn(ou_name))
169
		utils.verify_ldap_object(dc_dn_administrative, expected_attr={'cn': [dc_name_administrative]}, strict=True, should_exist=True)
160
		utils.verify_ldap_object(dc_dn_administrative, expected_attr={'cn': [dc_name_administrative]}, strict=True, should_exist=True)
170
		for grp_dn in ('cn=OU%(ou)s-DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
161
		for grp_dn in grp_dns(ou_name):
171
					   'cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
172
					  ):
173
			grp_dn = grp_dn % {'ou': ou_name, 'basedn': ucr.get('ldap/base')}
174
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
162
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
175
		for grp_dn in ('cn=OU%(ou)s-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%(basedn)s',
163
		for grp_dn in grp_dns(ou_name, False):
176
					   'cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%(basedn)s',
177
					  ):
178
			grp_dn = grp_dn % {'ou': ou_name, 'basedn': ucr.get('ldap/base')}
179
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn_administrative]}, strict=False, should_exist=True)
164
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn_administrative]}, strict=False, should_exist=True)
180
165
181
166
 Lines 189-198    Link Here 
189
			utils.fail('Cannot create %s' % msg)
174
			utils.fail('Cannot create %s' % msg)
190
		dc_dn = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name, testschool.get_ou_base_dn(ou_name))
175
		dc_dn = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name, testschool.get_ou_base_dn(ou_name))
191
		utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=True)
176
		utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=True)
192
		for grp_dn in ('cn=OU%(ou)s-DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
177
		for grp_dn in grp_dns(ou_name):
193
					   'cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
194
					  ):
195
			grp_dn = grp_dn % {'ou': ou_name, 'basedn': ucr.get('ldap/base')}
196
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
178
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
197
179
198
		dc_name_administrative = uts.random_string()
180
		dc_name_administrative = uts.random_string()
 Lines 201-215    Link Here 
201
			utils.fail('Cannot create %s' % msg)
183
			utils.fail('Cannot create %s' % msg)
202
		dc_dn_administrative = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name_administrative, testschool.get_ou_base_dn(ou_name))
184
		dc_dn_administrative = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name_administrative, testschool.get_ou_base_dn(ou_name))
203
		utils.verify_ldap_object(dc_dn_administrative, expected_attr={'cn': [dc_name_administrative]}, strict=True, should_exist=True)
185
		utils.verify_ldap_object(dc_dn_administrative, expected_attr={'cn': [dc_name_administrative]}, strict=True, should_exist=True)
204
		for grp_dn in ('cn=OU%(ou)s-DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
186
		for grp_dn in grp_dns(ou_name):
205
					   'cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
206
					  ):
207
			grp_dn = grp_dn % {'ou': ou_name, 'basedn': ucr.get('ldap/base')}
208
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
187
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
209
		for grp_dn in ('cn=OU%(ou)s-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%(basedn)s',
188
		for grp_dn in grp_dns(ou_name, False):
210
					   'cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%(basedn)s',
211
					  ):
212
			grp_dn = grp_dn % {'ou': ou_name, 'basedn': ucr.get('ldap/base')}
213
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn_administrative]}, strict=False, should_exist=True)
189
			utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn_administrative]}, strict=False, should_exist=True)
214
190
215
		msg = 'new random OU with existing administrative DC in cn=computers,BASEDN'
191
		msg = 'new random OU with existing administrative DC in cn=computers,BASEDN'
 Lines 232-246    Link Here 
232
208
233
			dc_dn = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name, testschool.get_ou_base_dn(ou_name))
209
			dc_dn = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name, testschool.get_ou_base_dn(ou_name))
234
			utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=True)
210
			utils.verify_ldap_object(dc_dn, expected_attr={'cn': [dc_name]}, strict=True, should_exist=True)
235
			for grp_dn in ('cn=OU%(ou)s-DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
211
			for grp_dn in grp_dns(ou_name):
236
						   'cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%(basedn)s',
237
					  ):
238
				grp_dn = grp_dn % {'ou': ou_name, 'basedn': ucr.get('ldap/base')}
239
				utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
212
				utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn]}, strict=False, should_exist=True)
240
			for grp_dn in ('cn=OU%(ou)s-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%(basedn)s',
213
			for grp_dn in grp_dns(ou_name, False):
241
						   'cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%(basedn)s',
242
						   ):
243
				grp_dn = grp_dn % {'ou': ou_name, 'basedn': ucr.get('ldap/base')}
244
				utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn_administrative]}, strict=False, should_exist=True)
214
				utils.verify_ldap_object(grp_dn, expected_attr={'uniqueMember': [dc_dn_administrative]}, strict=False, should_exist=True)
245
215
246
	finally:
216
	finally:
(-)ucs-test-ucsschool/90_ucsschool/41_create_marktplatz_share (-4 / +18 lines)
 Lines 1-29    Link Here 
1
#!/usr/share/ucs-test/runner python
1
#!/usr/share/ucs-test/runner python
2
## -*- coding: utf-8 -*-
2
## -*- coding: utf-8 -*-
3
## desc: computerroom module settings checks
3
## desc: check marktplatz creation
4
## roles: [domaincontroller_master]
4
## roles: [domaincontroller_master]
5
## tags: [apptest,ucsschool]
5
## tags: [apptest,ucsschool]
6
## exposure: dangerous
6
## exposure: dangerous
7
## packages: [ucs-school-umc-computerroom]
7
## packages: [ucs-school-umc-computerroom]
8
## bugs: [40785]
8
## bugs: [40785, 41231]
9
9
10
import univention.testing.ucr as ucr_test
10
import univention.testing.ucr as ucr_test
11
import univention.testing.ucsschool as utu
11
import univention.testing.ucsschool as utu
12
import univention.testing.strings as uts
12
from univention.testing import utils
13
from univention.testing import utils
13
from univention.config_registry import handler_set, handler_unset
14
from univention.config_registry import handler_set, handler_unset
14
15
16
15
def main():
17
def main():
16
	with utu.UCSTestSchool() as schoolenv, ucr_test.UCSTestConfigRegistry() as ucr:
18
	with utu.UCSTestSchool() as schoolenv, ucr_test.UCSTestConfigRegistry() as ucr:
17
		for should_exist, variable in [(False, None), (True, 'yes'), (False, 'no')]:
19
		for should_exist, variable, name in [(False, None, ''), (True, 'yes', 'Marktplatz'), (True, 'yes', uts.random_name()), (False, 'no', '')]:
18
			if variable is None:
20
			if variable is None:
19
				handler_unset(['ucsschool/import/generate/share/marktplatz'])
21
				handler_unset(['ucsschool/import/generate/share/marktplatz'])
20
			else:
22
			else:
23
				print '### Setting ucsschool/import/generate/share/marktplatz=%s.' % variable
21
				handler_set(['ucsschool/import/generate/share/marktplatz=%s' % (variable,)])
24
				handler_set(['ucsschool/import/generate/share/marktplatz=%s' % (variable,)])
22
25
23
			print '### Creating school. Expecting Marktplatz to exists = %r' % (should_exist,)
26
			print '### Creating school. Expecting Marktplatz to exists = %r' % (should_exist,)
27
			if should_exist:
28
				if name:
29
					print '### Setting share name to %r.' % name
30
					handler_set(['ucsschool/import/generate/share/marktplatz/name={}'.format(name)])
31
				else:
32
					print '### Not setting share name, should be "Marktplatz".'
33
					handler_unset(['ucsschool/import/generate/share/marktplatz/name'])
34
24
			school, oudn = schoolenv.create_ou(name_edudc=ucr.get('hostname'))
35
			school, oudn = schoolenv.create_ou(name_edudc=ucr.get('hostname'))
25
			utils.wait_for_replication()
36
			utils.wait_for_replication()
26
			utils.verify_ldap_object('cn=Marktplatz,cn=shares,%s' % (oudn,), strict=True, should_exist=should_exist)
37
			utils.verify_ldap_object(
38
				'cn={},cn=shares,{}'.format(name or 'Marktplatz', oudn),
39
				strict=True,
40
				should_exist=should_exist)
27
41
28
if __name__ == '__main__':
42
if __name__ == '__main__':
29
	main()
43
	main()
(-)ucs-test-ucsschool/90_ucsschool/75_ldap_acls_admins (-3 / +4 lines)
 Lines 12-17    Link Here 
12
from essential.schoolroom import ComputerRoom
12
from essential.schoolroom import ComputerRoom
13
import univention.testing.ucr as ucr_test
13
import univention.testing.ucr as ucr_test
14
import univention.testing.ucsschool as utu
14
import univention.testing.ucsschool as utu
15
from ucsschool.lib.models import ClassShare, Share
15
16
16
17
17
def main():
18
def main():
 Lines 52-62    Link Here 
52
			acl.assert_teacher_group('write')
53
			acl.assert_teacher_group('write')
53
			acl.assert_student_group('write')
54
			acl.assert_student_group('write')
54
55
55
			shares_dn = 'cn=shares,%s' % utu.UCSTestSchool().get_ou_base_dn(school)
56
			shares_dn = Share.get_container(school)
56
			acl.assert_shares(shares_dn, 'write')
57
			acl.assert_shares(shares_dn, 'write')
57
			shares_dn = 'cn=Marktplatz,cn=shares,%s' % utu.UCSTestSchool().get_ou_base_dn(school)
58
			shares_dn = Share(school=school, name=Share.get_search_base(school).share_name_marktplatz).dn
58
			acl.assert_shares(shares_dn, 'write')
59
			acl.assert_shares(shares_dn, 'write')
59
			shares_dn = 'cn=klassen,cn=shares,%s' % utu.UCSTestSchool().get_ou_base_dn(school)
60
			shares_dn = ClassShare.get_container(school)
60
			acl.assert_shares(shares_dn, 'read')
61
			acl.assert_shares(shares_dn, 'read')
61
62
62
			acl.assert_temps('write')
63
			acl.assert_temps('write')
(-)ucs-test-ucsschool/90_ucsschool/75_ldap_acls_staff (-1 / +2 lines)
 Lines 10-15    Link Here 
10
from essential.acl import Acl
10
from essential.acl import Acl
11
from essential.computerroom import Computers
11
from essential.computerroom import Computers
12
from essential.schoolroom import ComputerRoom
12
from essential.schoolroom import ComputerRoom
13
from ucsschool.lib.models import Share
13
import univention.testing.ucr as ucr_test
14
import univention.testing.ucr as ucr_test
14
import univention.testing.ucsschool as utu
15
import univention.testing.ucsschool as utu
15
16
 Lines 50-56    Link Here 
50
			share_dn = open_ldap_co.searchDn(filter=filter_format('(&(objectClass=univentionShare)(cn=%s))', (class_name,)))[0]
51
			share_dn = open_ldap_co.searchDn(filter=filter_format('(&(objectClass=univentionShare)(cn=%s))', (class_name,)))[0]
51
			acl.assert_share_object_access(share_dn, 'read', 'ALLOWED')
52
			acl.assert_share_object_access(share_dn, 'read', 'ALLOWED')
52
			acl.assert_share_object_access(share_dn, 'write', 'DENIED')
53
			acl.assert_share_object_access(share_dn, 'write', 'DENIED')
53
			share_dn = 'cn=Marktplatz,cn=shares,%s' % (oudn,)
54
			share_dn = Share(school=school, name=Share.get_search_base(school).share_name_marktplatz).dn
54
			acl.assert_share_object_access(share_dn, 'read', 'ALLOWED')
55
			acl.assert_share_object_access(share_dn, 'read', 'ALLOWED')
55
			acl.assert_share_object_access(share_dn, 'write', 'DENIED')
56
			acl.assert_share_object_access(share_dn, 'write', 'DENIED')
56
57
(-)ucs-test-ucsschool/90_ucsschool/75_ldap_acls_teacher_and_staff (-3 / +4 lines)
 Lines 12-17    Link Here 
12
from essential.schoolroom import ComputerRoom
12
from essential.schoolroom import ComputerRoom
13
import univention.testing.ucr as ucr_test
13
import univention.testing.ucr as ucr_test
14
import univention.testing.ucsschool as utu
14
import univention.testing.ucsschool as utu
15
from ucsschool.lib.models import ClassShare, Share
15
16
16
17
17
def main():
18
def main():
 Lines 40-50    Link Here 
40
			acl.assert_teacher_group('write')
41
			acl.assert_teacher_group('write')
41
			acl.assert_student_group('write')
42
			acl.assert_student_group('write')
42
43
43
			shares_dn = 'cn=shares,%s' % utu.UCSTestSchool().get_ou_base_dn(school)
44
			shares_dn = Share.get_container(school)
44
			acl.assert_shares(shares_dn, 'write')
45
			acl.assert_shares(shares_dn, 'write')
45
			shares_dn = 'cn=Marktplatz,cn=shares,%s' % utu.UCSTestSchool().get_ou_base_dn(school)
46
			shares_dn = Share(school=school, name=Share.get_search_base(school).share_name_marktplatz).dn
46
			acl.assert_shares(shares_dn, 'write')
47
			acl.assert_shares(shares_dn, 'write')
47
			shares_dn = 'cn=klassen,cn=shares,%s' % utu.UCSTestSchool().get_ou_base_dn(school)
48
			shares_dn = ClassShare.get_container(school)
48
			acl.assert_shares(shares_dn, 'read')
49
			acl.assert_shares(shares_dn, 'read')
49
50
50
			acl.assert_temps('write')
51
			acl.assert_temps('write')
(-)ucs-test-ucsschool/90_ucsschool/75_ldap_acls_teachers (-3 / +4 lines)
 Lines 12-17    Link Here 
12
from essential.schoolroom import ComputerRoom
12
from essential.schoolroom import ComputerRoom
13
import univention.testing.ucr as ucr_test
13
import univention.testing.ucr as ucr_test
14
import univention.testing.ucsschool as utu
14
import univention.testing.ucsschool as utu
15
from ucsschool.lib.models import ClassShare, Share
15
16
16
17
17
def main():
18
def main():
 Lines 41-51    Link Here 
41
42
42
			acl.assert_teacher_group('write')
43
			acl.assert_teacher_group('write')
43
44
44
			shares_dn = 'cn=shares,%s' % utu.UCSTestSchool().get_ou_base_dn(school)
45
			shares_dn = Share.get_container(school)
45
			acl.assert_shares(shares_dn, 'write')
46
			acl.assert_shares(shares_dn, 'write')
46
			shares_dn = 'cn=Marktplatz,cn=shares,%s' % utu.UCSTestSchool().get_ou_base_dn(school)
47
			shares_dn = Share(school=school, name=Share.get_search_base(school).share_name_marktplatz).dn
47
			acl.assert_shares(shares_dn, 'write')
48
			acl.assert_shares(shares_dn, 'write')
48
			shares_dn = 'cn=klassen,cn=shares,%s' % utu.UCSTestSchool().get_ou_base_dn(school)
49
			shares_dn = ClassShare.get_container(school)
49
			acl.assert_shares(shares_dn, 'read')
50
			acl.assert_shares(shares_dn, 'read')
50
51
51
			acl.assert_temps('write')
52
			acl.assert_temps('write')
(-)ucs-test-ucsschool/90_ucsschool/76_ldap_acls (-9 / +14 lines)
 Lines 14-20    Link Here 
14
from univention.uldap import getMachineConnection
14
from univention.uldap import getMachineConnection
15
import univention.testing.ucr as ucr_test
15
import univention.testing.ucr as ucr_test
16
import univention.testing.ucsschool as utu
16
import univention.testing.ucsschool as utu
17
from ucsschool.lib.models import Group, Policy
17
18
19
18
class FailAcl(Exception):
20
class FailAcl(Exception):
19
	pass
21
	pass
20
22
 Lines 385-399    Link Here 
385
			room = ComputerRoom(school, host_members=computers_dns)
387
			room = ComputerRoom(school, host_members=computers_dns)
386
			room.add()
388
			room.add()
387
389
388
			room_container_dn = 'cn=raeume,cn=groups,%s' % school_dn
390
			room_container_dn = ComputerRoom.get_container(school)
389
			shares_dn = 'cn=shares,%s' % school_dn
390
391
391
			teacher_group2_dn = 'cn=lehrer-%s,cn=groups,%s' % (school, school_dn)
392
			# unused?
392
			student_group2_dn = 'cn=schueler-%s,cn=groups,%s' % (school, school_dn)
393
			#
394
			# shares_dn = search_base.shares
395
			#
396
			# teacher_group2_dn = search_base.teachers_ou_group
397
			# student_group2_dn = search_base.students_ou_group
398
			#
399
			# teacher_group_dn = search_base.teachers_group
400
			# student_group_dn = search_base.students_group
393
401
394
			teacher_group_dn = 'cn=lehrer,cn=groups,%s' % school_dn
395
			student_group_dn = 'cn=schueler,cn=groups,%s' % school_dn
396
397
			gid_temp_dn = 'cn=gid,cn=temporary,cn=univention,%s' % base_dn
402
			gid_temp_dn = 'cn=gid,cn=temporary,cn=univention,%s' % base_dn
398
			gidNumber_temp_dn = 'cn=gidNumber,cn=temporary,cn=univention,%s' % base_dn
403
			gidNumber_temp_dn = 'cn=gidNumber,cn=temporary,cn=univention,%s' % base_dn
399
			sid_temp_dn = 'cn=sid,cn=temporary,cn=univention,%s' % base_dn
404
			sid_temp_dn = 'cn=sid,cn=temporary,cn=univention,%s' % base_dn
 Lines 401-409    Link Here 
401
			mac_temp_dn = 'cn=mac,cn=temporary,cn=univention,%s' % base_dn
406
			mac_temp_dn = 'cn=mac,cn=temporary,cn=univention,%s' % base_dn
402
407
403
			global_univention_dn = 'cn=univention,%s' % base_dn
408
			global_univention_dn = 'cn=univention,%s' % base_dn
404
			global_policies_dn = 'cn=policies,%s' % base_dn
409
			global_policies_dn = Policy.get_container(school)
405
			global_dns_dn = 'cn=dns,%s' % base_dn
410
			global_dns_dn = 'cn=dns,%s' % base_dn
406
			global_groups_dn = 'cn=groups,%s' % base_dn
411
			global_groups_dn = Group.get_container(school)
407
412
408
			dhcp_dn = 'cn=%s,cn=%s,cn=dhcp,%s' % (computers_hostnames[0], school, base_dn)
413
			dhcp_dn = 'cn=%s,cn=%s,cn=dhcp,%s' % (computers_hostnames[0], school, base_dn)
409
414
(-)ucs-test-ucsschool/90_ucsschool/78_ldap_acls_dump.oldconfig.61ucsschool_presettings (-80 / +110 lines)
 Lines 1-154    Link Here 
1
@!@
1
# -*- coding: utf-8 -*-
2
# -*- coding: utf-8 -*-
3
import re
2
4
5
6
def replace_ucr_variables(template):
7
	variable_token = re.compile('@[$]@')
8
9
	dir_ucsschool = {
10
		'ALL_ADM_DC': configRegistry.get('ucsschool/ldap/default/groupname/all-administrativ-dc', 'DC-Verwaltungsnetz'),
11
		'ALL_ADM_MEMBER': configRegistry.get('ucsschool/ldap/default/groupname/all-administrativ-member', 'Member-Verwaltungsnetz'),
12
		'ALL_EDU_DC': configRegistry.get('ucsschool/ldap/default/groupname/all-educational-dc', 'DC-Edukativnetz'),
13
		'ALL_EDU_MEMBER': configRegistry.get('ucsschool/ldap/default/groupname/all-educational-member', 'Member-Edukativnetz'),
14
	}
15
16
	while 1:
17
		i = variable_token.finditer(template)
18
		try:
19
			start = i.next()
20
			end = i.next()
21
			name = template[start.end():end.start()]
22
23
			template = template[:start.start()] + dir_ucsschool.get(name,'') + template[end.end():]
24
		except StopIteration:
25
			break
26
27
	return template
28
29
30
aclset += """
31
# -*- coding: utf-8 -*-
32
3
# Slave-Controller und Member-Server duerfen Samba-Domaenenobjekt(e) modifizieren
33
# Slave-Controller und Member-Server duerfen Samba-Domaenenobjekt(e) modifizieren
4
access to filter="(objectClass=sambaDomain)"
34
access to filter="(objectClass=sambaDomain)"
5
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
35
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
6
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
36
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
7
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
37
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
8
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
38
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
9
   by * none break
39
   by * none break
10
40
11
# Slave-Controller und Memberserver duerfen ausschliesslich den univention-Container replizieren
41
# Slave-Controller und Memberserver duerfen ausschliesslich den univention-Container replizieren
12
access to dn="cn=univention,@%@ldap/base@%@"
42
access to dn="cn=univention,@%@ldap/base@%@"
13
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
43
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
14
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
44
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
15
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
45
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
16
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
46
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
17
   by * none break
47
   by * none break
18
48
19
# Slave-Controller may replicate license container
49
# Slave-Controller may replicate license container
20
access to dn.subtree="cn=license,cn=univention,@%@ldap/base@%@"
50
access to dn.subtree="cn=license,cn=univention,@%@ldap/base@%@"
21
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
51
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
22
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
52
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
23
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
53
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
24
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
54
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
25
   by * none break
55
   by * none break
26
56
27
# Slave-Controller duerfen custom attributes-Container und dessen Inhalt replizieren
57
# Slave-Controller duerfen custom attributes-Container und dessen Inhalt replizieren
28
access to dn.subtree="cn=custom attributes,cn=univention,@%@ldap/base@%@"
58
access to dn.subtree="cn=custom attributes,cn=univention,@%@ldap/base@%@"
29
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
59
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
30
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
60
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
31
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
61
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
32
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
62
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
33
   by * none break
63
   by * none break
34
64
35
# Slave-Controller benoetigen den Console-Container fuer die Berechtigungen an der Lehrerconsole
65
# Slave-Controller benoetigen den Console-Container fuer die Berechtigungen an der Lehrerconsole
36
access to dn.subtree="cn=console,cn=univention,@%@ldap/base@%@"
66
access to dn.subtree="cn=console,cn=univention,@%@ldap/base@%@"
37
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
67
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
38
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
68
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
39
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
69
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
40
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
70
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
41
   by * none break 
71
   by * none break 
42
72
43
# Slave-Controller benoetigen den UMC-Container fuer die Berechtigungen an der Lehrerconsole
73
# Slave-Controller benoetigen den UMC-Container fuer die Berechtigungen an der Lehrerconsole
44
access to dn.subtree="cn=UMC,cn=univention,@%@ldap/base@%@"
74
access to dn.subtree="cn=UMC,cn=univention,@%@ldap/base@%@"
45
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
75
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
46
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
76
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
47
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
77
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
48
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
78
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
49
   by * none break 
79
   by * none break 
50
80
51
# grant write access to domaincontroller slave/member server for certain univention app center settings
81
# grant write access to domaincontroller slave/member server for certain univention app center settings
52
access to dn.regex="^univentionAppID=([^,]+),cn=([^,]+),cn=apps,cn=univention,@%@ldap/base@%@$" filter="(objectClass=univentionApp)"
82
access to dn.regex="^univentionAppID=([^,]+),cn=([^,]+),cn=apps,cn=univention,@%@ldap/base@%@$" filter="(objectClass=univentionApp)"
53
        by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
83
        by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
54
        by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
84
        by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
55
        by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
85
        by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
56
        by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
86
        by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
57
        by * none break
87
        by * none break
58
88
59
access to dn.regex="^cn=([^,]+),cn=apps,cn=univention,@%@ldap/base@%@$" attrs=children,entry
89
access to dn.regex="^cn=([^,]+),cn=apps,cn=univention,@%@ldap/base@%@$" attrs=children,entry
60
        by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
90
        by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
61
        by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
91
        by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
62
        by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
92
        by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
63
        by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
93
        by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
64
        by * none break
94
        by * none break
65
95
66
access to dn="cn=apps,cn=univention,@%@ldap/base@%@" attrs=children,entry
96
access to dn="cn=apps,cn=univention,@%@ldap/base@%@" attrs=children,entry
67
        by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
97
        by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
68
        by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
98
        by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
69
        by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
99
        by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
70
        by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
100
        by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
71
        by * none break
101
        by * none break
72
102
73
# grant read access to domaincontroller slave/member server for all other univention app center settings
103
# grant read access to domaincontroller slave/member server for all other univention app center settings
74
access to dn.subtree="cn=apps,cn=univention,@%@ldap/base@%@"
104
access to dn.subtree="cn=apps,cn=univention,@%@ldap/base@%@"
75
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
105
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
76
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
106
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
77
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
107
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
78
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
108
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
79
   by * none break 
109
   by * none break 
80
110
81
access to dn.subtree="cn=udm_module,cn=univention,@%@ldap/base@%@"
111
access to dn.subtree="cn=udm_module,cn=univention,@%@ldap/base@%@"
82
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
112
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
83
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
113
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
84
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
114
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
85
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
115
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
86
   by * none break 
116
   by * none break 
87
117
88
access to dn.subtree="cn=udm_hook,cn=univention,@%@ldap/base@%@"
118
access to dn.subtree="cn=udm_hook,cn=univention,@%@ldap/base@%@"
89
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
119
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
90
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
120
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
91
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
121
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
92
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
122
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
93
   by * none break 
123
   by * none break 
94
124
95
access to dn.subtree="cn=udm_syntax,cn=univention,@%@ldap/base@%@"
125
access to dn.subtree="cn=udm_syntax,cn=univention,@%@ldap/base@%@"
96
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
126
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
97
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
127
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
98
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
128
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
99
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
129
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
100
   by * none break 
130
   by * none break 
101
131
102
access to dn.subtree="cn=ldapacl,cn=univention,@%@ldap/base@%@"
132
access to dn.subtree="cn=ldapacl,cn=univention,@%@ldap/base@%@"
103
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
133
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
104
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
134
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
105
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
135
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
106
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
136
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
107
   by * none break 
137
   by * none break 
108
138
109
access to dn.subtree="cn=ldapschema,cn=univention,@%@ldap/base@%@"
139
access to dn.subtree="cn=ldapschema,cn=univention,@%@ldap/base@%@"
110
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
140
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
111
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
141
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
112
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
142
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
113
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
143
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
114
   by * none break 
144
   by * none break 
115
145
116
# Slave-Controller und Member-Server benoetigen idmap-Container
146
# Slave-Controller und Member-Server benoetigen idmap-Container
117
access to dn.base="cn=idmap,cn=univention,@%@ldap/base@%@"
147
access to dn.base="cn=idmap,cn=univention,@%@ldap/base@%@"
118
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
148
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
119
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
149
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
120
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
150
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
121
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
151
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
122
   by * none break 
152
   by * none break 
123
153
124
# Slave-Controller und Member-Server benoetigen ID-Mapping
154
# Slave-Controller und Member-Server benoetigen ID-Mapping
125
access to dn.subtree="cn=idmap,cn=univention,@%@ldap/base@%@" filter="(|(&(objectClass=sambaUnixIdPool)(objectClass=organizationalRole)(objectClass=top))(&(objectClass=sambaIdmapEntry)(objectClass=sambaSidEntry)))"
155
access to dn.subtree="cn=idmap,cn=univention,@%@ldap/base@%@" filter="(|(&(objectClass=sambaUnixIdPool)(objectClass=organizationalRole)(objectClass=top))(&(objectClass=sambaIdmapEntry)(objectClass=sambaSidEntry)))"
126
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
156
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
127
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
157
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
128
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
158
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
129
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
159
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
130
   by * none break
160
   by * none break
131
161
132
# Slave-Controller und Memberserver duerfen samba-Container und dessen Inhalt replizieren
162
# Slave-Controller und Memberserver duerfen samba-Container und dessen Inhalt replizieren
133
access to dn.subtree="cn=samba,@%@ldap/base@%@"
163
access to dn.subtree="cn=samba,@%@ldap/base@%@"
134
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
164
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
135
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
165
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
136
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
166
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
137
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
167
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
138
   by * none break
168
   by * none break
139
169
140
# Slave-Controller needs the builtin groups
170
# Slave-Controller needs the builtin groups
141
access to dn.subtree="cn=Builtin,@%@ldap/base@%@"
171
access to dn.subtree="cn=Builtin,@%@ldap/base@%@"
142
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
172
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
143
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
173
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
144
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
174
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
145
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
175
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
146
   by * none break 
176
   by * none break 
147
177
148
# sonst duerfen sie nichts aus cn=univention,BASEDN replizieren
178
# sonst duerfen sie nichts aus cn=univention,BASEDN replizieren
149
access to dn.subtree="cn=univention,@%@ldap/base@%@"
179
access to dn.subtree="cn=univention,@%@ldap/base@%@"
150
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
180
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
151
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
181
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
152
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
182
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
153
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
183
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
154
   by * none break
184
   by * none break
(-)ucs-test-ucsschool/90_ucsschool/78_ldap_acls_dump.oldconfig.65ucsschool (-79 / +81 lines)
 Lines 13-30    Link Here 
13
def replace_ucr_variables(template):
13
def replace_ucr_variables(template):
14
	variable_token = re.compile('@[$]@')
14
	variable_token = re.compile('@[$]@')
15
15
16
	dir_ucsschool = { }
16
	dir_ucsschool = {
17
	dir_ucsschool[ 'DISTRICT' ] = ''
17
		'DISTRICT':       'ou=[^,]+,' if configRegistry.is_true('ucsschool/ldap/district/enable') else '',
18
	if configRegistry.get('ucsschool/ldap/district/enable','no').lower() in ( 'yes', 'true', '1' ):
18
		'PUPILS':         configRegistry.get('ucsschool/ldap/default/container/pupils', 'schueler'),
19
		dir_ucsschool[ 'DISTRICT' ] = 'ou=[^,]+,'
19
		'TEACHERS':       configRegistry.get('ucsschool/ldap/default/container/teachers', 'lehrer'),
20
	dir_ucsschool[ 'PUPILS' ] =   configRegistry.get('ucsschool/ldap/default/container/pupils', 'schueler')
20
		'STAFF':          configRegistry.get('ucsschool/ldap/default/container/staff', 'mitarbeiter'),
21
	dir_ucsschool[ 'TEACHERS' ] = configRegistry.get('ucsschool/ldap/default/container/teachers', 'lehrer')
21
		'TEACHERS-STAFF': configRegistry.get('ucsschool/ldap/default/container/teachers-and-staff', 'lehrer und mitarbeiter'),
22
	dir_ucsschool[ 'STAFF' ] =	  configRegistry.get('ucsschool/ldap/default/container/staff', 'mitarbeiter')
22
		'ADMINS':         configRegistry.get('ucsschool/ldap/default/container/admins', 'admins'),
23
	dir_ucsschool[ 'TEACHERS-STAFF' ] = configRegistry.get('ucsschool/ldap/default/container/teachers-and-staff', 'lehrer und mitarbeiter')
23
		'GRPADMINS':      configRegistry.get('ucsschool/ldap/default/groupprefix/admins', 'admins-'),
24
	dir_ucsschool[ 'ADMINS' ] =	  configRegistry.get('ucsschool/ldap/default/container/admins', 'admins')
24
		'ROOMS':          configRegistry.get('ucsschool/ldap/default/container/rooms', 'raeume'),
25
	dir_ucsschool[ 'GRPADMINS' ] =	  configRegistry.get('ucsschool/ldap/default/groupprefix/admins', 'admins-')
25
		'ALL_ADM_DC': configRegistry.get('ucsschool/ldap/default/groupname/all-administrativ-dc', 'DC-Verwaltungsnetz'),
26
		'ALL_ADM_MEMBER': configRegistry.get('ucsschool/ldap/default/groupname/all-administrativ-member', 'Member-Verwaltungsnetz'),
27
		'ALL_EDU_DC': configRegistry.get('ucsschool/ldap/default/groupname/all-educational-dc', 'DC-Edukativnetz'),
28
		'ALL_EDU_MEMBER': configRegistry.get('ucsschool/ldap/default/groupname/all-educational-member', 'Member-Edukativnetz'),
29
	}
26
30
27
28
	while 1:
31
	while 1:
29
		i = variable_token.finditer(template)
32
		i = variable_token.finditer(template)
30
		try:
33
		try:
 Lines 39-53    Link Here 
39
	return template
42
	return template
40
43
41
44
42
45
if configRegistry.is_true('ucsschool/ldap/district/enable','no'):
43
if configRegistry.get('ucsschool/ldap/district/enable','no').lower() in ( 'yes', 'true', '1' ):
44
   aclset += """
46
   aclset += """
45
# DCs und Memberserver erhalten Lesezugriff auf das OU-Objekt selbst (im DISTRICT-Mode notwendig)
47
# DCs und Memberserver erhalten Lesezugriff auf das OU-Objekt selbst (im DISTRICT-Mode notwendig)
46
access to dn.regex="^ou=([^,]+),@%@ldap/base@%@$$"
48
access to dn.regex="^ou=([^,]+),@%@ldap/base@%@$$"
47
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
49
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
48
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
50
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
49
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
51
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
50
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
52
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
51
	by * none break
53
	by * none break
52
54
53
"""
55
"""
 Lines 61-88    Link Here 
61
63
62
# Slave controllers and memberservers require write access to virtual machine manager objects
64
# Slave controllers and memberservers require write access to virtual machine manager objects
63
access to dn.regex="^univentionVirtualMachineUUID=([^,]+),cn=Information,cn=Virtual Machine Manager,@%@ldap/base@%@" filter="(objectClass=univentionVirtualMachine)"
65
access to dn.regex="^univentionVirtualMachineUUID=([^,]+),cn=Information,cn=Virtual Machine Manager,@%@ldap/base@%@" filter="(objectClass=univentionVirtualMachine)"
64
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
66
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
65
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
67
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
66
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
68
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
67
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
69
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
68
	by dn.regex="^[^,]+,cn=dc,cn=computers,@%@ldap/base@%@$$" write
70
	by dn.regex="^[^,]+,cn=dc,cn=computers,@%@ldap/base@%@$$" write
69
	by dn.regex="^[^,]+,cn=memberserver,cn=computers,@%@ldap/base@%@$$" write
71
	by dn.regex="^[^,]+,cn=memberserver,cn=computers,@%@ldap/base@%@$$" write
70
	by * read break
72
	by * read break
71
73
72
access to dn.regex="^cn=([^,]+),cn=CloudConnection,cn=Virtual Machine Manager,@%@ldap/base@%@" filter="(objectClass=univentionVirtualMachineCloudConnection)"
74
access to dn.regex="^cn=([^,]+),cn=CloudConnection,cn=Virtual Machine Manager,@%@ldap/base@%@" filter="(objectClass=univentionVirtualMachineCloudConnection)"
73
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
75
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
74
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
76
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
75
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
77
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
76
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
78
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
77
	by dn.regex="^[^,]+,cn=dc,cn=computers,@%@ldap/base@%@$$" write
79
	by dn.regex="^[^,]+,cn=dc,cn=computers,@%@ldap/base@%@$$" write
78
	by dn.regex="^[^,]+,cn=memberserver,cn=computers,@%@ldap/base@%@$$" write
80
	by dn.regex="^[^,]+,cn=memberserver,cn=computers,@%@ldap/base@%@$$" write
79
	by * read break
81
	by * read break
80
82
81
access to dn="cn=(Information|CloudConnection),cn=Virtual Machine Manager,@%@ldap/base@%@" attrs=children,entry
83
access to dn="cn=(Information|CloudConnection),cn=Virtual Machine Manager,@%@ldap/base@%@" attrs=children,entry
82
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
84
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
83
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
85
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
84
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
86
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
85
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
87
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
86
	by dn.regex="^[^,]+,cn=dc,cn=computers,@%@ldap/base@%@$$" write
88
	by dn.regex="^[^,]+,cn=dc,cn=computers,@%@ldap/base@%@$$" write
87
	by dn.regex="^[^,]+,cn=memberserver,cn=computers,@%@ldap/base@%@$$" write
89
	by dn.regex="^[^,]+,cn=memberserver,cn=computers,@%@ldap/base@%@$$" write
88
	by * read break
90
	by * read break
 Lines 89-106    Link Here 
89
91
90
# Slave controller and memberservers may replicate the Virtual Machine Manager container
92
# Slave controller and memberservers may replicate the Virtual Machine Manager container
91
access to dn.subtree="cn=Virtual Machine Manager,@%@ldap/base@%@"
93
access to dn.subtree="cn=Virtual Machine Manager,@%@ldap/base@%@"
92
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
94
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
93
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
95
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
94
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
96
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
95
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
97
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
96
   by * read break
98
   by * read break
97
99
98
# Slave controller and memberservers may replicate the mail container
100
# Slave controller and memberservers may replicate the mail container
99
access to dn.subtree="cn=mail,@%@ldap/base@%@"
101
access to dn.subtree="cn=mail,@%@ldap/base@%@"
100
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
102
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
101
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
103
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
102
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
104
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
103
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
105
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
104
   by * read break
106
   by * read break
105
107
106
access to dn.regex="^@%@ldap/base@%@$$"
108
access to dn.regex="^@%@ldap/base@%@$$"
 Lines 109-142    Link Here 
109
111
110
# DC Slaves need write access to the members of the group Domain Computers
112
# DC Slaves need write access to the members of the group Domain Computers
111
access to dn.exact="cn=Domain Computers,cn=groups,@%@ldap/base@%@" attrs="uniqueMember,memberUid"
113
access to dn.exact="cn=Domain Computers,cn=groups,@%@ldap/base@%@" attrs="uniqueMember,memberUid"
112
    by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
114
    by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
113
    by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
115
    by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
114
    by * none break
116
    by * none break
115
117
116
# Slave-Controller und Memberserver duerfen globale Container computers, shares, dns, dhcp, kerberos und policies sowie Benutzer lesen
118
# Slave-Controller und Memberserver duerfen globale Container computers, shares, dns, dhcp, kerberos und policies sowie Benutzer lesen
117
access to dn.regex="(^(.+,)?cn=(groups|dns|dhcp|policies|computers|kerberos|shares),|^(uid=[^,]+,|)cn=users,|^)@%@ldap/base@%@$$"
119
access to dn.regex="(^(.+,)?cn=(groups|dns|dhcp|policies|computers|kerberos|shares),|^(uid=[^,]+,|)cn=users,|^)@%@ldap/base@%@$$"
118
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
120
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
119
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
121
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
120
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
122
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
121
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
123
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
122
	by * none break
124
	by * none break
123
125
124
# Slave DCs can read MS system container
126
# Slave DCs can read MS system container
125
access to dn.base="cn=system,@%@ldap/base@%@"
127
access to dn.base="cn=system,@%@ldap/base@%@"
126
    by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
128
    by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
127
    by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
129
    by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
128
    by * none break
130
    by * none break
129
131
130
# Slave DCs can read and write policy containers for MS GPOs and msPrintConnectionPolicy objects
132
# Slave DCs can read and write policy containers for MS GPOs and msPrintConnectionPolicy objects
131
access to dn.subtree="cn=policies,cn=system,@%@ldap/base@%@" filter="(|(objectClass=msGPOContainer)(objectClass=organizationalRole)(objectClass=msPrintConnectionPolicy))"
133
access to dn.subtree="cn=policies,cn=system,@%@ldap/base@%@" filter="(|(objectClass=msGPOContainer)(objectClass=organizationalRole)(objectClass=msPrintConnectionPolicy))"
132
    by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
134
    by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
133
    by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
135
    by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
134
    by * none break
136
    by * none break
135
137
136
# Slave DCs can read and write policy containers for MS WMI filter objects
138
# Slave DCs can read and write policy containers for MS WMI filter objects
137
access to dn.subtree="cn=WMIPolicy,cn=system,@%@ldap/base@%@" filter="(|(objectClass=msWMISom)(objectClass=organizationalRole))"
139
access to dn.subtree="cn=WMIPolicy,cn=system,@%@ldap/base@%@" filter="(|(objectClass=msWMISom)(objectClass=organizationalRole))"
138
    by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
140
    by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
139
    by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
141
    by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
140
    by * none break
142
    by * none break
141
143
142
# Lehrer, Mitarbeiter und OU-Admins duerfen Schueler-Passwoerter aendern
144
# Lehrer, Mitarbeiter und OU-Admins duerfen Schueler-Passwoerter aendern
 Lines 145-155    Link Here 
145
	by * none break
147
	by * none break
146
148
147
# Lehrer und ouadmins duerfen Raum-Gruppen anlegen und bearbeiten
149
# Lehrer und ouadmins duerfen Raum-Gruppen anlegen und bearbeiten
148
access to dn.regex="^cn=raeume,cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" attrs=children,entry
150
access to dn.regex="^cn=@$@ROOMS@$@,cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" attrs=children,entry
149
	by dn.regex="^uid=([^,]+),cn=(@$@TEACHERS@$@|@$@TEACHERS-STAFF@$@|@$@STAFF@$@|@$@ADMINS@$@),cn=users,ou=$1,@$@DISTRICT@$@@%@ldap/base@%@$$" write
151
	by dn.regex="^uid=([^,]+),cn=(@$@TEACHERS@$@|@$@TEACHERS-STAFF@$@|@$@STAFF@$@|@$@ADMINS@$@),cn=users,ou=$1,@$@DISTRICT@$@@%@ldap/base@%@$$" write
150
	by * none break
152
	by * none break
151
153
152
access to dn.regex="^cn=([^,]+),cn=raeume,cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" filter="(&(!(|(uidNumber=*)(objectClass=SambaSamAccount)))(objectClass=univentionGroup))"
154
access to dn.regex="^cn=([^,]+),cn=@$@ROOMS@$@,cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" filter="(&(!(|(uidNumber=*)(objectClass=SambaSamAccount)))(objectClass=univentionGroup))"
153
	by dn.regex="^uid=([^,]+),cn=(@$@TEACHERS@$@|@$@TEACHERS-STAFF@$@|@$@STAFF@$@|@$@ADMINS@$@),cn=users,ou=$2,@$@DISTRICT@$@@%@ldap/base@%@$$" write
155
	by dn.regex="^uid=([^,]+),cn=(@$@TEACHERS@$@|@$@TEACHERS-STAFF@$@|@$@STAFF@$@|@$@ADMINS@$@),cn=users,ou=$2,@$@DISTRICT@$@@%@ldap/base@%@$$" write
154
	by * none break
156
	by * none break
155
157
 Lines 224-263    Link Here 
224
226
225
# domaincontroller slaves and memberservers of management group are not allowed to replicate pupils and teachers
227
# domaincontroller slaves and memberservers of management group are not allowed to replicate pupils and teachers
226
access to dn.regex="^.+,cn=(@$@TEACHERS@$@|@$@PUPILS@$@),cn=users,ou=[^,]+,@$@DISTRICT@$@@%@ldap/base@%@$$"
228
access to dn.regex="^.+,cn=(@$@TEACHERS@$@|@$@PUPILS@$@),cn=users,ou=[^,]+,@$@DISTRICT@$@@%@ldap/base@%@$$"
227
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
229
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
228
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
230
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
229
	by * none break
231
	by * none break
230
232
231
# domaincontroller slaves and memberservers of educational group are not allowed to replicate staff users
233
# domaincontroller slaves and memberservers of educational group are not allowed to replicate staff users
232
access to dn.regex="^.+,cn=@$@STAFF@$@,cn=users,ou=[^,]+,@$@DISTRICT@$@@%@ldap/base@%@$$"
234
access to dn.regex="^.+,cn=@$@STAFF@$@,cn=users,ou=[^,]+,@$@DISTRICT@$@@%@ldap/base@%@$$"
233
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
235
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
234
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
236
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
235
	by * none break
237
	by * none break
236
238
237
# domaincontroller slaves and memberservers may replicate the OU "domain controllers"
239
# domaincontroller slaves and memberservers may replicate the OU "domain controllers"
238
access to dn.subtree="ou=domain controllers,@%@ldap/base@%@"
240
access to dn.subtree="ou=domain controllers,@%@ldap/base@%@"
239
   by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
241
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
240
   by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
242
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
241
   by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
243
   by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
242
   by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
244
   by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
243
   by * read break
245
   by * read break
244
246
245
# Memberserver duerfen bestimmte Attribute lesen
247
# Memberserver duerfen bestimmte Attribute lesen
246
access to dn.regex="^(.+,)?ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" attrs=userPassword,krb5Key,krb5KDCFlags,sambaNTPassword,sambaLMPassword,shadowLastChange,sambaPwdLastSet,pwhistory,krb5KeyVersionNumber,univentionWindowsReinstall,sambaPwdCanChange,sambaPwdMustChange
248
access to dn.regex="^(.+,)?ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" attrs=userPassword,krb5Key,krb5KDCFlags,sambaNTPassword,sambaLMPassword,shadowLastChange,sambaPwdLastSet,pwhistory,krb5KeyVersionNumber,univentionWindowsReinstall,sambaPwdCanChange,sambaPwdMustChange
247
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
249
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
248
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
250
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
249
	by * none break
251
	by * none break
250
252
251
# Slave-Controller duerfen Eintraege Ihrer ou lesen und schreiben (Passwortaenderungen etc.)
253
# Slave-Controller duerfen Eintraege Ihrer ou lesen und schreiben (Passwortaenderungen etc.)
252
# Lehrer und Memberserver duerfen sie lesen, ou-eigene bekommen Standard-ACLs, ou-fremde Server/user duerfen nichts
254
# Lehrer und Memberserver duerfen sie lesen, ou-eigene bekommen Standard-ACLs, ou-fremde Server/user duerfen nichts
253
access to dn.regex="^(.+,)?ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$"
255
access to dn.regex="^(.+,)?ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$"
254
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
256
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
255
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
257
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
256
    by group/univentionLDAPACL/univentionLDAPAccessWrite.expand="ou=$2,@$@DISTRICT@$@@%@ldap/base@%@" write
258
    by group/univentionLDAPACL/univentionLDAPAccessWrite.expand="ou=$2,@$@DISTRICT@$@@%@ldap/base@%@" write
257
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
259
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
258
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
260
	by group/univentionGroup/uniqueMember.expand="cn=OU$2-@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
259
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
261
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
260
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
262
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
261
    by dn.regex="^uid=([^,]+),cn=(@$@TEACHERS@$@|@$@TEACHERS-STAFF@$@|@$@STAFF@$@|@$@ADMINS@$@),cn=users,ou=$2,@$@DISTRICT@$@@%@ldap/base@%@$$" read
263
    by dn.regex="^uid=([^,]+),cn=(@$@TEACHERS@$@|@$@TEACHERS-STAFF@$@|@$@STAFF@$@|@$@ADMINS@$@),cn=users,ou=$2,@$@DISTRICT@$@@%@ldap/base@%@$$" read
262
    by dn.regex="^uid=(.+,)?cn=users,ou=$2,@$@DISTRICT@$@@%@ldap/base@%@$$" none break
264
    by dn.regex="^uid=(.+,)?cn=users,ou=$2,@$@DISTRICT@$@@%@ldap/base@%@$$" none break
263
    by dn.regex="^uid=(.+,)?ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" none
265
    by dn.regex="^uid=(.+,)?ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" none
 Lines 265-285    Link Here 
265
267
266
# Slave-Controller duerfen Klassen-Gruppen bearbeiten (AUSNAHME! Wird fuer Lehrerzuordnung in UMC benoetigt!)
268
# Slave-Controller duerfen Klassen-Gruppen bearbeiten (AUSNAHME! Wird fuer Lehrerzuordnung in UMC benoetigt!)
267
access to dn.regex="^cn=klassen,cn=@$@PUPILS@$@,cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" attrs=children,entry
269
access to dn.regex="^cn=klassen,cn=@$@PUPILS@$@,cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" attrs=children,entry
268
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
270
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
269
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
271
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
270
	by * none break
272
	by * none break
271
273
272
access to dn.regex="^cn=([^,]+),cn=klassen,cn=@$@PUPILS@$@,cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" filter="(&(!(|(uidNumber=*)(objectClass=SambaSamAccount)))(objectClass=univentionGroup))"
274
access to dn.regex="^cn=([^,]+),cn=klassen,cn=@$@PUPILS@$@,cn=groups,ou=([^,]+),@$@DISTRICT@$@@%@ldap/base@%@$$" filter="(&(!(|(uidNumber=*)(objectClass=SambaSamAccount)))(objectClass=univentionGroup))"
273
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
275
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
274
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
276
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" write
275
	by * none break
277
	by * none break
276
278
277
# Slave-Controller duerfen nagios-Container und Inhalt replizieren
279
# Slave-Controller duerfen nagios-Container und Inhalt replizieren
278
access to dn.subtree="cn=nagios,@%@ldap/base@%@"
280
access to dn.subtree="cn=nagios,@%@ldap/base@%@"
279
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
281
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
280
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
282
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
281
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
283
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
282
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
284
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" read
283
	by * none break
285
	by * none break
284
286
285
# Schüler, Lehrer, Mitarbeiter, Admins duerfen globale Container univention, policies, groups und dns lesen 
287
# Schüler, Lehrer, Mitarbeiter, Admins duerfen globale Container univention, policies, groups und dns lesen 
 Lines 290-299    Link Here 
290
292
291
# Slave-Controller und normale Lehrer duerfen sonst nichts lesen, Schueler sowieso nicht
293
# Slave-Controller und normale Lehrer duerfen sonst nichts lesen, Schueler sowieso nicht
292
access to *
294
access to *
293
	by group/univentionGroup/uniqueMember="cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
295
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
294
	by group/univentionGroup/uniqueMember="cn=DC-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
296
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_DC@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
295
	by group/univentionGroup/uniqueMember="cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
297
	by group/univentionGroup/uniqueMember="cn=@$@ALL_ADM_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
296
	by group/univentionGroup/uniqueMember="cn=Member-Edukativnetz,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
298
	by group/univentionGroup/uniqueMember="cn=@$@ALL_EDU_MEMBER@$@,cn=ucsschool,cn=groups,@%@ldap/base@%@" none
297
	by * none break
299
	by * none break
298
300
299
"""
301
"""
(-)ucs-test-ucsschool/90_ucsschool/80_move_users_into_another_ou (-17 / +15 lines)
 Lines 5-10    Link Here 
5
## bugs: [40870, 41601, 41609, 41620]
5
## bugs: [40870, 41601, 41609, 41620]
6
## exposure: dangerous
6
## exposure: dangerous
7
7
8
import os.path
8
from univention.testing.ucsschool import UCSTestSchool
9
from univention.testing.ucsschool import UCSTestSchool
9
from univention.testing.ucr import UCSTestConfigRegistry
10
from univention.testing.ucr import UCSTestConfigRegistry
10
from univention.testing.udm import UCSTestUDM
11
from univention.testing.udm import UCSTestUDM
 Lines 31-65    Link Here 
31
		# TODO: change school and uid at once!
32
		# TODO: change school and uid at once!
32
		# TODO: user without classes
33
		# TODO: user without classes
33
34
34
		base = ucr['ldap/base']
35
		search_base = User.get_search_base(b)
35
		domain_users_school = 'cn=Domain Users %s,cn=groups,ou=%s,%s' % (b, b, base)
36
		domain_users_school = 'cn=Domain Users {},{}'.format(b, search_base.groups)
36
		teacher_group = 'cn=lehrer-%s,cn=groups,ou=%s,%s' % (b, b, base)
37
		teacher_group = search_base.teachers_ou_group
37
		staff_group = 'cn=mitarbeiter-%s,cn=groups,ou=%s,%s' % (b, b, base)
38
		staff_group = search_base.staff_ou_group
38
		students_group = 'cn=schueler-%s,cn=groups,ou=%s,%s' % (b, b, base)
39
		students_group = search_base.students_ou_group
39
		grp1_name = uts.random_username()
40
		grp1_name = uts.random_username()
40
		grp2_name = uts.random_username()
41
		grp2_name = uts.random_username()
41
		two_klasses = '{0}-{1},{0}-{2}'.format(a, grp1_name, grp2_name)
42
		two_klasses = '{0}-{1},{0}-{2}'.format(a, grp1_name, grp2_name)
42
		workgroup_dn, workgroup_name = udm.create_group(position='cn=schueler,cn=groups,%s' % (a_dn,))
43
		workgroup_dn, workgroup_name = udm.create_group(position=WorkGroup.get_container(a))
43
		global_group_dn, global_group_name = udm.create_group()
44
		global_group_dn, global_group_name = udm.create_group()
44
45
46
		search_base = User.get_search_base(a)
45
		users = [
47
		users = [
46
			(env.create_user(a, classes=two_klasses), 'schueler',
48
			(env.create_user(a, classes=two_klasses), [students_group, domain_users_school, global_group_dn]),
47
				[students_group, domain_users_school, global_group_dn]),
49
			(env.create_user(a, is_teacher=True, classes=two_klasses), [domain_users_school, teacher_group, global_group_dn]),
48
			(env.create_user(a, is_teacher=True, classes=two_klasses), 'lehrer',
50
			(env.create_user(a, is_staff=True), [domain_users_school, staff_group, global_group_dn]),
49
				[domain_users_school, teacher_group, global_group_dn]),
51
			(env.create_user(a, is_teacher=True, is_staff=True, classes=two_klasses), [domain_users_school, teacher_group, staff_group, global_group_dn]),
50
			(env.create_user(a, is_staff=True), 'mitarbeiter',
51
				[domain_users_school, staff_group, global_group_dn]),
52
			(env.create_user(a, is_teacher=True, is_staff=True, classes=two_klasses), 'lehrer',
53
				[domain_users_school, teacher_group, staff_group, global_group_dn]),
54
		]
52
		]
55
		lo = env.open_ldap_connection()
53
		lo = env.open_ldap_connection()
56
		workgroup = WorkGroup.from_dn(workgroup_dn, a, lo)
54
		workgroup = WorkGroup.from_dn(workgroup_dn, a, lo)
57
		users_dns = [dn for (user, dn,), roleshare_path, groups in users]
55
		users_dns = [dn for (user, dn,), groups in users]
58
		udm.modify_object('groups/group', dn=global_group_dn, append={'users': users_dns})
56
		udm.modify_object('groups/group', dn=global_group_dn, append={'users': users_dns})
59
		workgroup.users.extend(users_dns)
57
		workgroup.users.extend(users_dns)
60
		workgroup.modify(lo)
58
		workgroup.modify(lo)
61
59
62
		for (user, dn,), roleshare_path, groups in users:
60
		for (user, dn,), groups in users:
63
61
64
			print '################################'
62
			print '################################'
65
			print '#### moving user at', dn, 'to', b
63
			print '#### moving user at', dn, 'to', b
 Lines 67-73    Link Here 
67
65
68
			user = User.from_dn(dn, a, lo)
66
			user = User.from_dn(dn, a, lo)
69
			attrs = {
67
			attrs = {
70
				'homeDirectory': ['/home/%s/%s/%s' % (b, roleshare_path, user.name)],
68
				'homeDirectory': [os.path.join('/home/', user.get_roleshare_home_subdir(), user.name)],
71
				'ucsschoolSchool': [b],
69
				'ucsschoolSchool': [b],
72
				'departmentNumber': [b],
70
				'departmentNumber': [b],
73
				# TODO: add sambaHomeDrive sambaHomePath sambaLogonScript sambaProfilePath
71
				# TODO: add sambaHomeDrive sambaHomePath sambaLogonScript sambaProfilePath
(-)ucs-test-ucsschool/90_ucsschool/98_samba4_evaluate_windows_gpo (-2 / +2 lines)
 Lines 26-32    Link Here 
26
26
27
from datetime import datetime, timedelta
27
from datetime import datetime, timedelta
28
from ucsschool.lib.schoolldap import SchoolSearchBase
28
from ucsschool.lib.schoolldap import SchoolSearchBase
29
from ucsschool.lib.models import School
29
from ucsschool.lib.models import School, SchoolClass
30
from essential.computerroom import Room
30
from essential.computerroom import Room
31
from essential.exam import Exam
31
from essential.exam import Exam
32
32
 Lines 566-572    Link Here 
566
	klasse_dn = udm.create_object(
566
	klasse_dn = udm.create_object(
567
		'groups/group',
567
		'groups/group',
568
		name=schoolclassname,
568
		name=schoolclassname,
569
		position="cn=klassen,cn=schueler,cn=groups,%s" % school_dn
569
		position=SchoolClass.get_container(school)
570
		)
570
		)
571
571
572
	student_pwd = "univention"
572
	student_pwd = "univention"
(-)ucs-test-ucsschool/90_ucsschool/essential/acl.py (-3 / +5 lines)
 Lines 13-18    Link Here 
13
import univention.testing.ucr as ucr_test
13
import univention.testing.ucr as ucr_test
14
import univention.testing.ucsschool as utu
14
import univention.testing.ucsschool as utu
15
import univention.testing.strings as uts
15
import univention.testing.strings as uts
16
from ucsschool.lib.models import ComputerRoom, School
16
17
17
18
18
class FailAcl(Exception):
19
class FailAcl(Exception):
 Lines 122-127    Link Here 
122
		self.access_allowance = access_allowance
123
		self.access_allowance = access_allowance
123
		self.ucr = ucr_test.UCSTestConfigRegistry()
124
		self.ucr = ucr_test.UCSTestConfigRegistry()
124
		self.ucr.load()
125
		self.ucr.load()
126
		self.search_base = School.get_search_base(self.school)
125
127
126
	def assert_acl(self, target_dn, access, attrs, access_allowance=None):
128
	def assert_acl(self, target_dn, access, attrs, access_allowance=None):
127
		"""Test ACL rule:\n
129
		"""Test ACL rule:\n
 Lines 203-209    Link Here 
203
	def assert_room(self, room_dn, access):
205
	def assert_room(self, room_dn, access):
204
		"""Lehrer und ouadmins duerfen Raum-Gruppen anlegen und bearbeiten
206
		"""Lehrer und ouadmins duerfen Raum-Gruppen anlegen und bearbeiten
205
		"""
207
		"""
206
		target_dn = 'cn=raeume,cn=groups,%s' % utu.UCSTestSchool().get_ou_base_dn(self.school)
208
		target_dn = ComputerRoom.get_container(self.school)
207
		attrs = [
209
		attrs = [
208
			'children',
210
			'children',
209
			'entry',
211
			'entry',
 Lines 230-236    Link Here 
230
		"""Lehrer, Mitarbeiter und Mitglieder der lokalen Administratoren
232
		"""Lehrer, Mitarbeiter und Mitglieder der lokalen Administratoren
231
		duerfen Arbeitsgruppen anlegen und aendern
233
		duerfen Arbeitsgruppen anlegen und aendern
232
		"""
234
		"""
233
		group_dn = 'cn=lehrer,cn=groups,%s' % utu.UCSTestSchool().get_ou_base_dn(self.school)
235
		group_dn = self.search_base.teachers_group
234
		attrs = [
236
		attrs = [
235
			'children',
237
			'children',
236
			'entry',
238
			'entry',
 Lines 260-266    Link Here 
260
		self.assert_acl(group_dn, access, attrs)
262
		self.assert_acl(group_dn, access, attrs)
261
263
262
	def assert_student_group(self, access):
264
	def assert_student_group(self, access):
263
		group_dn = 'cn=schueler,cn=groups,%s' % utu.UCSTestSchool().get_ou_base_dn(self.school)
265
		group_dn = self.search_base.students_group
264
		attrs = [
266
		attrs = [
265
			'children',
267
			'children',
266
			'entry',
268
			'entry',
(-)ucs-test-ucsschool/90_ucsschool/essential/computerroom.py (-12 / +16 lines)
 Lines 7-12    Link Here 
7
from ucsschool.lib.models import IPComputer as IPComputerLib
7
from ucsschool.lib.models import IPComputer as IPComputerLib
8
from ucsschool.lib.models import MacComputer as MacComputerLib
8
from ucsschool.lib.models import MacComputer as MacComputerLib
9
from ucsschool.lib.models import WindowsComputer as WindowsComputerLib
9
from ucsschool.lib.models import WindowsComputer as WindowsComputerLib
10
from ucsschool.lib.models import School as SchoolLib
11
from ucsschool.lib.models import ComputerRoom as ComputerRoomLib
10
from univention.testing.ucsschool import UMCConnection
12
from univention.testing.ucsschool import UMCConnection
11
import copy
13
import copy
12
import datetime
14
import datetime
 Lines 92-101    Link Here 
92
	def __init__(self, school, name=None, dn=None, description=None, host_members=None):
94
	def __init__(self, school, name=None, dn=None, description=None, host_members=None):
93
		self.school = school
95
		self.school = school
94
		self.name = name if name else uts.random_name()
96
		self.name = name if name else uts.random_name()
95
		self.dn = dn if dn else 'cn=%s-%s,cn=raeume,cn=groups,%s' % (
97
		self.dn = dn if dn else ComputerRoomLib(school=school, name='{}-{}'.format(school, self.name)).dn
96
			school, self.name, utu.UCSTestSchool().get_ou_base_dn(school))
97
		self.description = description if description else uts.random_name()
98
		self.description = description if description else uts.random_name()
98
		self.host_members = host_members or []
99
		self.host_members = host_members or []
100
		self.marktplatz_name = SchoolLib.get_search_base(self.school).share_name_marktplatz
99
101
100
	def get_room_user(self, umc_connection):
102
	def get_room_user(self, umc_connection):
101
		print 'Executing command: computerroom/rooms in school:', self.school
103
		print 'Executing command: computerroom/rooms in school:', self.school
 Lines 286-320    Link Here 
286
			utils.fail('Write to home directory result (%r), expected (%r)' % (write[0], expected_result))
288
			utils.fail('Write to home directory result (%r), expected (%r)' % (write[0], expected_result))
287
289
288
	def check_marktplatz_read(self, user, ip_address, passwd='univention', expected_result=0):
290
	def check_marktplatz_read(self, user, ip_address, passwd='univention', expected_result=0):
289
		print '.... Check Marktplatz read ....'
291
		print '.... Check Marktplatz ({}) read ....'.format(self.marktplatz_name)
290
		cmd_read_marktplatz = ['smbclient', '//%(ip)s/Marktplatz', '-U', '%(user)s', '-c', 'dir']
292
		cmd_read_marktplatz = ['smbclient', '//%(ip)s/%(marktplatz_name)s', '-U', '%(user)s', '-c', 'dir']
291
		read = run_commands(
293
		read = run_commands(
292
			[cmd_read_marktplatz],
294
			[cmd_read_marktplatz],
293
			{
295
			{
294
				'ip': ip_address,
296
				'ip': ip_address,
295
				'user': '{0}%{1}'.format(user, passwd)
297
				'user': '{0}%{1}'.format(user, passwd),
298
				'marktplatz_name': self.marktplatz_name
296
			}
299
			}
297
		)
300
		)
298
		if read[0] != expected_result:
301
		if read[0] != expected_result:
299
			print 'FAIL .. Read Marktplatz directory result (%r), expected (%r)' % (read[0], expected_result)
302
			print 'FAIL .. Read Marktplatz (%s) directory result (%r), expected (%r)' % (self.marktplatz_name, read[0], expected_result)
300
			utils.fail('Read Marktplatz directory result (%r), expected (%r)' % (read[0], expected_result))
303
			utils.fail('Read Marktplatz (%s) directory result (%r), expected (%r)' % (self.marktplatz_name, read[0], expected_result))
301
304
302
	def check_marktplatz_write(self, user, ip_address, passwd='univention', expected_result=0):
305
	def check_marktplatz_write(self, user, ip_address, passwd='univention', expected_result=0):
303
		print '.... Check Marktplatz write ....'
306
		print '.... Check Marktplatz ({}) write ....'.format(self.marktplatz_name)
304
		f = tempfile.NamedTemporaryFile(dir='/tmp')
307
		f = tempfile.NamedTemporaryFile(dir='/tmp')
305
		cmd_write_marktplatz = ['smbclient', '//%(ip)s/Marktplatz', '-U', '%(user)s', '-c', 'put %(filename)s']
308
		cmd_write_marktplatz = ['smbclient', '//%(ip)s/%(marktplatz_name)s', '-U', '%(user)s', '-c', 'put %(filename)s']
306
		write = run_commands(
309
		write = run_commands(
307
			[cmd_write_marktplatz],
310
			[cmd_write_marktplatz],
308
			{
311
			{
309
				'ip': ip_address,
312
				'ip': ip_address,
310
				'user': '{0}%{1}'.format(user, passwd),
313
				'user': '{0}%{1}'.format(user, passwd),
311
				'filename': '%s %s' % (f.name, f.name.split('/')[-1])
314
				'filename': '%s %s' % (f.name, f.name.split('/')[-1]),
315
				'marktplatz_name': self.marktplatz_name
312
			}
316
			}
313
		)
317
		)
314
		f.close()
318
		f.close()
315
		if write[0] != expected_result:
319
		if write[0] != expected_result:
316
			print 'FAIL .. Write to Marktplatz directory result (%r), expected (%r)' % (write[0], expected_result)
320
			print 'FAIL .. Write to Marktplatz (%s) directory result (%r), expected (%r)' % (self.marktplatz_name, write[0], expected_result)
317
			utils.fail('Write to Marktplatz directory result (%r), expected (%r)' % (write[0], expected_result))
321
			utils.fail('Write to Marktplatz (%s) directory result (%r), expected (%r)' % (self.marktplatz_name, write[0], expected_result))
318
322
319
	def check_share_access(self, user, ip_address, expected_home_result, expected_marktplatz_result):
323
	def check_share_access(self, user, ip_address, expected_home_result, expected_marktplatz_result):
320
		self.check_home_read(user, ip_address, expected_result=expected_home_result)
324
		self.check_home_read(user, ip_address, expected_result=expected_home_result)
(-)ucs-test-ucsschool/90_ucsschool/essential/distribution.py (-4 / +13 lines)
 Lines 14-19    Link Here 
14
import univention.testing.strings as uts
14
import univention.testing.strings as uts
15
import univention.testing.ucr as ucr_test
15
import univention.testing.ucr as ucr_test
16
import univention.testing.utils as utils
16
import univention.testing.utils as utils
17
from ucsschool.lib.models import School
17
18
18
19
19
class Distribution(object):
20
class Distribution(object):
 Lines 608-631    Link Here 
608
		path = ''
609
		path = ''
609
		self.ucr.load()
610
		self.ucr.load()
610
		roleshare = self.ucr.get('ucsschool/import/roleshare')
611
		roleshare = self.ucr.get('ucsschool/import/roleshare')
612
		collect_from = self.ucr.get('ucsschool/datadistribution/datadir/sender', 'Unterrichtsmaterial')
613
		distribute_to = self.ucr.get('ucsschool/datadistribution/datadir/recipient', 'Unterrichtsmaterial')
614
		search_base = School.get_search_base(self.school)
611
		if purpose == 'distribute':
615
		if purpose == 'distribute':
612
			if roleshare == 'no' or roleshare is False:
616
			if roleshare == 'no' or roleshare is False:
613
				path = '/home/{0}/Unterrichtsmaterial/{1}/'.format(user, self.name)
617
				path = '/home/{}/{}/{}/'.format(user, distribute_to, self.name)
614
			else:
618
			else:
615
				path = '/home/{0}/schueler/{1}/Unterrichtsmaterial/{2}'.format(
619
				path = '/home/{}/{}/{}/{}/{}'.format(
616
					self.school,
620
					self.school,
621
					search_base.share_name_pupils,
617
					user,
622
					user,
623
					distribute_to,
618
					self.name)
624
					self.name)
619
		elif purpose == 'collect':
625
		elif purpose == 'collect':
620
			if roleshare == 'no' or roleshare is False:
626
			if roleshare == 'no' or roleshare is False:
621
				path = '/home/{0}/Unterrichtsmaterial/{1}/{2}/'.format(
627
				path = '/home/{}/{}/{}/{}/'.format(
622
						self.sender,
628
						self.sender,
629
						collect_from,
623
						self.name,
630
						self.name,
624
						user)
631
						user)
625
			else:
632
			else:
626
				path = '/home/{0}/lehrer/{1}/Unterrichtsmaterial/{2}/{3}'.format(
633
				path = '/home/{}/{}/{}/{}/{}/{}'.format(
627
					self.school,
634
					self.school,
635
					search_base.share_name_teachers,
628
					self.sender,
636
					self.sender,
637
					collect_from,
629
					self.name,
638
					self.name,
630
					user)
639
					user)
631
		return path
640
		return path
(-)ucs-test-ucsschool/90_ucsschool/essential/exam.py (-2 / +4 lines)
 Lines 17-22    Link Here 
17
import univention.testing.strings as uts
17
import univention.testing.strings as uts
18
import univention.testing.ucr as ucr_test
18
import univention.testing.ucr as ucr_test
19
import univention.testing.utils as utils
19
import univention.testing.utils as utils
20
from ucsschool.lib.models import School
20
21
21
22
22
class StartFail(Exception):
23
class StartFail(Exception):
 Lines 122-127    Link Here 
122
		self.shareMode = shareMode
123
		self.shareMode = shareMode
123
		self.internetRule = internetRule
124
		self.internetRule = internetRule
124
		self.customRule = customRule
125
		self.customRule = customRule
126
		self.search_base = School.get_search_base(self.school)
125
127
126
		if umcConnection:
128
		if umcConnection:
127
			self.umcConnection = umcConnection
129
			self.umcConnection = umcConnection
 Lines 291-297    Link Here 
291
	def check_collect(self):
293
	def check_collect(self):
292
		account = utils.UCSTestDomainAdminCredentials()
294
		account = utils.UCSTestDomainAdminCredentials()
293
		admin = account.username
295
		admin = account.username
294
		path = '/home/%s/Klassenarbeiten/%s' % (admin, self.name)
296
		path = '/home/%s/%s/%s' % (admin, self.search_base.share_name_exams, self.name)
295
		path_files = get_dir_files(path)
297
		path_files = get_dir_files(path)
296
		if not set(self.files).issubset(set(path_files)):
298
		if not set(self.files).issubset(set(path_files)):
297
			utils.fail('%r were not collected to %r' % (self.files, path))
299
			utils.fail('%r were not collected to %r' % (self.files, path))
 Lines 303-309    Link Here 
303
			utils.fail('%r were not uploaded to %r' % (self.files, path))
305
			utils.fail('%r were not uploaded to %r' % (self.files, path))
304
306
305
	def check_distribute(self):
307
	def check_distribute(self):
306
		path = '/home/%s/schueler' % self.school
308
		path = '/home/%s/%s' % (self.school, self.search_base.share_name_pupils)
307
		path_files = get_dir_files(path)
309
		path_files = get_dir_files(path)
308
		if not set(self.files).issubset(set(path_files)):
310
		if not set(self.files).issubset(set(path_files)):
309
			utils.fail('%r were not uploaded to %r' % (self.files, path))
311
			utils.fail('%r were not uploaded to %r' % (self.files, path))
(-)ucs-test-ucsschool/90_ucsschool/essential/importcomputers.py (-5 / +5 lines)
 Lines 144-154    Link Here 
144
		print 'verify computer: %s' % self.name
144
		print 'verify computer: %s' % self.name
145
145
146
		utils.verify_ldap_object(self.dn, expected_attr=self.expected_attributes(), should_exist=True)
146
		utils.verify_ldap_object(self.dn, expected_attr=self.expected_attributes(), should_exist=True)
147
147
		search_base = SchoolLib.get_search_base(self.school)
148
		verwaltung_member_group1 = 'cn=OU%s-Member-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % (self.school, configRegistry.get('ldap/base'))
148
		verwaltung_member_group1 = search_base.administrative_ou_member_group
149
		verwaltung_member_group2 = 'cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % (configRegistry.get('ldap/base'))
149
		verwaltung_member_group2 = search_base.administrative_member_group
150
		edukativ_member_group1 = 'cn=OU%s-Member-Edukativnetz,cn=ucsschool,cn=groups,%s' % (self.school, configRegistry.get('ldap/base'))
150
		edukativ_member_group1 = search_base.educational_ou_member_group
151
		edukativ_member_group2 = 'cn=Member-Edukativnetz,cn=ucsschool,cn=groups,%s' % (configRegistry.get('ldap/base'))
151
		edukativ_member_group2 = search_base.educational_member_group
152
		if self.zone == 'verwaltung':
152
		if self.zone == 'verwaltung':
153
			utils.verify_ldap_object(verwaltung_member_group1, expected_attr={'uniqueMember': [self.dn]}, strict=False, should_exist=True)
153
			utils.verify_ldap_object(verwaltung_member_group1, expected_attr={'uniqueMember': [self.dn]}, strict=False, should_exist=True)
154
			utils.verify_ldap_object(verwaltung_member_group2, expected_attr={'uniqueMember': [self.dn]}, strict=False, should_exist=True)
154
			utils.verify_ldap_object(verwaltung_member_group2, expected_attr={'uniqueMember': [self.dn]}, strict=False, should_exist=True)
(-)ucs-test-ucsschool/90_ucsschool/essential/importgroups.py (-4 / +3 lines)
 Lines 8-13    Link Here 
8
import univention.testing.strings as uts
8
import univention.testing.strings as uts
9
from ucsschool.lib.models import SchoolClass as GroupLib
9
from ucsschool.lib.models import SchoolClass as GroupLib
10
from ucsschool.lib.models import School as SchoolLib
10
from ucsschool.lib.models import School as SchoolLib
11
from ucsschool.lib.models import ClassShare as ClassShareLib
11
import ucsschool.lib.models.utils
12
import ucsschool.lib.models.utils
12
13
13
from essential.importou import remove_ou, get_school_base
14
from essential.importou import remove_ou, get_school_base
 Lines 26-34    Link Here 
26
configRegistry = univention.config_registry.ConfigRegistry()
27
configRegistry = univention.config_registry.ConfigRegistry()
27
configRegistry.load()
28
configRegistry.load()
28
29
29
cn_pupils = configRegistry.get('ucsschool/ldap/default/container/pupils', 'schueler')
30
30
31
32
class Group:
31
class Group:
33
32
34
	def __init__(self, school):
33
	def __init__(self, school):
 Lines 39-46    Link Here 
39
38
40
		self.school_base = get_school_base(self.school)
39
		self.school_base = get_school_base(self.school)
41
40
42
		self.dn = 'cn=%s,cn=klassen,cn=%s,cn=groups,%s' % (self.name, cn_pupils, self.school_base)
41
		self.dn = GroupLib(school=self.school, name=self.name).dn
43
		self.share_dn = 'cn=%s,cn=klassen,cn=shares,%s' % (self.name, self.school_base)
42
		self.share_dn = ClassShareLib(school=self.school, name=self.name).dn
44
43
45
	def set_mode_to_modify(self):
44
	def set_mode_to_modify(self):
46
		self.mode = 'M'
45
		self.mode = 'M'
(-)ucs-test-ucsschool/90_ucsschool/essential/importou.py (-59 / +57 lines)
 Lines 11-16    Link Here 
11
import random
11
import random
12
import subprocess
12
import subprocess
13
import string
13
import string
14
import ldap
14
import univention.admin.modules
15
import univention.admin.modules
15
import univention.admin.filter
16
import univention.admin.filter
16
univention.admin.modules.update()
17
univention.admin.modules.update()
 Lines 299-310    Link Here 
299
	old_dhcpd_ldap_base = ucr.get('dhcpd/ldap/base')
300
	old_dhcpd_ldap_base = ucr.get('dhcpd/ldap/base')
300
	lo = univention.uldap.getMachineConnection()
301
	lo = univention.uldap.getMachineConnection()
301
	base_dn = ucr.get('ldap/base')
302
	base_dn = ucr.get('ldap/base')
303
	search_base = School.get_search_base(ou)
302
304
303
	cn_pupils = ucr.get('ucsschool/ldap/default/container/pupils', 'schueler')
305
	cn_pupils = ldap.explode_dn(search_base.students, True)[0]
304
	cn_teachers = ucr.get('ucsschool/ldap/default/container/teachers', 'lehrer')
306
	cn_teachers = ldap.explode_dn(search_base.teachers, True)[0]
305
	cn_teachers_staff = ucr.get('ucsschool/ldap/default/container/teachers-and-staff', 'lehrer und mitarbeiter')
307
	cn_teachers_staff = ldap.explode_dn(search_base.teachersAndStaff, True)[0]
306
	cn_admins = ucr.get('ucsschool/ldap/default/container/admins', 'admins')
308
	cn_admins = ldap.explode_dn(search_base.admins, True)[0]
307
	cn_staff = ucr.get('ucsschool/ldap/default/container/staff', 'mitarbeiter')
309
	cn_staff = ldap.explode_dn(search_base.staff, True)[0]
310
	cn_class = ldap.explode_dn(search_base.classes, True)[0]
311
	cn_rooms = ldap.explode_dn(search_base.rooms, True)[0]
308
312
309
	singlemaster = ucr.is_true('ucsschool/singlemaster')
313
	singlemaster = ucr.is_true('ucsschool/singlemaster')
310
	noneducational_create_objects = ucr.is_true('ucsschool/ldap/noneducational/create/objects')
314
	noneducational_create_objects = ucr.is_true('ucsschool/ldap/noneducational/create/objects')
 Lines 332-374    Link Here 
332
336
333
	utils.verify_ldap_object(ou_base, expected_attr={'ou': [ou], 'ucsschoolClassShareFileServer': [sharefileserver_dn], 'ucsschoolHomeShareFileServer': [sharefileserver_dn]}, should_exist=must_exist)
337
	utils.verify_ldap_object(ou_base, expected_attr={'ou': [ou], 'ucsschoolClassShareFileServer': [sharefileserver_dn], 'ucsschoolHomeShareFileServer': [sharefileserver_dn]}, should_exist=must_exist)
334
338
335
	utils.verify_ldap_object('cn=printers,%s' % ou_base, expected_attr={'cn': ['printers']}, should_exist=must_exist)
339
	utils.verify_ldap_object(search_base.printers, expected_attr={'cn': ['printers']}, should_exist=must_exist)
336
	utils.verify_ldap_object('cn=users,%s' % ou_base, expected_attr={'cn': ['users']}, should_exist=must_exist)
340
	utils.verify_ldap_object(search_base.users, expected_attr={'cn': ['users']}, should_exist=must_exist)
337
	utils.verify_ldap_object('cn=%s,cn=users,%s' % (cn_pupils, ou_base), expected_attr={'cn': [cn_pupils]}, should_exist=must_exist)
341
	utils.verify_ldap_object(search_base.students, expected_attr={'cn': [cn_pupils]}, should_exist=must_exist)
338
	utils.verify_ldap_object('cn=%s,cn=users,%s' % (cn_teachers, ou_base), expected_attr={'cn': [cn_teachers]}, should_exist=must_exist)
342
	utils.verify_ldap_object(search_base.teachers, expected_attr={'cn': [cn_teachers]}, should_exist=must_exist)
339
	utils.verify_ldap_object('cn=%s,cn=users,%s' % (cn_admins, ou_base), expected_attr={'cn': [cn_admins]}, should_exist=must_exist)
343
	utils.verify_ldap_object(search_base.admins, expected_attr={'cn': [cn_admins]}, should_exist=must_exist)
340
	utils.verify_ldap_object('cn=%s,cn=users,%s' % (cn_admins, ou_base), expected_attr={'cn': [cn_admins]}, should_exist=must_exist)
341
344
342
	utils.verify_ldap_object('cn=computers,%s' % ou_base, expected_attr={'cn': ['computers']}, should_exist=must_exist)
345
	utils.verify_ldap_object(search_base.computers, expected_attr={'cn': ['computers']}, should_exist=must_exist)
343
	utils.verify_ldap_object('cn=server,cn=computers,%s' % ou_base, expected_attr={'cn': ['server']}, should_exist=must_exist)
346
	utils.verify_ldap_object('cn=server,cn=computers,%s' % ou_base, expected_attr={'cn': ['server']}, should_exist=must_exist)
344
	utils.verify_ldap_object('cn=dc,cn=server,cn=computers,%s' % ou_base, expected_attr={'cn': ['dc']}, should_exist=must_exist)
347
	utils.verify_ldap_object('cn=dc,cn=server,cn=computers,%s' % ou_base, expected_attr={'cn': ['dc']}, should_exist=must_exist)
345
	utils.verify_ldap_object('cn=networks,%s' % ou_base, expected_attr={'cn': ['networks']}, should_exist=must_exist)
348
	utils.verify_ldap_object(search_base.networks, expected_attr={'cn': ['networks']}, should_exist=must_exist)
346
	utils.verify_ldap_object('cn=groups,%s' % ou_base, expected_attr={'cn': ['groups']}, should_exist=must_exist)
349
	utils.verify_ldap_object(search_base.groups, expected_attr={'cn': ['groups']}, should_exist=must_exist)
347
	utils.verify_ldap_object('cn=%s,cn=groups,%s' % (cn_pupils, ou_base), expected_attr={'cn': [cn_pupils]}, should_exist=must_exist)
350
	utils.verify_ldap_object(search_base.workgroups, expected_attr={'cn': [cn_pupils]}, should_exist=must_exist)
348
	utils.verify_ldap_object('cn=%s,cn=groups,%s' % (cn_teachers, ou_base), expected_attr={'cn': [cn_teachers]}, should_exist=must_exist)
351
	utils.verify_ldap_object(search_base.teachers_group, expected_attr={'cn': [cn_teachers]}, should_exist=must_exist)
349
	utils.verify_ldap_object('cn=klassen,cn=%s,cn=groups,%s' % (cn_pupils, ou_base), expected_attr={'cn': ['klassen']}, should_exist=must_exist)
352
	utils.verify_ldap_object(search_base.classes, expected_attr={'cn': [cn_class]}, should_exist=must_exist)
350
	utils.verify_ldap_object('cn=raeume,cn=groups,%s' % ou_base, expected_attr={'cn': ['raeume']}, should_exist=must_exist)
353
	utils.verify_ldap_object(search_base.rooms, expected_attr={'cn': [cn_rooms]}, should_exist=must_exist)
351
354
352
	utils.verify_ldap_object('cn=dhcp,%s' % ou_base, expected_attr={'cn': ['dhcp']}, should_exist=must_exist)
355
	utils.verify_ldap_object(search_base.dhcp, expected_attr={'cn': ['dhcp']}, should_exist=must_exist)
353
	utils.verify_ldap_object('cn=policies,%s' % ou_base, expected_attr={'cn': ['policies']}, should_exist=must_exist)
356
	utils.verify_ldap_object(search_base.policies, expected_attr={'cn': ['policies']}, should_exist=must_exist)
354
	utils.verify_ldap_object('cn=shares,%s' % ou_base, expected_attr={'cn': ['shares']}, should_exist=must_exist)
357
	utils.verify_ldap_object(search_base.shares, expected_attr={'cn': ['shares']}, should_exist=must_exist)
355
	utils.verify_ldap_object('cn=klassen,cn=shares,%s' % ou_base, expected_attr={'cn': ['klassen']}, should_exist=must_exist)
358
	utils.verify_ldap_object(search_base.classShares, expected_attr={'cn': [cn_class]}, should_exist=must_exist)
356
	utils.verify_ldap_object('cn=dc,cn=server,cn=computers,%s' % ou_base, expected_attr={'cn': ['dc']}, should_exist=must_exist)
359
	utils.verify_ldap_object('cn=dc,cn=server,cn=computers,%s' % ou_base, expected_attr={'cn': ['dc']}, should_exist=must_exist)
357
360
358
	if noneducational_create_objects:
361
	if noneducational_create_objects:
359
		utils.verify_ldap_object('cn=%s,cn=users,%s' % (cn_staff, ou_base), should_exist=must_exist)
362
		utils.verify_ldap_object(search_base.staff, should_exist=must_exist)
360
		utils.verify_ldap_object('cn=%s,cn=users,%s' % (cn_teachers_staff, ou_base), should_exist=must_exist)
363
		utils.verify_ldap_object(search_base.teachersAndStaff, should_exist=must_exist)
361
		utils.verify_ldap_object('cn=%s,cn=groups,%s' % (cn_staff, ou_base), should_exist=must_exist)
364
		utils.verify_ldap_object(search_base.staff_group, should_exist=must_exist)
362
	else:
365
	else:
363
		utils.verify_ldap_object('cn=%s,cn=users,%s' % (cn_staff, ou_base), should_exist=False)
366
		utils.verify_ldap_object(search_base.staff, should_exist=False)
364
		utils.verify_ldap_object('cn=%s,cn=users,%s' % (cn_teachers_staff, ou_base), should_exist=False)
367
		utils.verify_ldap_object(search_base.teachersAndStaff, should_exist=False)
365
		utils.verify_ldap_object('cn=%s,cn=groups,%s' % (cn_staff, ou_base), should_exist=False)
368
		utils.verify_ldap_object(search_base.staff_group, should_exist=False)
366
369
367
	if noneducational_create_objects:
370
	if noneducational_create_objects:
368
		utils.verify_ldap_object('cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % base_dn, should_exist=True)
371
		utils.verify_ldap_object(search_base.administrative_dc_group, should_exist=True)
369
		utils.verify_ldap_object('cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % base_dn, should_exist=True)
372
		utils.verify_ldap_object(search_base.administrative_member_group, should_exist=True)
370
		utils.verify_ldap_object('cn=OU%s-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % (ou, base_dn), should_exist=True)
373
		utils.verify_ldap_object(search_base.administrative_ou_dc_group)
371
		utils.verify_ldap_object('cn=OU%s-Member-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % (ou, base_dn), should_exist=True)
374
		utils.verify_ldap_object(search_base.administrative_ou_member_group)
372
	# This will fail because we don't cleanup these groups in cleanup_ou
375
	# This will fail because we don't cleanup these groups in cleanup_ou
373
	#else:
376
	#else:
374
	#	utils.verify_ldap_object("cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s" % base_dn, should_exist=False)
377
	#	utils.verify_ldap_object("cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s" % base_dn, should_exist=False)
 Lines 382-403    Link Here 
382
	if dc_administrative:
385
	if dc_administrative:
383
		verify_dc(ou, dc_administrative, TYPE_DC_ADMINISTRATIVE, base_dn, must_exist)
386
		verify_dc(ou, dc_administrative, TYPE_DC_ADMINISTRATIVE, base_dn, must_exist)
384
387
385
	grp_prefix_pupils = ucr.get('ucsschool/ldap/default/groupprefix/pupils', 'schueler-')
386
	grp_prefix_teachers = ucr.get('ucsschool/ldap/default/groupprefix/teachers', 'lehrer-')
387
	grp_prefix_admins = ucr.get('ucsschool/ldap/default/groupprefix/admins', 'admins-')
388
	grp_prefix_staff = ucr.get('ucsschool/ldap/default/groupprefix/staff', 'mitarbeiter-')
389
390
	grp_policy_pupils = ucr.get('ucsschool/ldap/default/policy/umc/pupils', 'cn=ucsschool-umc-pupils-default,cn=UMC,cn=policies,%s' % base_dn)
388
	grp_policy_pupils = ucr.get('ucsschool/ldap/default/policy/umc/pupils', 'cn=ucsschool-umc-pupils-default,cn=UMC,cn=policies,%s' % base_dn)
391
	grp_policy_teachers = ucr.get('ucsschool/ldap/default/policy/umc/teachers', 'cn=ucsschool-umc-teachers-default,cn=UMC,cn=policies,%s' % base_dn)
389
	grp_policy_teachers = ucr.get('ucsschool/ldap/default/policy/umc/teachers', 'cn=ucsschool-umc-teachers-default,cn=UMC,cn=policies,%s' % base_dn)
392
	grp_policy_admins = ucr.get('ucsschool/ldap/default/policy/umc/admins', 'cn=ucsschool-umc-admins-default,cn=UMC,cn=policies,%s' % base_dn)
390
	grp_policy_admins = ucr.get('ucsschool/ldap/default/policy/umc/admins', 'cn=ucsschool-umc-admins-default,cn=UMC,cn=policies,%s' % base_dn)
393
	grp_policy_staff = ucr.get('ucsschool/ldap/default/policy/umc/staff', 'cn=ucsschool-umc-staff-default,cn=UMC,cn=policies,%s' % base_dn)
391
	grp_policy_staff = ucr.get('ucsschool/ldap/default/policy/umc/staff', 'cn=ucsschool-umc-staff-default,cn=UMC,cn=policies,%s' % base_dn)
394
392
395
	utils.verify_ldap_object("cn=%s%s,cn=ouadmins,cn=groups,%s" % (grp_prefix_admins, ou, base_dn), expected_attr={'univentionPolicyReference': [grp_policy_admins]}, should_exist=True)
393
	utils.verify_ldap_object(search_base.admin_group, expected_attr={'univentionPolicyReference': [grp_policy_admins]}, should_exist=True)
396
	utils.verify_ldap_object("cn=%s%s,cn=groups,%s" % (grp_prefix_pupils, ou, ou_base), expected_attr={'univentionPolicyReference': [grp_policy_pupils]}, should_exist=must_exist)
394
	utils.verify_ldap_object(search_base.students_ou_group, expected_attr={'univentionPolicyReference': [grp_policy_pupils]}, should_exist=must_exist)
397
	utils.verify_ldap_object("cn=%s%s,cn=groups,%s" % (grp_prefix_teachers, ou, ou_base), expected_attr={'univentionPolicyReference': [grp_policy_teachers]}, should_exist=must_exist)
395
	utils.verify_ldap_object(search_base.teachers_ou_group, expected_attr={'univentionPolicyReference': [grp_policy_teachers]}, should_exist=must_exist)
398
396
399
	if noneducational_create_objects:
397
	if noneducational_create_objects:
400
		utils.verify_ldap_object("cn=%s%s,cn=groups,%s" % (grp_prefix_staff, ou, ou_base), expected_attr={'univentionPolicyReference': [grp_policy_staff]}, should_exist=must_exist)
398
		utils.verify_ldap_object(search_base.staff_ou_group, expected_attr={'univentionPolicyReference': [grp_policy_staff]}, should_exist=must_exist)
401
399
402
	dcmaster_module = univention.admin.modules.get("computers/domaincontroller_master")
400
	dcmaster_module = univention.admin.modules.get("computers/domaincontroller_master")
403
	dcbackup_module = univention.admin.modules.get("computers/domaincontroller_backup")
401
	dcbackup_module = univention.admin.modules.get("computers/domaincontroller_backup")
 Lines 413-420    Link Here 
413
	# check group membership
411
	# check group membership
414
	#  slave should be member
412
	#  slave should be member
415
	#  master and backup should not be member
413
	#  master and backup should not be member
416
	dcgroups = ["cn=OU%s-DC-Edukativnetz,cn=ucsschool,cn=groups,%s" % (ou, base_dn),
414
	dcgroups = [search_base.educational_ou_dc_group, search_base.educational_dc_group]
417
				"cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%s" % (base_dn)]
418
415
419
	if must_exist:
416
	if must_exist:
420
		if masterobjs:
417
		if masterobjs:
 Lines 490-522    Link Here 
490
		base_dn = ucr.get('ldap/base')
487
		base_dn = ucr.get('ldap/base')
491
	ou_base = get_ou_base(ou, ucr.is_true('ucsschool/ldap/district/enable', False))
488
	ou_base = get_ou_base(ou, ucr.is_true('ucsschool/ldap/district/enable', False))
492
	dc_dn = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name, ou_base)
489
	dc_dn = 'cn=%s,cn=dc,cn=server,cn=computers,%s' % (dc_name, ou_base)
490
	search_base = School.get_search_base(ou)
493
491
494
	# define list of (un-)desired group memberships ==> [(IS_MEMBER, GROUP_DN), ...]
492
	# define list of (un-)desired group memberships ==> [(IS_MEMBER, GROUP_DN), ...]
495
	group_dn_list = []
493
	group_dn_list = []
496
	if dc_type == TYPE_DC_ADMINISTRATIVE:
494
	if dc_type == TYPE_DC_ADMINISTRATIVE:
497
		group_dn_list += [
495
		group_dn_list += [
498
			(True, 'cn=OU%s-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % (ou.lower(), base_dn)),
496
			(True, search_base.administrative_ou_dc_group),
499
			(True, 'cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % (base_dn, )),
497
			(True, search_base.administrative_dc_group),
500
			(False, 'cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % base_dn),
498
			(False, search_base.administrative_member_group),
501
			(False, 'cn=OU%s-Member-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % (ou, base_dn)),
499
			(False, search_base.administrative_ou_member_group),
502
			(False, 'cn=OU%s-DC-Edukativnetz,cn=ucsschool,cn=groups,%s' % (ou.lower(), base_dn)),
500
			(False, search_base.educational_ou_dc_group),
503
			(False, 'cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%s' % (base_dn, )),
501
			(False, search_base.educational_dc_group),
504
			(False, 'cn=Member-Edukativnetz,cn=ucsschool,cn=groups,%s' % base_dn),
502
			(False, search_base.educational_member_group),
505
			(False, 'cn=OU%s-Member-Edukativnetz,cn=ucsschool,cn=groups,%s' % (ou, base_dn)),
503
			(False, search_base.educational_ou_member_group),
506
		]
504
		]
507
	else:
505
	else:
508
		group_dn_list += [
506
		group_dn_list += [
509
			(True, 'cn=OU%s-DC-Edukativnetz,cn=ucsschool,cn=groups,%s' % (ou.lower(), base_dn)),
507
			(True, search_base.educational_ou_dc_group),
510
			(True, 'cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%s' % (base_dn, )),
508
			(True, search_base.educational_dc_group),
511
			(False, 'cn=Member-Edukativnetz,cn=ucsschool,cn=groups,%s' % base_dn),
509
			(False, search_base.educational_member_group),
512
			(False, 'cn=OU%s-Member-Edukativnetz,cn=ucsschool,cn=groups,%s' % (ou, base_dn)),
510
			(False, search_base.educational_ou_member_group),
513
		]
511
		]
514
		if ucr.is_true('ucsschool/ldap/noneducational/create/objects', must_exist):
512
		if ucr.is_true('ucsschool/ldap/noneducational/create/objects', must_exist):
515
			group_dn_list += [
513
			group_dn_list += [
516
				(False, 'cn=OU%s-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % (ou.lower(), base_dn)),
514
				(False, search_base.administrative_ou_dc_group),
517
				(False, 'cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % (base_dn, )),
515
				(False, search_base.administrative_dc_group),
518
				(False, 'cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % base_dn),
516
				(False, search_base.administrative_member_group),
519
				(False, 'cn=OU%s-Member-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % (ou, base_dn)),
517
				(False, search_base.administrative_ou_member_group),
520
			]
518
			]
521
519
522
	utils.verify_ldap_object(dc_dn, should_exist=must_exist)
520
	utils.verify_ldap_object(dc_dn, should_exist=must_exist)
(-)ucs-test-ucsschool/90_ucsschool/essential/importusers.py (-32 / +17 lines)
 Lines 13-18    Link Here 
13
from univention.testing.decorators import SetTimeout
13
from univention.testing.decorators import SetTimeout
14
import univention.uldap
14
import univention.uldap
15
import univention.config_registry
15
import univention.config_registry
16
from ucsschool.lib.models import SchoolClass as SchoolClassLib
16
from ucsschool.lib.models import Student as StudentLib
17
from ucsschool.lib.models import Student as StudentLib
17
from ucsschool.lib.models import Teacher as TeacherLib
18
from ucsschool.lib.models import Teacher as TeacherLib
18
from ucsschool.lib.models import Staff as StaffLib
19
from ucsschool.lib.models import Staff as StaffLib
 Lines 38-54    Link Here 
38
configRegistry = univention.config_registry.ConfigRegistry()
39
configRegistry = univention.config_registry.ConfigRegistry()
39
configRegistry.load()
40
configRegistry.load()
40
41
41
cn_pupils = configRegistry.get('ucsschool/ldap/default/container/pupils', 'schueler')
42
cn_teachers = configRegistry.get('ucsschool/ldap/default/container/teachers', 'lehrer')
43
cn_teachers_staff = configRegistry.get('ucsschool/ldap/default/container/teachers-and-staff', 'lehrer und mitarbeiter')
44
cn_staff = configRegistry.get('ucsschool/ldap/default/container/staff', 'mitarbeiter')
45
42
46
grp_prefix_pupils = configRegistry.get('ucsschool/ldap/default/groupprefix/pupils', 'schueler-')
47
grp_prefix_teachers = configRegistry.get('ucsschool/ldap/default/groupprefix/teachers', 'lehrer-')
48
grp_prefix_admins = configRegistry.get('ucsschool/ldap/default/groupprefix/admins', 'admins-')
49
grp_prefix_staff = configRegistry.get('ucsschool/ldap/default/groupprefix/staff', 'mitarbeiter-')
50
51
52
class Person(object):
43
class Person(object):
53
44
54
	def __init__(self, school, role):
45
	def __init__(self, school, role):
 Lines 57-62    Link Here 
57
		self.username = uts.random_name()
48
		self.username = uts.random_name()
58
		self.school = school
49
		self.school = school
59
		self.schools = [school]
50
		self.schools = [school]
51
		self.search_base = SchoolLib.get_search_base(self.school)
60
		self.role = role
52
		self.role = role
61
		self.record_uid = None
53
		self.record_uid = None
62
		self.source_uid = None
54
		self.source_uid = None
 Lines 64-80    Link Here 
64
		self.mail = '%s@%s' % (self.username, configRegistry.get('domainname'))
56
		self.mail = '%s@%s' % (self.username, configRegistry.get('domainname'))
65
		self.school_classes = {}
57
		self.school_classes = {}
66
		if self.is_student():
58
		if self.is_student():
67
			self.cn = cn_pupils
59
			self.user_type = StudentLib
68
			self.grp_prefix = grp_prefix_pupils
60
			self.role_group_dn = self.search_base.students_ou_group
69
		elif self.is_teacher():
61
		elif self.is_teacher():
70
			self.cn = cn_teachers
62
			self.user_type = TeacherLib
71
			self.grp_prefix = grp_prefix_teachers
63
			self.role_group_dn = self.search_base.teachers_ou_group
72
		elif self.is_teacher_staff():
64
		elif self.is_teacher_staff():
73
			self.cn = cn_teachers_staff
65
			self.user_type = TeachersAndStaffLib
74
			self.grp_prefix = grp_prefix_teachers
66
			self.role_group_dn = self.search_base.teachers_ou_group
75
		elif self.is_staff():
67
		elif self.is_staff():
76
			self.cn = cn_staff
68
			self.user_type = StaffLib
77
			self.grp_prefix = grp_prefix_staff
69
			self.role_group_dn = self.search_base.staff_ou_group
78
		self.mode = 'A'
70
		self.mode = 'A'
79
		self.active = True
71
		self.active = True
80
		self.password = None
72
		self.password = None
 Lines 83-89    Link Here 
83
		self.append_random_groups()
75
		self.append_random_groups()
84
76
85
	def make_dn(self):
77
	def make_dn(self):
86
		return 'uid=%s,cn=%s,cn=users,%s' % (self.username, self.cn, self.school_base)
78
		return self.user_type(school=self.school, name=self.username).dn
87
79
88
	def make_school_base(self):
80
	def make_school_base(self):
89
		return get_school_base(self.school)
81
		return get_school_base(self.school)
 Lines 242-258    Link Here 
242
		if self.description:
234
		if self.description:
243
			attr['description'] = [self.description]
235
			attr['description'] = [self.description]
244
236
245
		subdir = ''
246
		if configRegistry.is_true('ucsschool/import/roleshare', True):
237
		if configRegistry.is_true('ucsschool/import/roleshare', True):
247
			if self.is_student():
238
			subdir = self.user_type(school=self.school, name=self.username).get_roleshare_home_subdir()
248
				subdir = os.path.join(self.school, 'schueler')
239
		else:
249
			elif self.is_teacher():
240
			subdir = ''
250
				subdir = os.path.join(self.school, 'lehrer')
241
		attr['homeDirectory'] = [os.path.join('/home', subdir, self.username)]
251
			elif self.is_teacher_staff():
252
				subdir = os.path.join(self.school, 'lehrer')
253
			elif self.is_staff():
254
				subdir = os.path.join(self.school, 'mitarbeiter')
255
		attr['homeDirectory'] = ['/home/%s' % os.path.join(subdir, self.username)]
256
242
257
		if self.is_active():
243
		if self.is_active():
258
			attr['krb5KDCFlags'] = ['126']
244
			attr['krb5KDCFlags'] = ['126']
 Lines 332-342    Link Here 
332
318
333
		for school, classes in self.school_classes.iteritems():
319
		for school, classes in self.school_classes.iteritems():
334
			for cl in classes:
320
			for cl in classes:
335
				cl_group_dn = 'cn=%s,cn=klassen,cn=%s,cn=groups,%s' % (cl, cn_pupils, get_school_base(school))
321
				cl_group_dn = SchoolClassLib(school=school, name=cl).dn
336
				utils.verify_ldap_object(cl_group_dn, expected_attr={'uniqueMember': [self.dn], 'memberUid': [self.username]}, strict=False, should_exist=True)
322
				utils.verify_ldap_object(cl_group_dn, expected_attr={'uniqueMember': [self.dn], 'memberUid': [self.username]}, strict=False, should_exist=True)
337
323
338
		role_group_dn = 'cn=%s%s,cn=groups,%s' % (self.grp_prefix, self.school, self.school_base)
324
		utils.verify_ldap_object(self.role_group_dn, expected_attr={'uniqueMember': [self.dn], 'memberUid': [self.username]}, strict=False, should_exist=True)
339
		utils.verify_ldap_object(role_group_dn, expected_attr={'uniqueMember': [self.dn], 'memberUid': [self.username]}, strict=False, should_exist=True)
340
		print 'person OK: %s' % self.username
325
		print 'person OK: %s' % self.username
341
326
342
327
(-)ucs-test-ucsschool/90_ucsschool/essential/internetrule.py (-2 / +2 lines)
 Lines 16-21    Link Here 
16
import univention.testing.utils as utils
16
import univention.testing.utils as utils
17
from univention.testing.ucsschool import UCSTestSchool
17
from univention.testing.ucsschool import UCSTestSchool
18
import univention.testing.ucsschool as utu
18
import univention.testing.ucsschool as utu
19
from ucsschool.lib.models import SchoolClass as SchoolClassLib
19
20
20
21
21
class InternetRule(object):
22
class InternetRule(object):
 Lines 240-247    Link Here 
240
			ucsschool = UCSTestSchool()
241
			ucsschool = UCSTestSchool()
241
			groupdn = ucsschool.get_workinggroup_dn(school, groupName)
242
			groupdn = ucsschool.get_workinggroup_dn(school, groupName)
242
		elif groupType == 'class':
243
		elif groupType == 'class':
243
			groupdn = 'cn=%s-%s,cn=klassen,cn=schueler,cn=groups,%s' % (
244
			groupdn = SchoolClassLib(school=schoolenv.name, name="{}-{}".format(school, groupName)).dn
244
				school, groupName, school_basedn)
245
245
246
		if default:
246
		if default:
247
			name = '$default$'
247
			name = '$default$'
(-)ucs-test-ucsschool/90_ucsschool/essential/klasse.py (-3 / +2 lines)
 Lines 9-14    Link Here 
9
from univention.testing.ucsschool import UMCConnection
9
from univention.testing.ucsschool import UMCConnection
10
import univention.testing.ucr as ucr_test
10
import univention.testing.ucr as ucr_test
11
from univention.testing.ucsschool import UCSTestSchool
11
from univention.testing.ucsschool import UCSTestSchool
12
from ucsschool.lib.models import SchoolClass as SchoolClassLib
12
13
13
14
14
class GetFail(Exception):
15
class GetFail(Exception):
 Lines 138-146    Link Here 
138
					k, classes_names))
139
					k, classes_names))
139
140
140
	def dn(self):
141
	def dn(self):
141
		return 'cn=%s-%s,cn=klassen,cn=schueler,cn=groups,%s' % (
142
		return SchoolClassLib(school=self.school, name="{}-{}".format(self.school, self.name)).dn
142
			self.school, self.name, UCSTestSchool().get_ou_base_dn(self.school)
143
		)
144
143
145
	def get(self):
144
	def get(self):
146
		"""Get class"""
145
		"""Get class"""
(-)ucs-test-ucsschool/90_ucsschool/essential/school.py (-45 / +44 lines)
 Lines 4-9    Link Here 
4
4
5
.. moduleauthor:: Ammar Najjar <najjar@univention.de>
5
.. moduleauthor:: Ammar Najjar <najjar@univention.de>
6
"""
6
"""
7
import ldap
7
from essential.importcomputers import random_ip
8
from essential.importcomputers import random_ip
8
from essential.importou import DCNotFound, DCMembership, DhcpdLDAPBase, TYPE_DC_ADMINISTRATIVE
9
from essential.importou import DCNotFound, DCMembership, DhcpdLDAPBase, TYPE_DC_ADMINISTRATIVE
9
from essential.importou import get_ou_base, verify_dc, get_school_ou_from_dn, TYPE_DC_EDUCATIONAL
10
from essential.importou import get_ou_base, verify_dc, get_school_ou_from_dn, TYPE_DC_EDUCATIONAL
 Lines 13-18    Link Here 
13
import univention.testing.ucr as ucr_test
14
import univention.testing.ucr as ucr_test
14
import univention.testing.utils as utils
15
import univention.testing.utils as utils
15
import univention.uldap
16
import univention.uldap
17
from ucsschool.lib.models import (School as LibSchool, ComputerRoom as LibComputerRoom, SchoolClass as LibSchoolClass,
18
	Staff as LibStaff, TeachersAndStaff as LibTeachersAndStaff, Teacher as LibTeacher, Student as LibStudent)
16
19
17
20
18
class GetFail(Exception):
21
class GetFail(Exception):
 Lines 190-196    Link Here 
190
				k, names))
193
				k, names))
191
194
192
	def dn(self):
195
	def dn(self):
193
		 return UCSTestSchool().get_ou_base_dn(self.name)
196
		return UCSTestSchool().get_ou_base_dn(self.name)
194
197
195
	def remove(self):
198
	def remove(self):
196
		"""Remove school"""
199
		"""Remove school"""
 Lines 278-289    Link Here 
278
		old_dhcpd_ldap_base = ucr.get('dhcpd/ldap/base')
281
		old_dhcpd_ldap_base = ucr.get('dhcpd/ldap/base')
279
		lo = univention.uldap.getMachineConnection()
282
		lo = univention.uldap.getMachineConnection()
280
		base_dn = ucr.get('ldap/base')
283
		base_dn = ucr.get('ldap/base')
284
		search_base = LibSchool.get_search_base(ou)
281
285
282
		cn_pupils = ucr.get('ucsschool/ldap/default/container/pupils', 'schueler')
286
		cn_pupils = ldap.explode_dn(LibStudent.get_container(ou), True)[0]
283
		cn_teachers = ucr.get('ucsschool/ldap/default/container/teachers', 'lehrer')
287
		cn_teachers = ldap.explode_dn(LibTeacher.get_container(ou), True)[0]
284
		cn_teachers_staff = ucr.get('ucsschool/ldap/default/container/teachers-and-staff', 'lehrer und mitarbeiter')
288
		cn_teachers_staff = ldap.explode_dn(LibTeachersAndStaff.get_container(ou), True)[0]
285
		cn_admins = ucr.get('ucsschool/ldap/default/container/admins', 'admins')
289
		cn_admins = ldap.explode_dn(search_base.admins, True)[0]
286
		cn_staff = ucr.get('ucsschool/ldap/default/container/staff', 'mitarbeiter')
290
		cn_staff = ldap.explode_dn(LibStaff.get_container(ou), True)[0]
291
		cn_class = ldap.explode_dn(LibSchoolClass.get_container(ou), True)[0]
292
		cn_rooms = ldap.explode_dn(LibComputerRoom.get_container(ou), True)[0]
287
293
288
		singlemaster = ucr.is_true('ucsschool/singlemaster')
294
		singlemaster = ucr.is_true('ucsschool/singlemaster')
289
		noneducational_create_objects = ucr.is_true('ucsschool/ldap/noneducational/create/objects')
295
		noneducational_create_objects = ucr.is_true('ucsschool/ldap/noneducational/create/objects')
 Lines 317-359    Link Here 
317
323
318
		utils.verify_ldap_object(ou_base, expected_attr={'ou': [ou], 'ucsschoolClassShareFileServer': [classsharefileserver_dn], 'ucsschoolHomeShareFileServer': [homesharefileserver_dn]}, should_exist=must_exist)
324
		utils.verify_ldap_object(ou_base, expected_attr={'ou': [ou], 'ucsschoolClassShareFileServer': [classsharefileserver_dn], 'ucsschoolHomeShareFileServer': [homesharefileserver_dn]}, should_exist=must_exist)
319
325
320
		utils.verify_ldap_object('cn=printers,%s' % ou_base, expected_attr={'cn': ['printers']}, should_exist=must_exist)
326
		utils.verify_ldap_object(search_base.printers, expected_attr={'cn': ['printers']}, should_exist=must_exist)
321
		utils.verify_ldap_object('cn=users,%s' % ou_base, expected_attr={'cn': ['users']}, should_exist=must_exist)
327
		utils.verify_ldap_object(search_base.users, expected_attr={'cn': ['users']}, should_exist=must_exist)
322
		utils.verify_ldap_object('cn=%s,cn=users,%s' % (cn_pupils, ou_base), expected_attr={'cn': [cn_pupils]}, should_exist=must_exist)
328
		utils.verify_ldap_object(search_base.students, expected_attr={'cn': [cn_pupils]}, should_exist=must_exist)
323
		utils.verify_ldap_object('cn=%s,cn=users,%s' % (cn_teachers, ou_base), expected_attr={'cn': [cn_teachers]}, should_exist=must_exist)
329
		utils.verify_ldap_object(search_base.teachers, expected_attr={'cn': [cn_teachers]}, should_exist=must_exist)
324
		utils.verify_ldap_object('cn=%s,cn=users,%s' % (cn_admins, ou_base), expected_attr={'cn': [cn_admins]}, should_exist=must_exist)
330
		utils.verify_ldap_object(search_base.admins, expected_attr={'cn': [cn_admins]}, should_exist=must_exist)
325
		utils.verify_ldap_object('cn=%s,cn=users,%s' % (cn_admins, ou_base), expected_attr={'cn': [cn_admins]}, should_exist=must_exist)
326
331
327
		utils.verify_ldap_object('cn=computers,%s' % ou_base, expected_attr={'cn': ['computers']}, should_exist=must_exist)
332
		utils.verify_ldap_object(search_base.computers, expected_attr={'cn': ['computers']}, should_exist=must_exist)
328
		utils.verify_ldap_object('cn=server,cn=computers,%s' % ou_base, expected_attr={'cn': ['server']}, should_exist=must_exist)
333
		utils.verify_ldap_object('cn=server,cn=computers,%s' % ou_base, expected_attr={'cn': ['server']}, should_exist=must_exist)
329
		utils.verify_ldap_object('cn=dc,cn=server,cn=computers,%s' % ou_base, expected_attr={'cn': ['dc']}, should_exist=must_exist)
334
		utils.verify_ldap_object('cn=dc,cn=server,cn=computers,%s' % ou_base, expected_attr={'cn': ['dc']}, should_exist=must_exist)
330
		utils.verify_ldap_object('cn=networks,%s' % ou_base, expected_attr={'cn': ['networks']}, should_exist=must_exist)
335
		utils.verify_ldap_object(search_base.networks, expected_attr={'cn': ['networks']}, should_exist=must_exist)
331
		utils.verify_ldap_object('cn=groups,%s' % ou_base, expected_attr={'cn': ['groups']}, should_exist=must_exist)
336
		utils.verify_ldap_object(search_base.groups, expected_attr={'cn': ['groups']}, should_exist=must_exist)
332
		utils.verify_ldap_object('cn=%s,cn=groups,%s' % (cn_pupils, ou_base), expected_attr={'cn': [cn_pupils]}, should_exist=must_exist)
337
		utils.verify_ldap_object(search_base.workgroups, expected_attr={'cn': [cn_pupils]}, should_exist=must_exist)
333
		utils.verify_ldap_object('cn=%s,cn=groups,%s' % (cn_teachers, ou_base), expected_attr={'cn': [cn_teachers]}, should_exist=must_exist)
338
		utils.verify_ldap_object(search_base.teachers_group, expected_attr={'cn': [cn_teachers]}, should_exist=must_exist)
334
		utils.verify_ldap_object('cn=klassen,cn=%s,cn=groups,%s' % (cn_pupils, ou_base), expected_attr={'cn': ['klassen']}, should_exist=must_exist)
339
		utils.verify_ldap_object(search_base.classes, expected_attr={'cn': [cn_class]}, should_exist=must_exist)
335
		utils.verify_ldap_object('cn=raeume,cn=groups,%s' % ou_base, expected_attr={'cn': ['raeume']}, should_exist=must_exist)
340
		utils.verify_ldap_object(search_base.rooms, expected_attr={'cn': [cn_rooms]}, should_exist=must_exist)
336
341
337
		utils.verify_ldap_object('cn=dhcp,%s' % ou_base, expected_attr={'cn': ['dhcp']}, should_exist=must_exist)
342
		utils.verify_ldap_object(search_base.dhcp, expected_attr={'cn': ['dhcp']}, should_exist=must_exist)
338
		utils.verify_ldap_object('cn=policies,%s' % ou_base, expected_attr={'cn': ['policies']}, should_exist=must_exist)
343
		utils.verify_ldap_object(search_base.policies, expected_attr={'cn': ['policies']}, should_exist=must_exist)
339
		utils.verify_ldap_object('cn=shares,%s' % ou_base, expected_attr={'cn': ['shares']}, should_exist=must_exist)
344
		utils.verify_ldap_object(search_base.shares, expected_attr={'cn': ['shares']}, should_exist=must_exist)
340
		utils.verify_ldap_object('cn=klassen,cn=shares,%s' % ou_base, expected_attr={'cn': ['klassen']}, should_exist=must_exist)
345
		utils.verify_ldap_object(search_base.classShares, expected_attr={'cn': [cn_class]}, should_exist=must_exist)
341
		utils.verify_ldap_object('cn=dc,cn=server,cn=computers,%s' % ou_base, expected_attr={'cn': ['dc']}, should_exist=must_exist)
346
		utils.verify_ldap_object('cn=dc,cn=server,cn=computers,%s' % ou_base, expected_attr={'cn': ['dc']}, should_exist=must_exist)
342
347
343
		if noneducational_create_objects:
348
		if noneducational_create_objects:
344
			utils.verify_ldap_object('cn=%s,cn=users,%s' % (cn_staff, ou_base), should_exist=must_exist)
349
			utils.verify_ldap_object(search_base.staff, should_exist=must_exist)
345
			utils.verify_ldap_object('cn=%s,cn=users,%s' % (cn_teachers_staff, ou_base), should_exist=must_exist)
350
			utils.verify_ldap_object(search_base.teachersAndStaff, should_exist=must_exist)
346
			utils.verify_ldap_object('cn=%s,cn=groups,%s' % (cn_staff, ou_base), should_exist=must_exist)
351
			utils.verify_ldap_object(search_base.staff_group, should_exist=must_exist)
347
		else:
352
		else:
348
			utils.verify_ldap_object('cn=%s,cn=users,%s' % (cn_staff, ou_base), should_exist=False)
353
			utils.verify_ldap_object(search_base.staff, should_exist=False)
349
			utils.verify_ldap_object('cn=%s,cn=users,%s' % (cn_teachers_staff, ou_base), should_exist=False)
354
			utils.verify_ldap_object(search_base.teachersAndStaff, should_exist=False)
350
			utils.verify_ldap_object('cn=%s,cn=groups,%s' % (cn_staff, ou_base), should_exist=False)
355
			utils.verify_ldap_object(search_base.staff_group, should_exist=False)
351
356
352
		if noneducational_create_objects:
357
		if noneducational_create_objects:
353
			utils.verify_ldap_object('cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % base_dn, should_exist=True)
358
			utils.verify_ldap_object(search_base.administrative_dc_group, should_exist=True)
354
			utils.verify_ldap_object('cn=Member-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % base_dn, should_exist=True)
359
			utils.verify_ldap_object(search_base.administrative_member_group, should_exist=True)
355
			utils.verify_ldap_object('cn=OU%s-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % (ou, base_dn), should_exist=True)
360
			utils.verify_ldap_object(search_base.administrative_ou_dc_group)
356
			utils.verify_ldap_object('cn=OU%s-Member-Verwaltungsnetz,cn=ucsschool,cn=groups,%s' % (ou, base_dn), should_exist=True)
361
			utils.verify_ldap_object(search_base.administrative_ou_member_group)
357
		# This will fail because we don't cleanup these groups in cleanup_ou
362
		# This will fail because we don't cleanup these groups in cleanup_ou
358
		#else:
363
		#else:
359
		#	utils.verify_ldap_object("cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s" % base_dn, should_exist=False)
364
		#	utils.verify_ldap_object("cn=DC-Verwaltungsnetz,cn=ucsschool,cn=groups,%s" % base_dn, should_exist=False)
 Lines 367-388    Link Here 
367
		if dc_administrative:
372
		if dc_administrative:
368
			verify_dc(ou, dc_administrative, TYPE_DC_ADMINISTRATIVE, base_dn, must_exist)
373
			verify_dc(ou, dc_administrative, TYPE_DC_ADMINISTRATIVE, base_dn, must_exist)
369
374
370
		grp_prefix_pupils = ucr.get('ucsschool/ldap/default/groupprefix/pupils', 'schueler-')
371
		grp_prefix_teachers = ucr.get('ucsschool/ldap/default/groupprefix/teachers', 'lehrer-')
372
		grp_prefix_admins = ucr.get('ucsschool/ldap/default/groupprefix/admins', 'admins-')
373
		grp_prefix_staff = ucr.get('ucsschool/ldap/default/groupprefix/staff', 'mitarbeiter-')
374
375
		grp_policy_pupils = ucr.get('ucsschool/ldap/default/policy/umc/pupils', 'cn=ucsschool-umc-pupils-default,cn=UMC,cn=policies,%s' % base_dn)
375
		grp_policy_pupils = ucr.get('ucsschool/ldap/default/policy/umc/pupils', 'cn=ucsschool-umc-pupils-default,cn=UMC,cn=policies,%s' % base_dn)
376
		grp_policy_teachers = ucr.get('ucsschool/ldap/default/policy/umc/teachers', 'cn=ucsschool-umc-teachers-default,cn=UMC,cn=policies,%s' % base_dn)
376
		grp_policy_teachers = ucr.get('ucsschool/ldap/default/policy/umc/teachers', 'cn=ucsschool-umc-teachers-default,cn=UMC,cn=policies,%s' % base_dn)
377
		grp_policy_admins = ucr.get('ucsschool/ldap/default/policy/umc/admins', 'cn=ucsschool-umc-admins-default,cn=UMC,cn=policies,%s' % base_dn)
377
		grp_policy_admins = ucr.get('ucsschool/ldap/default/policy/umc/admins', 'cn=ucsschool-umc-admins-default,cn=UMC,cn=policies,%s' % base_dn)
378
		grp_policy_staff = ucr.get('ucsschool/ldap/default/policy/umc/staff', 'cn=ucsschool-umc-staff-default,cn=UMC,cn=policies,%s' % base_dn)
378
		grp_policy_staff = ucr.get('ucsschool/ldap/default/policy/umc/staff', 'cn=ucsschool-umc-staff-default,cn=UMC,cn=policies,%s' % base_dn)
379
379
380
		utils.verify_ldap_object("cn=%s%s,cn=ouadmins,cn=groups,%s" % (grp_prefix_admins, ou, base_dn), expected_attr={'univentionPolicyReference': [grp_policy_admins]}, should_exist=True)
380
		utils.verify_ldap_object(search_base.admin_group, expected_attr={'univentionPolicyReference': [grp_policy_admins]}, should_exist=True)
381
		utils.verify_ldap_object("cn=%s%s,cn=groups,%s" % (grp_prefix_pupils, ou, ou_base), expected_attr={'univentionPolicyReference': [grp_policy_pupils]}, should_exist=must_exist)
381
		utils.verify_ldap_object(search_base.students_ou_group, expected_attr={'univentionPolicyReference': [grp_policy_pupils]}, should_exist=must_exist)
382
		utils.verify_ldap_object("cn=%s%s,cn=groups,%s" % (grp_prefix_teachers, ou, ou_base), expected_attr={'univentionPolicyReference': [grp_policy_teachers]}, should_exist=must_exist)
382
		utils.verify_ldap_object(search_base.teachers_ou_group, expected_attr={'univentionPolicyReference': [grp_policy_teachers]}, should_exist=must_exist)
383
383
384
		if noneducational_create_objects:
384
		if noneducational_create_objects:
385
			utils.verify_ldap_object("cn=%s%s,cn=groups,%s" % (grp_prefix_staff, ou, ou_base), expected_attr={'univentionPolicyReference': [grp_policy_staff]}, should_exist=must_exist)
385
			utils.verify_ldap_object(search_base.staff_ou_group, expected_attr={'univentionPolicyReference': [grp_policy_staff]}, should_exist=must_exist)
386
386
387
		dcmaster_module = univention.admin.modules.get("computers/domaincontroller_master")
387
		dcmaster_module = univention.admin.modules.get("computers/domaincontroller_master")
388
		dcbackup_module = univention.admin.modules.get("computers/domaincontroller_backup")
388
		dcbackup_module = univention.admin.modules.get("computers/domaincontroller_backup")
 Lines 398-405    Link Here 
398
		# check group membership
398
		# check group membership
399
		#  slave should be member
399
		#  slave should be member
400
		#  master and backup should not be member
400
		#  master and backup should not be member
401
		dcgroups = ["cn=OU%s-DC-Edukativnetz,cn=ucsschool,cn=groups,%s" % (ou, base_dn),
401
		dcgroups = [search_base.educational_ou_dc_group, search_base.educational_dc_group]
402
					"cn=DC-Edukativnetz,cn=ucsschool,cn=groups,%s" % (base_dn)]
403
402
404
		if must_exist:
403
		if must_exist:
405
			if masterobjs:
404
			if masterobjs:
 Lines 443-449    Link Here 
443
				# seems to be the first OU, so check the variable settings
442
				# seems to be the first OU, so check the variable settings
444
				if ucr.get('dhcpd/ldap/base') != "cn=dhcp,%s" % (ou_base,):
443
				if ucr.get('dhcpd/ldap/base') != "cn=dhcp,%s" % (ou_base,):
445
					print 'ERROR: dhcpd/ldap/base =', ucr.get('dhcpd/ldap/base')
444
					print 'ERROR: dhcpd/ldap/base =', ucr.get('dhcpd/ldap/base')
446
					print 'ERROR: expected base =', dhcp_dn
445
					print 'ERROR: expected base =', dhcp_dn  # FIXME: unresolve reference: dhcp_dn
447
					raise DhcpdLDAPBase()
446
					raise DhcpdLDAPBase()
448
447
449
			# use the UCR value and check if the DHCP service exists
448
			# use the UCR value and check if the DHCP service exists
(-)ucs-test-ucsschool/90_ucsschool/essential/schoolroom.py (-3 / +2 lines)
 Lines 1-8    Link Here 
1
from univention.testing.ucsschool import UMCConnection
1
from univention.testing.ucsschool import UMCConnection
2
import univention.testing.strings as uts
2
import univention.testing.strings as uts
3
import univention.testing.ucr as ucr_test
3
import univention.testing.ucr as ucr_test
4
import univention.testing.ucsschool as utu
5
import univention.testing.utils as utils
4
import univention.testing.utils as utils
5
from ucsschool.lib.models import LibComputerRoom
6
6
7
7
8
class FailQuery(Exception):
8
class FailQuery(Exception):
 Lines 59-66    Link Here 
59
		self.umc_connection.auth(admin, passwd)
59
		self.umc_connection.auth(admin, passwd)
60
60
61
	def dn(self):
61
	def dn(self):
62
		return 'cn=%s-%s,cn=raeume,cn=groups,%s' % (
62
		return LibComputerRoom(school="myschool", name='{}-{}'.format("myschool", "myname")).dn
63
				self.school, self.name, utu.UCSTestSchool().get_ou_base_dn(self.school))
64
63
65
	def add(self, should_pass=True):
64
	def add(self, should_pass=True):
66
		param = [{
65
		param = [{
(-)univention-management-console-module-selective-udm/umc/python/selective-udm/__init__.py (-1 / +2 lines)
 Lines 51-56    Link Here 
51
from univention.management.console.log import MODULE
51
from univention.management.console.log import MODULE
52
from univention.management.console.modules import UMC_Error
52
from univention.management.console.modules import UMC_Error
53
from ucsschool.lib.schoolldap import LDAP_Connection, SchoolBaseModule, ADMIN_WRITE, USER_READ
53
from ucsschool.lib.schoolldap import LDAP_Connection, SchoolBaseModule, ADMIN_WRITE, USER_READ
54
from ucsschool.lib.models import SchoolComputer
54
55
55
from univention.management.console.config import ucr
56
from univention.management.console.config import ucr
56
57
 Lines 92-98    Link Here 
92
93
93
		try:
94
		try:
94
			# Set new position
95
			# Set new position
95
			ldap_position.setDn(search_base.computers)
96
			ldap_position.setDn(SchoolComputer.get_container(search_base.school))
96
97
97
			usersid = request.options.get('usersid')
98
			usersid = request.options.get('usersid')
98
			self._check_usersid_join_permissions(ldap_user_read, usersid)
99
			self._check_usersid_join_permissions(ldap_user_read, usersid)

Return to bug 41231