Subversion Repositories wimsdev

Rev

Rev 16367 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 16367 Rev 17882
Line 2... Line 2...
2
!! wims_read_parm : file name
2
!! wims_read_parm : file name
3
!! output : output=yes output=no
3
!! output : output=yes output=no
4
!!          condition= the condition string 
4
!!          condition= the condition string
-
 
5
!!          accessstart= starting access date, if not empty
-
 
6
!!          accessend= ending access date, if not empty
5
 
7
 
6
data_=!record 0 of wimshome/log/classes/$wims_class/.$wims_read_parm
8
data_=!record 0 of wimshome/log/classes/$wims_class/.$wims_read_parm
7
cle_=!word 1 of $data_
9
cle_=!word 1 of $data_
8
!! process for technical variable definition (replace data_ by value decide by the technical variable)
10
!! process for technical variable definition (replace data_ by value decide by the technical variable)
9
!if \ isin $cle_
11
!if \ isin $cle_
Line 33... Line 35...
33
  !exit
35
  !exit
34
!endif
36
!endif
35
!if $condition!=$empty
37
!if $condition!=$empty
36
  data_=!words2items $condition
38
  data_=!words2items $condition
37
  symb_=<,>
39
  symb_=<,>
38
  !reset IP_,expiration_,beginning_
40
  !reset IP_,accessend,accessstart
39
  !for l_ in $data_
41
  !for l_ in $data_
40
    !set c_=!char 1 of $l_
42
    !set c_=!char 1 of $l_
41
    !if $(symb_[1])=$c_
43
    !if $(symb_[1])=$c_
42
      expiration_=!char 2 to -1 of $l_
44
      accessend=!char 2 to -1 of $l_
-
 
45
      accessend=!text select char 0123456789 in $accessend
43
    !else
46
    !else
44
      !if $(symb_[2])=$c_
47
      !if $(symb_[2])=$c_
45
        beginning_=!char 2 to -1 of $l_
48
        accessstart=!char 2 to -1 of $l_
-
 
49
        accessstart=!text select char 0123456789 in $accessstart
46
      !else
50
      !else
47
        IP_=!text select 0123456789.  in $l_
51
        IP_=!text select 0123456789.  in $l_
48
      !endif
52
      !endif
49
    !endif
53
    !endif
50
  !next l_
54
  !next l_
51
!!  !! ------ test for IP
55
!!  !! ------ test for IP
52
!!  !! TODO this test is not operationnel
56
!!  !! TODO this test is not operationnel
-
 
57
!!  !! need to be careful: like this, it only works for IP (not for dns names)
53
!!  !if $IP_!=$empty_
58
!!  !if $IP_!=$empty_
54
!!    nb_=!charcnt $IP_
59
!!    nb_=!charcnt $IP_
55
!!    user_=!char 1 to $nb_ of http_REMOTE_ADDR
60
!!    user_=!char 1 to $nb_ of http_REMOTE_ADDR
56
!!    !if $user_!=$IP_
61
!!    !if $user_!=$IP_
57
!!      output=no
62
!!      output=no
Line 59... Line 64...
59
!!    !endif
64
!!    !endif
60
!!  !endif
65
!!  !endif
61
  now_=!text select char 0123456789 in $wims_now
66
  now_=!text select char 0123456789 in $wims_now
62
  now_=!char 1 to 12 of $now_
67
  now_=!char 1 to 12 of $now_
63
  !! ----- test for expiration
68
  !! ----- test for expiration
64
  !if $expiration_!=$empty
69
  !if $accessend!=$empty
65
    expiration_=!text select char 0123456789 in $expiration_
-
 
66
    !if $now_>$expiration_
70
    !if $now_>$accessend
67
      output=no
71
      output=no
68
      !exit
72
      !exit
69
    !endif
73
    !endif
70
  !endif
74
  !endif
71
  !! ----- test for begin
75
  !! ----- test for begin
72
  !if $beginning_!=$empty
76
  !if $accessstart!=$empty
73
    beginning_=!text select char 0123456789 in $beginning_
-
 
74
    !if $now_<$beginning_
77
    !if $now_<$accessstart
75
      output=no
78
      output=no
76
      !exit
79
      !exit
77
    !endif
80
    !endif
78
  !endif
81
  !endif
79
!endif
82
!endif