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