Subversion Repositories wimsdev

Rev

Rev 17882 | Details | Compare with Previous | Last modification | View Log | RSS feed

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