Subversion Repositories wimsdev

Rev

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

# test if the user "user" is registered in the class "class".
# Calling parameter: class,user.

!distribute items $wims_read_parm into c_,u_
!let d_=wimshome/log/classes
!default c_=$wims_class
!let script_reply=no

!if $u_=supervisor
  !let script_reply=yes
  !exit
!else
  f_=.users/$u_
!endif

scl_=!defof class_superclass in $d_/$c_/.def
scl_=!item -1 of $scl_
!if $scl_=$empty
  !let script_reply=!defof user_exists in $d_/$c_/$f_
!else
  !let auth_=!defof user_participate in $d_/$scl_/$f_
  !if $c_ isitemof $auth_
    !! need that in the case of an interclasse (super/level/program/course)
    !let script_reply=yes
    !exit
  !endif
  !let c_=!replace internal / by , in $c_
  !let c_=!item 1 to 3 of $c_
  !let c_=!replace internal , by / in $c_
  !let c_=!nospace $c_
  !if $c_ isitemof $auth_
    !let script_reply=yes
  !endif
!endif