Subversion Repositories wimsdev

Rev

Rev 13287 | Rev 14834 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5181 guerimand 1
!read adm/language lang/names.phtml
5239 bpr 2
 
3
!read adm/language adm/lang/external_auth.phtml
1170 bpr 4
!read adm/css.phtml
1051 bpr 5
!header1
6
 
1610 bpr 7
!read adm/title.phtml 1\
2275 bpr 8
WIMS $httpd_HTTP_HOST\
2213 bpr 9
$name_title
1610 bpr 10
 
11518 obado 11
!! login and password must contain 4-16 alphanumeric characters
12
!set password_pattern=[a-zA-Z0-9]{4,16}
13
!set login_pattern=[a-zA-Z0-9]{4,16}
14
 
23 reyssat 15
!if $cltype iswordof 2 4 and $classcnt>0
12049 obado 16
  <p class="wimscenter">
17
  ($name_reserved)
18
  </p>
23 reyssat 19
!endif
13254 guerimand 20
 
23 reyssat 21
!if $error!=$empty
12049 obado 22
  <div class="wims_msg alert">
12991 bpr 23
  !read lang/msg.phtml.$modu_lang
12049 obado 24
  </div>
25
  <p>
12955 bpr 26
  !set wims_ref_class=wims_button
27
  !href cmd=new&class=$class&subclass=yes $wims_name_back2
12049 obado 28
  </p>
29
  !goto end1
23 reyssat 30
!endif
31
 
32
!if $classcnt=0
2213 bpr 33
  $name_warning1
12049 obado 34
  !goto end
23 reyssat 35
!endif
36
 
13256 guerimand 37
!if $classlist!=$empty
38
  $name_inscription
39
 
40
  $table_header
41
  !if $ctype=0
42
    $table_hdtr
43
      <th>$wims_name_name</th><th>$wims_name_nameteacher</th><th>$wims_name_level</th><th>$wims_name_Language</th>
44
      <th>$name_remainig</th><th>$wims_name_Status</th>
45
  !else
46
    <caption>$institution_name</caption>
47
    $table_hdtr
48
    <th>$wims_name_name</th><th>$wims_name_Supervisor</th><th>$wims_name_level</th>
49
    <th>$wims_name_Status</th></tr>
50
  !endif
51
  !for cl in $classlist
52
    !reset class_supervisor,class_email,class_level,class_lang,class_institution,class_description,class_password,class_limit
53
    !defread wimshome/log/classes/$cl/.def
54
    !distribute char $class_level into l1,l2
55
    !set part=!recordcnt wimshome/log/classes/$cl/.userlist
56
    $table_tr<td>
57
    !if $ctype=0
58
      !href module=$module&cmd=reply&class=$cl $class_institution<br />$class_description
59
    !else
60
      !href module=$module&cmd=reply&class=$cl $class_description
61
    !endif
62
    </td><td>
63
    !mailurl $class_email $class_supervisor
64
    </td>
65
    !if $class_level=$empty
66
      !set pname=!defof class_description in wimshome/log/classes/$class_parent/.def
67
        <td>$pname</td>
68
    !else
69
        <td>$(level$l1)<br />$name_year $l2</td>
70
    !endif
71
    !if $ctype=0
72
      <td>$(lang_$class_lang)</td>
73
      <td style="text-align:right">
74
      !if $class_limit-$part>$site_dispo
75
        $site_dispo
76
      !else
77
        $[$class_limit-$part]
78
      !endif
79
      </td>
80
    !endif
13286 obado 81
    <td>
13287 bpr 82
    !if $class_password=$empty
83
      <span class="wims_label open">$(name_statut[1])</span>
84
    !else
85
      <span class="wims_label wims_warning">$(name_statut[2])</span>
86
    !endif
13286 obado 87
    </td>
13256 guerimand 88
    </tr>
89
  !next cl
90
  $table_end
91
 
13289 obado 92
  <div class="wims_msg info">$name_remark1</div>
13256 guerimand 93
  !goto end1
94
!endif classlist!=$empty
95
 
