Rev 14913 | Rev 16355 | 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 | |
14912 | guerimand | 50 | page_content=!sh sed '1,3d' $wims_home/s2/$userses/last.html | sed 's#$(userses)#$wims_session#gi;\ |
51 | s#<a href="[^"]*"#<a href=""#gi;\ |
||
52 | s# target="[^"]*"# #gi;\ |
||
53 | s#<input type="submit"#<input type="submit" disabled #gi;\ |
||
14913 | guerimand | 54 | s#<input type="image"#<img #gi;\ |
14912 | guerimand | 55 | s#<button #<button disabled #gi;\ |
56 | s#onclick="wims_[a-zA-Z0-9^=]*=window.open([^)]*)"# #gi;\ |
||
14783 | guerimand | 57 | $listsed' |
14777 | guerimand | 58 | |
14783 | guerimand | 59 | !! make link to file of the user_session in supervisor_session (del old link before) |
60 | list=!sh cd $wims_home/s2/$wims_session;\ |
||
14886 | guerimand | 61 | lt=`find user$(po)* -type l 2>/dev/null`;\ |
14783 | guerimand | 62 | for f in $$lt; do rm $$f; done;\ |
63 | $listlink |
||
64 | |||
14777 | guerimand | 65 | warning=workinprogress |
66 | |||
14912 | guerimand | 67 | !! --- suppress auto refresh (need to put a button to refresh) |
14886 | guerimand | 68 | !let rd=!randint 111111,999999 |
14912 | guerimand | 69 | !!local_html_header=<META HTTP-EQUIV="Refresh" CONTENT="$(tchat_refreshtiming);wims.cgi?session=$wims_session&+cmd=reply&+module=adm/class/tchat&+job=viewpage&+numberses=$k&+user=$user"> |
15316 | guerimand | 70 | !set wims_menu_items=!append line refresh,1,module=$module&cmd=reply&+module=adm/class/tchat&+job=viewpage&+numberses=$numberses&+user=$user&+serial=$rd to $wims_menu_items |
14777 | guerimand | 71 | |
14886 | guerimand | 72 |