Subversion Repositories wimsdev

Rev

Rev 12159 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
861 guerimand 1
# test if the user "user" is registered in the class "class".
2
# Calling parameter: class,user.
3
 
4
!distribute items $wims_read_parm into c_,u_
5
!let d_=wimshome/log/classes
6
!default c_=$wims_class
7
!let script_reply=no
8
 
9
!if $u_=supervisor
12159 obado 10
  !let script_reply=yes
11
  !exit
861 guerimand 12
!else
12159 obado 13
  f_=.users/$u_
861 guerimand 14
!endif
15
 
16
scl_=!defof class_superclass in $d_/$c_/.def
17
scl_=!item -1 of $scl_
18
!if $scl_=$empty
12159 obado 19
  !let script_reply=!defof user_exists in $d_/$c_/$f_
861 guerimand 20
!else
12159 obado 21
  !let auth_=!defof user_participate in $d_/$scl_/$f_
13211 bpr 22
  !if $c_ isitemof $auth_
23
    !! need that in the case of an interclasse (super/level/program/course)
24
    !let script_reply=yes
25
    !exit
26
  !endif
12159 obado 27
  !let c_=!replace internal / by , in $c_
28
  !let c_=!item 1 to 3 of $c_
29
  !let c_=!replace internal , by / in $c_
30
  !let c_=!nospace $c_
31
  !if $c_ isitemof $auth_
32
    !let script_reply=yes
33
  !endif
861 guerimand 34
!endif
35