4039 bpr 96
!read adm/class/classname.phtml $description\
4017 bpr 97
$institution
23 reyssat 98
 
4591 czzmrn 99
!! if class_mixed_external_auth not 0 show message in and class_external_auth
100
!! and when class_mixed_external_auth=2 also disable the registration form
4269 czzmrn 101
!! please check! thanks!
102
!default authreg=0
103
!if $cltype=1
104
  !set authreg=!defof class_mixed_external_auth in wimshome/log/classes/$class_parent/.def
105
  !set extauth=!defof class_external_auth in wimshome/log/classes/$class_parent/.def
4274 czzmrn 106
  !set usuperv=!defof user_supervisable in wimshome/log/classes/$class_parent/.users/$wims_user
4269 czzmrn 107
!endif
108
!if $cltype=0
4591 czzmrn 109
  !set super_mixed_auth=!defof class_mixed_external_auth in wimshome/log/classes/$class_superclass/.def
110
  !if $super_mixed_auth=2
111
    !set authreg=$super_mixed_auth
112
    !set extauth=!defof class_external_auth in wimshome/log/classes/$class_superclass/.def
113
  !else
114
    !set authreg=$class_mixed_external_auth
115
    !set extauth=!defof class_external_auth in wimshome/log/classes/$class/.def
116
  !endif
117
  !! do we really need this for $cltype=0?
4274 czzmrn 118
  !set usuperv=!defof user_supervisable in wimshome/log/classes/$class/.users/$wims_user
4269 czzmrn 119
!endif
120
!! need to check if supervisor in order to allow user management by supervisor
4274 czzmrn 121
!! need to check if user_supervisable for direct access from module=home
4591 czzmrn 122
!!  anything else?
4274 czzmrn 123
!if $wims_user!=supervisor and $usuperv!=yes and $authreg iswordof 1 2 and $cltype iswordof 0 1
4305 bpr 124
  <div class="wims_external_auth">
4269 czzmrn 125
  $extauth
4305 bpr 126
  </div>
4269 czzmrn 127
  !if $authreg=2
128
    !goto end1
129
  !endif
130
!endif
131
 
23 reyssat 132
!if $password!=$empty and $passverify=$empty
12049 obado 133
  !if $cltype iswordof 2 4
134
    $name_classessss
135
    !href module=adm/class/classes&type=authparticipant&class=$class $classname
136
  !else
137
    $name_classessss
138
    !href module=adm/class/classes&type=authparticipant&class=$class $classname
139
  !endif
140
  !if $cltype iswordof 4 2
141
    $name_warning_protected
142
    !if $classcnt>0
143
      $name_inscription_student
144
      !href cmd=new&module=$module&class=$class&subclass=yes $name_inyourclass
12991 bpr 145
      .
12049 obado 146
    !endif
147
  !else
148
    $name_isprotected
23 reyssat 149
  !endif
12049 obado 150
  <p>$name_writepasswd
12955 bpr 151
  !if $cltype iswordof 2 4
152
    $name_asateacher.
153
  !else
154
    $name_asaparticipant.
155
  !endif
12049 obado 156
  </p>
7452 bpr 157
 
12049 obado 158
  !form reply
159
    <input type="hidden" name="step" value="1" />
160
    <fieldset class="property_fields halfwidth blockcenter">
161
      <legend>$name_title</legend>
162
      <div class="field box">
163
        <label for="classpass">$wims_name_Password</label>
164
        <input type="password" name="classpass" id="classpass" required="required" class="noicon" placeholder="$wims_name_Password" />
165
      </div>
166
      <div class="wimscenter wimsform">
167
        <input type="submit" value="$wims_name_send" />
168
      </div>
169
    </fieldset>
170
  !formend
171
  <span class="wims_warning">$wims_name_warning</span>.
172
  !if $cltype iswordof 2 4
173
    $name_access1
174
  !else
175
    $name_access2
176
  !endif
177
  $name_obtainpasswd
178
  (
179
  !if $cltype iswordof 2 4
180
    !mailurl $smail $name_write_adm
181
  !else
182
    !mailurl $smail $wims_name_wsup
183
  !endif
12955 bpr 184
  ).
