Rev 10169 | Rev 10573 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
23 | reyssat | 1 | !if robot isin $session or _ isin $session |
2 | !exit |
||
3 | !endif |
||
10169 | bpr | 4 | !set wims_ariane_self=no |
10214 | bpr | 5 | !set wims_ariane=!append line n_$type,8, to $wims_ariane |
4993 | bpr | 6 | |
2368 | bpr | 7 | !read adm/class/classlang names.phtml |
5013 | bpr | 8 | |
5411 | bpr | 9 | listlim=100 |
23 | reyssat | 10 | wims_prefix=class user tmp |
11 | wims_module_log=$type $keyword |
||
12 | wims_helper=chapter=3 |
||
13 | wims_form_method=post |
||
14 | wims_ref_otherlangs=yes |
||
15 | !default class_bgcolor=$wims_bgcolor |
||
16 | !default class_bgimg=$wims_bgimg |
||
17 | !default class_css=$wims_css |
||
1170 | bpr | 18 | |
5013 | bpr | 19 | !if $class!=$empty |
5105 | bpr | 20 | ## output auth_method_list, aut_idp_method_list, auth_method, aut_idp_method |
21 | !read adm/class/initclass $class,auth |
||
23 | reyssat | 22 | !endif |
5020 | bpr | 23 | !!useful ! if $class=$empty |
24 | superclass=!text remove . in $superclass |
||
25 | !if $wims_superclass!=$empty |
||
26 | superclass=$wims_superclass |
||
27 | !endif |
||
5013 | bpr | 28 | |
23 | reyssat | 29 | !default superclass2=$superclass |
30 | !read tabletheme |
||
5408 | guerimand | 31 | !if $auth_method=$empty and $class!=$empty |
32 | !bound type within supervisor,participant,example,\ |
||
9506 | bpr | 33 | authsupervisor,authparticipant,forgetpwd default example |
5408 | guerimand | 34 | !else |
35 | !bound type within supervisor,participant,example,\ |
||
9506 | bpr | 36 | authsupervisor,authparticipant default example |
5408 | guerimand | 37 | !endif |
23 | reyssat | 38 | !if $type=example |
39 | superclass= |
||
40 | !endif |
||
4993 | bpr | 41 | |
5350 | guerimand | 42 | !if $type=forgetpwd |
43 | !changeto forgetpwd.proc |
||
44 | !endif |
||
45 | |||
23 | reyssat | 46 | !if $superclass=$empty |
47 | indf=wimshome/log/classes/.index |
||
48 | limited=yes |
||
49 | !else |
||
50 | indf=wimshome/log/classes/$superclass/.subclasses |
||
51 | keyword= |
||
52 | !endif |
||
53 | keyword=!items2words $keyword |
||
54 | keyword=!trim $keyword |
||
55 | kw=!words2items $keyword |
||
56 | kw=!deaccent $kw |
||
57 | kw=!tolower $kw |
||
58 | ccnt=!recordcnt $indf |
||
59 | !if $wims_class!=$empty |
||
60 | !read var.direct |
||
61 | !if $error!=$empty |
||
62 | !exit |
||
63 | !endif |
||
64 | !endif |
||
65 | |||
66 | clcnt=0 |
||
67 | encnt=0 |
||
68 | lacnt=0 |
||
4348 | bpr | 69 | excnt=0 |
4256 | bpr | 70 | listla= |
23 | reyssat | 71 | !if $type=example |
72 | !for i=1 to $ccnt |
||
73 | l=!record $i of $indf |
||
74 | c=!item 1 of $l |
||
75 | !if NaN notin $[$c] and $c<10000 |
||
76 | ltest=!defof class_lang in wimshome/log/classes/$c/.def |
||
4348 | bpr | 77 | !advance excnt |
9311 | bpr | 78 | !if $module_language iswordof $ltest |
23 | reyssat | 79 | laclasses=!append line $l to $laclasses |
80 | !advance lacnt |
||
81 | !else |
||
4256 | bpr | 82 | listla=!append item $ltest to $listla |
23 | reyssat | 83 | !if $ltest=en |
84 | enclasses=!append line $l to $enclasses |
||
85 | !advance encnt |
||
86 | !endif |
||
87 | !endif |
||
88 | !endif |
||
89 | !next i |
||
90 | !if $lacnt>0 |
||
91 | clcnt=$lacnt |
||
92 | classes=$laclasses |
||
93 | !else |
||
94 | clcnt=$encnt |
||
95 | classes=$enclasses |
||
96 | !endif |
||
4256 | bpr | 97 | listla=!listuniq $listla |
6043 | bpr | 98 | listla=!replace internal , by </span>, <span class="tt"> in <span class="tt">$listla</span> |
4348 | bpr | 99 | othercnt=$[$excnt-$lacnt] |
23 | reyssat | 100 | !endif |
101 | |||
102 | !if $type iswordof supervisor participant |
||
103 | sccnt=0 |
||
104 | !if $wims_class!=$empty |
||
105 | !defread wimshome/log/classes/$wims_class/.def |
||
106 | !default class_type=0 |
||
107 | !if $class_type>=2 |
||
108 | !read adm/class/userdef classes,$wims_class,$wims_user |
||
109 | supervisable=!defof user_supervisable in $userdef |
||
110 | super_type=!defof class_type in wimshome/log/classes/$wims_superclass/.def |
||
111 | !ifval $super_type=4 |
||
112 | stype=$[$super_type] |
||
113 | sp=!translate internal / to , in $superclass2 |
||
114 | splevel=!itemcnt $sp |
||
115 | sparent=!item 1 to -2 of $sp |
||
116 | sparent=!translate internal , to / in $sparent |
||
117 | sparent=!nospace $sparent |
||
118 | !if $splevel=1 |
||
119 | classes1=!record 0 of wimshome/log/classes/$superclass2/levels |
||
120 | !endif |
||
121 | !if $splevel=2 |
||
122 | classes1=!record 0 of wimshome/log/classes/$superclass2/classes |
||
123 | classes2=!record 0 of wimshome/log/classes/$superclass2/programs |
||
411 | bpr | 124 | !!classes1=!append line $classes2 to $classes1 |
23 | reyssat | 125 | !endif |
126 | !if $splevel=3 |
||
127 | classes1=!record 0 of wimshome/log/classes/$superclass2/courses |
||
128 | !endif |
||
129 | clcnt=!linecnt $classes1 |
||
411 | bpr | 130 | clcnt_pr=!linecnt $classes2 |
23 | reyssat | 131 | classes= |
411 | bpr | 132 | classes_pr= |
23 | reyssat | 133 | !for i=1 to $clcnt |
134 | l=!line $i of $classes1 |
||
135 | !distribute items $l into code,Sup,name,sup |
||
136 | classes=!append line $wims_superclass/$code,,,$name to $classes |
||
137 | !next i |
||
411 | bpr | 138 | !for i=1 to $clcnt_pr |
139 | l=!line $i of $classes2 |
||
140 | !distribute items $l into code,Sup,name,sup |
||
141 | classes_pr=!append line $wims_superclass/$code,,,$name to $classes_pr |
||
142 | !next i |
||
23 | reyssat | 143 | !exit |
144 | !endif |
||
145 | !endif |
||
146 | !endif |
||
147 | !for i=1 to $ccnt |
||
148 | l=!record $i of $indf |
||
149 | !distribute items $l into code,expire,inst,cl,la,ty |
||
150 | l1=!deaccent $l |
||
151 | l1=!tolower $l1 |
||
152 | c1=!text extract 0123456789 in $code |
||
153 | k=yes |
||
154 | !for w in $kw |
||
155 | !if $w notin $l1 |
||
156 | k=no |
||
157 | !break |
||
158 | !endif |
||
159 | !next w |
||
4567 | bpr | 160 | !!delete condition on language in a superclass |
161 | !if (/ isin $code or $c1>9999) and ($la=$module_language or $class_type!=) and\ |
||
23 | reyssat | 162 | ($code!=$wims_class or ($wims_user!=supervisor and $type=supervisor)) and \ |
163 | $k = yes |
||
164 | !if $ty isin 24 |
||
165 | sclasses=!append line $l to $sclasses |
||
166 | !advance sccnt |
||
167 | !else |
||
168 | classes=!append line $l to $classes |
||
169 | !advance clcnt |
||
170 | !endif |
||
171 | !endif |
||
172 | !if $limited = yes and $clcnt+$sccnt > $listlim |
||
173 | overflow=yes |
||
174 | !break |
||
175 | !endif |
||
176 | !next i |
||
177 | !if $wims_user!=$empty and $wims_supertype iswordof 2 4 |
||
178 | sccnt=0 |
||
179 | !endif |
||
180 | !endif |
||
181 | |||
4152 | bpr | 182 | !if $type iswordof authparticipant authsupervisor |
183 | !reset class_defined |
||
184 | class=!text remove . in $class |
||
185 | !defread wimshome/log/classes/$class/.def |
||
186 | !!#### la seconde condition pour entrer dans la classe en tant que supervisor : |
||
187 | !!#### le user est supervisor de cette classe, ou wims_realuser est supervisor ou vide (cas de l'administrateur) ou la classe est la classe test |
||
4993 | bpr | 188 | |
4152 | bpr | 189 | !if $type=authsupervisor and ($class isitemof $wims_supervise or $wims_realuser=$empty or $wims_realuser=supervisor or /0/ isin $class/) |
190 | !default auth_user=supervisor |
||
23 | reyssat | 191 | !endif |
5100 | bpr | 192 | |
4424 | bpr | 193 | !if $save_logincgu!=$empty |
5100 | bpr | 194 | auth_user=$save_logincgu |
4424 | bpr | 195 | !endif |
4993 | bpr | 196 | |
5013 | bpr | 197 | superclass=!defof class_superclass in wimshome/log/classes/$class/.def |
198 | !default superclass=$class |
||
4993 | bpr | 199 | |
5026 | bpr | 200 | !if $class_defined=yes and ($auth_user!=$empty or $auth_method isitemof $auth_method_list) |
4993 | bpr | 201 | !changeto var.auth |
23 | reyssat | 202 | !endif |
203 | !endif |