Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
5220 guerimand 1
!! output : whoconnect=list of connected participant
2
!!          numpartconnected=number of participant connected
3
!! in wims_class
5426 guerimand 4
!! output for supervisor :
5
!! wims_whoconnect (tabular one line by participant) login,session,firstname,lastname
6
!! wims_connectedlogin : list of connected login
7
!! wims_numpartconnected : number of connected participant.
8
!! output for other user :
9
!! wims_supervisorconnected
5220 guerimand 10
 
5426 guerimand 11
 
12
!let file_=!replace internal / by ~ in $wims_class
5352 guerimand 13
!if $wims_user=supervisor
5420 guerimand 14
 last_=!sh if [ -e $wims_home/tmp/whoconnect/$file_ ]; then\
15
perl -e '@a = stat($ARGV[0]); print $a[9]' $wims_home/tmp/whoconnect/$file_;\
5279 guerimand 16
fi;
5352 guerimand 17
 !default $last_=0
18
 !if $wims_nowseconds-$last_>300 or $wims_read_parm=1
19
  ses_=!sh cd $wims_home/sessions;\
20
  grep -r wims_class=$wims_class ./*/var.stat | cut -d/ -f2;
21
  ses_=!words2items $ses_
5426 guerimand 22
  wims_whoconnect=$empty
5352 guerimand 23
  !for s_ in $ses_
24
   t_=!defof wims_user\
5220 guerimand 25
wims_firstname\
26
wims_lastname in wimshome/sessions/$s_/var.stat
5352 guerimand 27
   !distribute line $t_ into t1_,t2_,t3_
28
   !if $t1_!=supervisor
5426 guerimand 29
    wims_whoconnect=!append line $t1_,$t2_,$t3_,$s_ to $wims_whoconnect
5352 guerimand 30
   !endif
31
  !next s_
5426 guerimand 32
  !writefile wimshome/tmp/whoconnect/$file_ $wims_whoconnect
5352 guerimand 33
 !else
5426 guerimand 34
  wims_whoconnect=!record 0 of wimshome/tmp/whoconnect/$file_
5352 guerimand 35
 !endif
5426 guerimand 36
 wims_connectedlogin=!column 1 of $wims_whoconnect
37
 wims_numpartconnected=!linecnt $wims_whoconnect
5420 guerimand 38
 !setdef user_connected=$wims_session in wimshome/tmp/whoconnect/sup$file_
5352 guerimand 39
!else
5426 guerimand 40
 wims_supervisorconnected=!defof user_connected in wimshome/tmp/whoconnect/sup$file_
41
 !if $wims_supervisorconnected!=$empty
42
  test_=!defof wims_user in wimshome/sessions/$wims_supervisorconnected/var.stat
5352 guerimand 43
  !if $test_=$empty
5426 guerimand 44
   !reset wims_supervisorconnected
5420 guerimand 45
   !setdef user_connected=$empty in wimshome/tmp/whoconnect/sup$file_
5220 guerimand 46
  !endif
5352 guerimand 47
 !endif
5419 guerimand 48
!endif