12049 obado 185
  !if $cltype iswordof 2 4
186
    <p>
187
      <span class="wims_warning">$wims_name_warning</span>.
188
      $name_warning_direct
12991 bpr 189
    !href cmd=new&module=$module&class=$class&subclass=yes $name_inyourclass
190
    .
12049 obado 191
    </p>
192
  !endif
193
  !goto end1
23 reyssat 194
!endif
195
 
196
!if $step=$empty or $step<2
12049 obado 197
  !if $ssclass!=$empty and $wims_class!=$ssclass and $wims_user=supervisor
198
    !form reply
199
      <input type="hidden" name="step" value="1" />
200
      <label for="search">$name_research:</label>
201
      <input size="20" name="search" id="search" value="$search" />
202
      <input type="submit" value="$wims_name_tosave" />
6309 bpr 203
 
12049 obado 204
    !formend
205
    !default foundcnt=0
206
    !if $foundcnt>0
207
      $table_header
12955 bpr 208
      <caption>$name_clickname</caption>
209
      $table_hdtr<th>$wims_name_name</th><th>$wims_name_Login</th></tr>
210
      !for i=1 to $foundcnt
211
        !set l=!line $i of $found
212
        !distribute item $l into l_,f_,L_
213
        $table_tr<td>
214
        !href cmd=reply&step=2&login=$L_ $l_, $f_
215
          </td>
216
          <td>$L_</td>
217
        </tr>
218
      !next i
12049 obado 219
      $table_end
220
      !goto end1
10653 bpr 221
    !endif
12049 obado 222
    !if $search!=$empty and $foundcnt=0
223
      <p> ($name_nofound) </p>
224
    !endif
225
    $name_newparticipant
226
  !else
227
    !if $idp_method notitemof $idp_method_list
228
      !if $wims_user=supervisor
229
        $name_inscription21
230
      !else
231
        $name_inscription2
232
      !endif
233
    !endif
5023 bpr 234
  !endif
12049 obado 235
 
1081 bpr 236
  !form reply
12049 obado 237
  !! check user supervisor??
5023 bpr 238
 
12955 bpr 239
  !if $idp_method isitemof $idp_method_list and $auth_user$user_auth!=$empty and $wims_user!=supervisor
240
    <input type="hidden" name="step" value="3" />
241
    $name_inscription4:
242
    <p>
243
    !formcheckbox agreecgu list yes prompt $name_cgu
244
      [
13123 bpr 245
      !href target=wims_internal module=adm/light&phtml=cgu.phtml $name_seecgu
12955 bpr 246
      ]
247
    </p>
248
    <div class="wimscenter wimsform"><input type="submit" value="$wims_name_tosave" /></div>
249
    !goto end1
250
  !endif
251
  !!FIXME  $auth_user=$empty
252
  !if $wims_user=supervisor and $auth_user=$empty
6309 bpr 253
 
12955 bpr 254
    !! teacher registering a student with idp ldap
255
    !if $idp_method isitemof ldap
12049 obado 256
      <span class="wims_warning">$name_login_external ($name_idp_external)</span>:
6307 bpr 257
 
12955 bpr 258
      !!!FIXME check the value of step
12049 obado 259
      <input type="hidden" name="step" value="3" />
260
      <fieldset class="property_fields halfwidth blockcenter">
7909 bpr 261
        <legend>$name_title</legend>
12049 obado 262
        <div class="field box">
263
          <label for="user_auth">$wims_name_Login ($name_external)</label>
264
          <input size="16" name="user_auth" id="user_auth" value="$user_auth" />
265
        </div>
12955 bpr 266
      !set ct=!defof class_type in wimshome/log/classes/$class/.def
267
      !if $wims_user=supervisor and $class=$wims_class and $ct iswordof 2 4
268
        <div class="field box">
269
          <label for="utype">$name_accounttype</label>
270
        !default utype=0
271
        !set wims_ref_class=wims_formradio
272
        !formradio utype list 0,1 prompt $wims_name_namestudent,$wims_name_nameteacher
