Subversion Repositories wimsdev

Rev

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