Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
14777 guerimand 1
!! job=wiewpage
2
!! supervisor can view page of participant connected to the tchat
14779 bpr 3
!!
14777 guerimand 4
 
5
!! -------- user check
6
!bound user within $ulist default $empty
7
!if $user=$empty
8
  error=nouser
9
  !exit
10
!endif
11
 
12
!! -------- check if authorized session
14783 guerimand 13
list_window=!defof $user in wimshome/s2/$wims_session/.indexusersession
14
nbwindow=!itemcnt $list_window
15
!if $numberses<1 or $numberses>$nbwindow
14777 guerimand 16
  error=usernotintchat
17
  !exit
18
!endif
14783 guerimand 19
userses=!item $numberses of $list_window
20
test=!fileexists wimshome/s2/$userses/last.html
21
!if tchat isin $userses or $test!=yes
14777 guerimand 22
  error=addressplay
14779 bpr 23
  !exit
14777 guerimand 24
!endif
25
 
26
po=!positionof item $user in $ulist
14861 guerimand 27
username=$(nlist[$po])
14783 guerimand 28
name_title=$username $name_page $numberses
14777 guerimand 29
 
14783 guerimand 30
!!basesession=!replace internal _ by , in $userses
31
!!basesession=!item 1 of $basesession
32
!!basesession=!nospace $basesession
33
 
34
!! ---------- make list of file of the user
35
!! the file of list_forbiddent are ignored (to be completed if need)
36
list_forbidden=last.html
37
listfile=!sh cd $wims_home/s2/$userses;\
38
ls *
39
listfile=!lines2items $listfile
40
listfile=!listcomplement $list_forbidden in $listfile
41
listsed=$empty
42
listlink=$empty
43
!for f in $listfile
44
  listsed=!append line s#$f#user$po-$f#g; to $listsed
45
  listlink=!append line ln -s $wims_home/s2/$userses/$f $wims_home/s2/$wims_session/user$po-$f; to $listlink
46
!next f
14777 guerimand 47
!! ---------- build copy of user page
48
!read oef/fr/names
14783 guerimand 49
 
14886 guerimand 50
 
51
page_content=!sh sed -n '/<!--BEGINSUPVIEW-->/,/<!--ENDSUPVIEW-->/p' $wims_home/s2/$userses/last.html | sed 's#<a[^>]*>#<font color="blue"><u>#gi;\
14777 guerimand 52
s#</a>#</u></font>#gi;\
53
s#<form[^>]*># #gi;\
54
s#</form># #gi;\
14783 guerimand 55
s#$(userses)#$wims_session#gi;\
56
$listsed'
14777 guerimand 57
 
14783 guerimand 58
!! make link to file of the user_session in supervisor_session (del old link before)
59
list=!sh cd $wims_home/s2/$wims_session;\
14886 guerimand 60
lt=`find user$(po)* -type l 2>/dev/null`;\
14783 guerimand 61
for f in $$lt; do rm $$f; done;\
62
$listlink
63
 
14777 guerimand 64
warning=workinprogress
65
 
14886 guerimand 66
!let rd=!randint 111111,999999
67
local_html_header=<META HTTP-EQUIV="Refresh" CONTENT="5;wims.cgi?session=$wims_session&+cmd=reply&+module=adm/class/tchat&+job=viewpage&+numberses=$k&+user=$user">
14777 guerimand 68
 
14886 guerimand 69
!exit
70
 
71
 
72
 
73
!! ----------- not in use
74
 
75
 
76
page_content=!sh sed -n '/<!--BEGINSUPVIEW-->/,/<!--ENDSUPVIEW-->/p' $wims_home/s2/$userses/last.html | sed 's#<a[^>]*>#<font color="blue"><u>#gi;\
77
s#</a>#</u></font>#gi;\
78
s#<form[^>]*># #gi;\
79
s#</form># #gi;\
80
s#$(userses)#$wims_session#gi;\
81
s#id="exo_giveup_opener"# #gi;\
82
$listsed'
83
 
84
page_content=!sh sed -n '/<!--BEGINSUPVIEW-->/,/<!--ENDSUPVIEW-->/p' $wims_home/s2/$userses/last.html | sed -n '/<script>/,/<\/script>/!p' | sed 's#<a[^>]*>#<font color="blue"><u>#gi;\
85
s#</a>#</u></font>#gi;\
86
s#<form[^>]*># #gi;\
87
s#</form># #gi;\
88
s#$(userses)#$wims_session#gi;\
89
$listsed'