12049 obado 273
        </div>
12955 bpr 274
      !endif
12991 bpr 275
        <div class="wimscenter wimsform">
276
          <input type="submit" value="$wims_name_tosave" />
277
        </div>
278
      </fieldset>
12049 obado 279
 
12991 bpr 280
      !formend
281
      !goto end1
282
    !endif
12049 obado 283
 
12991 bpr 284
    !! teacher registering a student with external auth without idp ldap
285
    !if $auth_method isitemof $auth_method_list
286
      <input type="hidden" name="step" value="3" />
287
      <fieldset class="property_fields halfwidth blockcenter">
288
        <legend>$name_title</legend>
289
        <div class="field box halfwidth">
290
          <label for="lastn">$wims_name_lastname</label>
291
          <input size="20" name="lastn" id="lastn" value="$lastn" />
12049 obado 292
        </div>
12991 bpr 293
        <div class="field box halfwidth">
294
          <label for="firstn">$wims_name_firstname</label>
295
          <input size="20" name="firstn" id="firstn" value="$firstn" />
296
        </div>
297
        <div class="field box">
298
          <label for="user_auth">$wims_name_Login </label>
299
          <input size="16" name="user_auth" id="user_auth" value="$user_auth" />
300
          <div class="formHelp">$name_external,
301
            <span class="wims_warning">$name_login_external_warning</span>
302
        </div>
12955 bpr 303
      </div>
304
      <div class="field box">
305
        <label for="email">$wims_name_email</label>
306
        <input type="email" size="60" name="email" id="email" value="$email" />
307
        <div class="formHelp">$name_optional</div>
308
      </div>
309
      <div class="wimscenter wimsform">
310
        <input type="submit" value="$wims_name_tosave" />
311
      </div>
12991 bpr 312
      </fieldset>
313
      !formend
314
      !goto end1
315
    !endif
316
  !endif step empty or step<2
317
 
318
  !if $auth_user=$empty or $auth_method notitemof $auth_method_list
319
    !!read adm/language lang/names.phtml
320
    <input type="hidden" name="step" value="2" />
321
  !else
322
    <input type="hidden" name="step" value="3" />
12955 bpr 323
  !endif
12049 obado 324
  <fieldset class="property_fields halfwidth blockcenter">
325
    <legend>$name_title</legend>
326
    <div class="field box halfwidth">
327
      <label for="lastn">$wims_name_lastname</label>
328
      <input size="20" name="lastn" id="lastn" value="$lastn" required="required" />
329
    </div>
330
    <div class="field box halfwidth">
331
      <label for="firstn">$wims_name_firstname</label>
332
      <input size="20" name="firstn" id="firstn" value="$firstn" required="required" />
333
    </div>
12955 bpr 334
  !if $wims_user=supervisor
335
    !reset login
336
  !endif
337
  !if ($auth_user=$empty or $auth_method notitemof $auth_method_list) or $wims_user=supervisor
12049 obado 338
      <div class="field box">
339
        <label for="login">$wims_name_Login</label>
340
        <input size="16" name="login" id="login" value="$login" required="required" pattern="$login_pattern" />
341
        <div class="formHelp">
12955 bpr 342
    !if $auth_method notitemof $auth_method_list or $wims_user!=supervisor
343
       $name_warning_login
344
    !endif
345
    $name_warning_login2
7888 obado 346
      </div>
12955 bpr 347
    !if $auth_method isitemof $auth_method_list and $wims_user=supervisor
348
      !reset login_ext
349
      <label for="login_ext">$wims_name_Login</label>
350
      <input size="16" name="login_ext" id="login_ext" value="$login_ext" />
351
      <div class="formHelp">$name_external
352
        <span class="wims_warning">$name_login_external_warning</span>
7475 bpr 353
      </div>
12955 bpr 354
    !endif
355
    </div>
356
    !if $auth_method notitemof $auth_method_list
7475 bpr 357
      <div class="field box">
12955 bpr 358
        <label for="pass">$wims_name_Password</label>
