Rev 16143 | Rev 17882 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
16143 | guerimand | 1 | !! decide if right is open or note for the user according to the file .E$exam .S$seq or .$sheet |
2 | !! wims_read_parm : file name |
||
3 | !! output : output=yes output=no |
||
4 | !! condition= the condition string |
||
5 | |||
6 | data_=!record 0 of wimshome/log/classes/$wims_class/.$wims_read_parm |
||
7 | cle_=!word 1 of $data_ |
||
8 | !! process for technical variable definition (replace data_ by value decide by the technical variable) |
||
9 | !if \ isin $cle_ |
||
10 | idtechvar_=!line 1 of $data_ |
||
11 | idtechvar_=!char 2 to -1 of $idtechvar_ |
||
12 | !readproc adm/class/userdef ,$wims_class,$wims_user |
||
13 | val_=!defof user_techvar_$(idtechvar_) in $userdef |
||
14 | !default val_=EMPTY |
||
15 | !reset data_ |
||
16 | data_=!defof techvar_$val_ in wimshome/log/classes/$wims_class/.$wims_read_parm |
||
17 | !default data_=none |
||
16367 | guerimand | 18 | sequence_withtechvar=1 |
16143 | guerimand | 19 | !endif |
20 | !! end process technical variable |
||
21 | |||
22 | condition=$data_ |
||
23 | !! check condition |
||
24 | output=yes |
||
16367 | guerimand | 25 | !! for display of sequence in case of supervisor condition without technical variable are used |
26 | !! (so supervisor can see real page of user) |
||
27 | !if $wims_user=supervisor and (S notin $wims_read_parm or \ isin $cle_) |
||
16143 | guerimand | 28 | !exit |
29 | !endif |
||
16367 | guerimand | 30 | |
16143 | guerimand | 31 | !if $condition=none |
32 | output=no |
||
33 | !exit |
||
34 | !endif |
||
35 | !if $condition!=$empty |
||
36 | data_=!words2items $condition |
||
37 | symb_=<,> |
||
38 | !reset IP_,expiration_,beginning_ |
||
39 | !for l_ in $data_ |
||
40 | !set c_=!char 1 of $l_ |
||
41 | !if $(symb_[1])=$c_ |
||
42 | expiration_=!char 2 to -1 of $l_ |
||
43 | !else |
||
44 | !if $(symb_[2])=$c_ |
||
45 | beginning_=!char 2 to -1 of $l_ |
||
46 | !else |
||
47 | IP_=!text select 0123456789. in $l_ |
||
48 | !endif |
||
49 | !endif |
||
50 | !next l_ |
||
51 | !! !! ------ test for IP |
||
52 | !! !! TODO this test is not operationnel |
||
53 | !! !if $IP_!=$empty_ |
||
54 | !! nb_=!charcnt $IP_ |
||
55 | !! user_=!char 1 to $nb_ of http_REMOTE_ADDR |
||
56 | !! !if $user_!=$IP_ |
||
57 | !! output=no |
||
58 | !! !exit |
||
59 | !! !endif |
||
60 | !! !endif |
||
61 | now_=!text select char 0123456789 in $wims_now |
||
62 | now_=!char 1 to 12 of $now_ |
||
63 | !! ----- test for expiration |
||
64 | !if $expiration_!=$empty |
||
65 | expiration_=!text select char 0123456789 in $expiration_ |
||
66 | !if $now_>$expiration_ |
||
67 | output=no |
||
68 | !exit |
||
69 | !endif |
||
70 | !endif |
||
71 | !! ----- test for begin |
||
72 | !if $beginning_!=$empty |
||
73 | beginning_=!text select char 0123456789 in $beginning_ |
||
74 | !if $now_<$beginning_ |
||
75 | output=no |
||
76 | !exit |
||
77 | !endif |
||
78 | !endif |
||
79 | !endif |