Subversion Repositories wimsdev

Rev

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