359
        <input type="password" size="16" name="pass" id="pass" required="required" pattern="$password_pattern"/>
360
        <div class="formHelp">$name_passwd_warning</div>
7446 bpr 361
      </div>
12049 obado 362
    !endif
12955 bpr 363
  !else
12049 obado 364
    <div class="field box">
12955 bpr 365
      <label for="login">$wims_name_Login</label>
366
      <input size="16" name="login" id="login" value="$login" readonly="readonly" />
367
      <div class="formHelp">$name_internal</div>
12049 obado 368
    </div>
12955 bpr 369
    <div class="field box">
370
      <label for="login_ext">$wims_name_Login</label>
371
      <input size="16" name="login_ext" id="login_ext" value="$login_ext" readonly="readonly" />
372
      <div class="formHelp">$name_external, <span class="wims_warning"></span></div>
373
    </div>
374
  !endif
375
  <div class="field box">
376
    <label for="email">$wims_name_email</label>
377
    <input type="email" size="60" name="email" id="email" value="$email" />
378
    <div class="formHelp">$name_optional</div>
379
  </div>
380
  !if $wims_user=supervisor and $class=$wims_class and $cltype iswordof 2 4
381
    <div class="field box">
382
      <label for="utype">$name_accounttype</label>
383
    !default utype=0
384
    !set wims_ref_class=wims_formradio
385
    !formradio utype list 0,1 prompt $wims_name_namestudent,$wims_name_nameteacher
386
    </div>
387
  !endif
388
  !if $regvars_cnt>0
389
    !read regvars.phtml
390
  !endif
391
  !if $wims_user!=supervisor
392
    <div class="field box">
393
    !set wims_ref_class=wims_formradio
394
    !formcheckbox agreecgu list yes prompt $name_cgu
395
    [
13123 bpr 396
    !href target=wims_internal module=adm/light&phtml=cgu.phtml $name_seecgu
12955 bpr 397
    ]
398
    </div>
399
  !endif
400
  <div class="wimscenter wimsform"><input type="submit" value="$wims_name_tosave" /></div>
12049 obado 401
  </fieldset>
402
  !formend
403
  !goto end1
23 reyssat 404
!endif
405
 
406
!if $step=2
12049 obado 407
  !if $wims_user!=supervisor
408
    $name_hello, $name_student!<p>
409
    $name_inscription3
410
  !else
411
    $name_inscription31
412
  !endif
10653 bpr 413
  <span class="tt wims_login">$login</span>. </p>
12049 obado 414
  !if $email=$empty
415
    <p> $name_emptyemail </p>
416
  !else
417
    <p>$wims_name_email: <span class="tt wims_address">$email</span> </p>
418
  !endif
7475 bpr 419
 
12049 obado 420
  !form reply
421
    <input type="hidden" name="step" value="3" />
422
    <fieldset class="property_fields halfwidth blockcenter">
423
    <legend>$name_title</legend>
424
      <div class="field box">
425
        <label for="pass2">$name_passwd_exact</label>
426
        <input type="password" size="16" name="pass2" id="pass2" required="required" />
427
      </div>
428
      <div class="wimscenter wimsform">
429
        <input type="submit" value="$wims_name_send" />
430
      </div>
431
    </fieldset>
432
  !formend
433
  !goto end1
23 reyssat 434
!endif
435
 
436
!if $step=3
12049 obado 437
  !! needed for $name_student after !endif ?
5100 bpr 438
  !readproc adm/class/userdef class,$class,$login
5135 bpr 439
  !set firstn=!defof user_firstname in $userdef
440
  !set lastn=!defof user_lastname in $userdef
12049 obado 441
  !if $wims_user=supervisor
442
    !set login_wims=!defof user_external_auth in $userdef
443
    !default login_wims=$Login
444
    $name_studentadded
445
    <span class="tt wims_login">
12955 bpr 446
    !href module=adm/class/usermanage&job=userprop&getuser=$Login $login_wims
12049 obado 447
    </span>.
448
    !if $wims_supertype iswordof 2 4
12955 bpr 449
      !readproc adm/gateway/transfer $login test
