Subversion Repositories wimsdev

Rev

Rev 5419 | Rev 5426 | 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
4
!!
5
!!
6
 
5352 guerimand 7
!if $wims_user=supervisor
8
 !let file_=!replace internal / by ~ in $wims_class
5420 guerimand 9
 last_=!sh if [ -e $wims_home/tmp/whoconnect/$file_ ]; then\
10
perl -e '@a = stat($ARGV[0]); print $a[9]' $wims_home/tmp/whoconnect/$file_;\
5279 guerimand 11
fi;
5352 guerimand 12
 !default $last_=0
13
 !if $wims_nowseconds-$last_>300 or $wims_read_parm=1
14
  ses_=!sh cd $wims_home/sessions;\
15
  grep -r wims_class=$wims_class ./*/var.stat | cut -d/ -f2;
16
  ses_=!words2items $ses_
17
  whoconnect=$empty
18
  !for s_ in $ses_
19
   t_=!defof wims_user\
5220 guerimand 20
wims_firstname\
21
wims_lastname in wimshome/sessions/$s_/var.stat
5352 guerimand 22
   !distribute line $t_ into t1_,t2_,t3_
23
   !if $t1_!=supervisor
24
    whoconnect=!append line $t1_,$s_,$t2_,$t3_ to $whoconnect
25
   !endif
26
  !next s_
5420 guerimand 27
  !writefile wimshome/tmp/whoconnect/$file_ $whoconnect
5352 guerimand 28
 !else
5420 guerimand 29
  whoconnect=!record 0 of wimshome/tmp/whoconnect/$file_
5352 guerimand 30
 !endif
31
 numpartconnected=!linecnt $whoconnect
5420 guerimand 32
 !setdef user_connected=$wims_session in wimshome/tmp/whoconnect/sup$file_
5352 guerimand 33
!else
5420 guerimand 34
 supervisorconnected=!defof user_connected in wimshome/tmp/whoconnect/sup$file_
5352 guerimand 35
 !if $supervisorconnected!=$empty
36
  test_=!defof wims_user in wimshome/sessions/$supervisorconnected/var.stat
37
  !if $test_=$empty
38
   !reset supervisorconnected
5420 guerimand 39
   !setdef user_connected=$empty in wimshome/tmp/whoconnect/sup$file_
5220 guerimand 40
  !endif
5352 guerimand 41
 !endif
5419 guerimand 42
!endif