Rev 16367 | Go to most recent revision | Details | 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 |
||
18 | !endif |
||
19 | !! end process technical variable |
||
20 | |||
21 | condition=$data_ |
||
22 | !! check condition |
||
23 | output=yes |
||
24 | !if $wims_user=supervisor |
||
25 | !exit |
||
26 | !endif |
||
27 | !if $condition=none |
||
28 | output=no |
||
29 | !exit |
||
30 | !endif |
||
31 | !if $condition!=$empty |
||
32 | data_=!words2items $condition |
||
33 | symb_=<,> |
||
34 | !reset IP_,expiration_,beginning_ |
||
35 | !for l_ in $data_ |
||
36 | !set c_=!char 1 of $l_ |
||
37 | !if $(symb_[1])=$c_ |
||
38 | expiration_=!char 2 to -1 of $l_ |
||
39 | !else |
||
40 | !if $(symb_[2])=$c_ |
||
41 | beginning_=!char 2 to -1 of $l_ |
||
42 | !else |
||
43 | IP_=!text select 0123456789. in $l_ |
||
44 | !endif |
||
45 | !endif |
||
46 | !next l_ |
||
47 | !! !! ------ test for IP |
||
48 | !! !! TODO this test is not operationnel |
||
49 | !! !if $IP_!=$empty_ |
||
50 | !! nb_=!charcnt $IP_ |
||
51 | !! user_=!char 1 to $nb_ of http_REMOTE_ADDR |
||
52 | !! !if $user_!=$IP_ |
||
53 | !! output=no |
||
54 | !! !exit |
||
55 | !! !endif |
||
56 | !! !endif |
||
57 | now_=!text select char 0123456789 in $wims_now |
||
58 | now_=!char 1 to 12 of $now_ |
||
59 | !! ----- test for expiration |
||
60 | !if $expiration_!=$empty |
||
61 | expiration_=!text select char 0123456789 in $expiration_ |
||
62 | !if $now_>$expiration_ |
||
63 | output=no |
||
64 | !exit |
||
65 | !endif |
||
66 | !endif |
||
67 | !! ----- test for begin |
||
68 | !if $beginning_!=$empty |
||
69 | beginning_=!text select char 0123456789 in $beginning_ |
||
70 | !if $now_<$beginning_ |
||
71 | output=no |
||
72 | !exit |
||
73 | !endif |
||
74 | !endif |
||
75 | !endif |