Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
4996 czzmrn 1
##create teacherlist and .teacherlist_external at all levels
10981 bpr 2
## le parametre est la classe
4692 bpr 3
 
4
uclass=$wims_read_parm
5
superclass=!defof class_superclass in wimshome/log/classes/$uclass/.def
20 reyssat 6
!default superclass=$wims_superclass
4692 bpr 7
!default uclass=$wims_superclass
5028 bpr 8
!!! je ne comprends pas : l'indexation ne se fait pas sinon lorsqu'un enseignant s'inscrit
9
!default superclass=$uclass
10
!default wims_superclass=$class
11
!!!
20 reyssat 12
!if $superclass=$empty
13
 !exit
14
!endif
15
!if $wims_superclass!=$empty and $superclass!=$wims_superclass and $wims_ismanager<2
16
 !exit
17
!endif
18
 
19
basedir=wimshome/log/classes/$superclass
20
basedir2=$wims_home/log/classes/$superclass
4692 bpr 21
basedirr=wimshome/log/classes/$uclass
22
basedirr2=$wims_home/log/classes/$uclass
10980 bpr 23
basedir0=wimshome/log/classes
24
basedir02=$wims_home/log/classes
25
 
20 reyssat 26
tlist=!sh cd $basedir2/.users\
27
	grep -l user_supervisable=yes *
28
tlist=!words2items $tlist
10980 bpr 29
!set tmp=
4692 bpr 30
!writefile $basedirr/.teacherlist.1
10984 bpr 31
!if $(authidp_method[1;]) iswordof cas php
32
  !writefile $basedirr/.teacherlist_external.1
33
!endif
20 reyssat 34
!for t in $tlist
4692 bpr 35
  US_=!defof user_supervise in $basedir/.users/$t
10980 bpr 36
  EXT_=!defof user_external_auth in $basedir/.users/$t
4692 bpr 37
  !if $superclass=$uclass or $uclass isitemof $US_
38
   U_=!defof user_lastname,user_firstname in $basedir/.users/$t
39
   !appendfile $basedirr/.teacherlist.1 $U_,$t
10984 bpr 40
   !if $EXT_!=$empty and $(authidp_method[1;]) iswordof cas php
10981 bpr 41
     !appendfile $basedirr/.teacherlist_external.1 $EXT_:$t
42
   !endif
10980 bpr 43
   !for l in $US_
10981 bpr 44
!!teacherlist has not the same status in the superclass (every teacher)
45
!! and in the subclasses (supervise teachers )
46
     !if $l notwordof $superclass $uclass
10980 bpr 47
       !appendfile $basedir0/$l/.teacherlist.1 $U_,$t
10984 bpr 48
       !if $EXT_!=$empty and $(authidp_method[1;]) iswordof cas php
10980 bpr 49
         !appendfile $basedir0/$l/.teacherlist_external.1 $EXT_:$t
50
       !endif
51
       !set tmp=!append item $l to $tmp
52
     !endif
53
   !next
4692 bpr 54
 !endif
10980 bpr 55
!next t
10981 bpr 56
!set tmp=!listuniq $tmp,$uclass
57
!set tmp=!nonempty items $tmp
10980 bpr 58
!for t in $tmp
10981 bpr 59
    !sh sort -f $basedir02/$t/.teacherlist.1 | uniq | grep . >$basedir02/$t/.teacherlist\
10980 bpr 60
       rm -f $basedir02/$t/.teacherlist.1 >/dev/null
10984 bpr 61
    !if $(authidp_method[1;]) iswordof cas php
62
     !sh sort -f $basedir02/$t/.teacherlist_external.1 | uniq | grep . >$basedir02/$t/.teacherlist_external\
10980 bpr 63
  rm -f $basedir02/$t/.teacherlist_external.1 >/dev/null
10984 bpr 64
    !endif
10980 bpr 65
!next
20 reyssat 66
 
10980 bpr 67
!reset tmp