File: whoconnect

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (55 lines) | stat: -rw-r--r-- 2,115 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
!! output : whoconnect=list of connected participant
!!          numpartconnected=number of participant connected
!! in wims_class
!! output for supervisor :
!! wims_whoconnect (tabular one line by participant) login,session,firstname,lastname
!! wims_connectedlogin : list of connected login
!! wims_numpartconnected : number of connected participant.
!! output for other user :
!! wims_supervisorconnected


!let file_=!replace internal / by ~ in $wims_class
!if $wims_user=supervisor
  last_=!sh if [ -e $wims_home/tmp/whoconnect/$file_ ]; then\
perl -e '@a = stat($ARGV[0]); print $$a[9]' $wims_home/tmp/whoconnect/$file_;\
fi;
 !default $last_=0
 !if $wims_nowseconds-$last_>300 or $wims_read_parm=1
  ses_=!sh cd $wims_home/sessions;\
  grep -r wims_class=$wims_class ./*/var.stat | cut -d/ -f2;
  ses_=!words2items $ses_
  wims_whoconnect=$empty
  !for s_ in $ses_
   t_=!defof wims_user\
wims_firstname\
wims_lastname in wimshome/sessions/$s_/var.stat
   !distribute line $t_ into t1_,t2_,t3_
   !if $t1_!=supervisor
    !if $t1_ notitemof $wims_connectedlogin
     wims_whoconnect=!append line $t1_,$t2_,$t3_,$s_ to $wims_whoconnect
     wims_connectedlogin=!append item $t1_ to $wims_connectedlogin
    !else
     pos_=!positionof item $t1_ in $wims_connectedlogin
     tmp_=!append item $s_ to $(wims_whoconnect[$pos_;])
     wims_whoconnect=!replace line number $pos_ by $tmp_ in $wims_whoconnect
    !endif
   !endif
  !next s_
  !writefile wimshome/tmp/whoconnect/$file_ $wims_whoconnect
 !else
  wims_whoconnect=!record 0 of wimshome/tmp/whoconnect/$file_
  wims_connectedlogin=!column 1 of $wims_whoconnect
 !endif
 wims_numpartconnected=!linecnt $wims_whoconnect
 !setdef user_connected=$wims_session in wimshome/tmp/whoconnect/sup$file_
!else
 wims_supervisorconnected=!defof user_connected in wimshome/tmp/whoconnect/sup$file_
 !if $wims_supervisorconnected!=$empty
  test_=!defof wims_user in wimshome/sessions/$wims_supervisorconnected/var.stat
  !if $test_=$empty
   !reset wims_supervisorconnected
   !setdef user_connected=$empty in wimshome/tmp/whoconnect/sup$file_
  !endif
 !endif
!endif