450
      !if $transfer_test>0
451
        <p>
12049 obado 452
        $name_otheractivities
453
        !href module=adm/class/usermanage&job=transfer&getuser=$login $name_transfer1
12955 bpr 454
        </p>
455
      !endif
12049 obado 456
    !endif
12955 bpr 457
    !set wims_menu_items=!append line usermanage,1,module=adm/class/usermanage\
12049 obado 458
addstudent,1,module=$module&step=1\
459
to wims_menu_items
12955 bpr 460
    !goto end
461
  !endif
5118 bpr 462
 
12955 bpr 463
  <p>$name_hello, $name_student!</p>
464
  <p>$name_welcome
465
  <span class="tt wims_login">$login</span>.</p>
466
  $name_youcan
467
  !read adm/class/initclass $class,auth
6309 bpr 468
 
12049 obado 469
 
12955 bpr 470
  !if $wims_class!=$empty
471
    !if $auth_method iswordof cas
472
      !set url = $wims_ref_name?module=adm/class/classes&type=authparticipant&class=$class
473
      !read adm/codeurl $url
474
      !set class_cas_auth=!getdef class_cas_auth in wimshome/log/classes/$ssclass/.def
475
      <a class="wims_button" href="$class_cas_auth/login?service=$script_out">$wims_name_Enter</a>
12049 obado 476
    !else
12955 bpr 477
      !if $auth_method iswordof ldap php
478
        !set tmp=!getdef user_external_auth in wimshome/log/classes/$ssclass/.users/$login
479
        !href module=adm/class/classes&type=authparticipant&class=$class&auth_user=$tmp $name_gotowork
480
      !else
481
        !href module=adm/class/classes&type=authparticipant&class=$class&auth_user=$login $name_gotowork
482
      !endif
12049 obado 483
    !endif
12955 bpr 484
    !!FIXME what about php here
12991 bpr 485
    !! Pourquoi est-ce different : dans le second cas ouvre une autre session,
486
    !! demande de nouveau le mot de passe ???
12049 obado 487
  !else
488
    !if $auth_method isitemof cas
7446 bpr 489
      !set url = $wims_ref_name?module=adm/class/classes&type=authparticipant&class=$class
490
      !read adm/codeurl $url
491
      !set class_cas_auth=!getdef class_cas_auth in wimshome/log/classes/$ssclass/.def
492
      <a class="wims_button" href="$class_cas_auth/login?service=$script_out">$wims_name_Enter</a>
12049 obado 493
    !else
494
      !if $auth_method iswordof ldap
5118 bpr 495
        !set tmp=!getdef user_external_auth in wimshome/log/classes/$ssclass/.users/$login
5072 bpr 496
        !href module=adm/class/classes&type=authparticipant&class=$class&auth_user=$tmp $name_gotowork
12049 obado 497
      !else
11896 bpr 498
        <a href="$wims_ref_name?lang=$lang&+module=adm/class/classes&+type=authparticipant&+class=$class&+auth_user=$login">
12049 obado 499
        $name_gotowork</a> ($name_bookmark).
500
      !endif
501
    !endif
502
    !goto end
503
  !endif
23 reyssat 504
!endif
505
 
506
:end1
9116 bpr 507
 
23 reyssat 508
!if $wims_user=supervisor
12049 obado 509
  !if $step=1
510
    !set wims_menu_items=!append line back2,1,module=adm/class/usermanage\
511
    to $wims_menu_items
512
  !endif
513
  !goto end
23 reyssat 514
!endif
5874 bpr 515
 
23 reyssat 516
!if $cltype iswordof 2 4
12049 obado 517
  !set wims_menu_items=!append line classlist,1,module=adm/class/classes&type=supervisor\
518
  to $wims_menu_items
23 reyssat 519
!else
12049 obado 520
  !set wims_menu_items=!append line classlist,1,module=adm/class/classes&type=participant\
521
  to $wims_menu_items
23 reyssat 522
!endif
12049 obado 523
 
23 reyssat 524
:end
525
!tail
526
 
527
!reset step, subclass