File: checkuserscorecondition

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (81 lines) | stat: -rw-r--r-- 2,286 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
!! decide if right is open or not for the user according to the file .E$exam .S$seq .$sheet or .F$freework
!! wims_read_parm : file name
!! output : output=yes output=no
!!          condition= the condition string
!!          accessstart= starting access date, if not empty
!!          accessend= ending access date, if not empty

data_=!record 0 of wimshome/log/classes/$wims_class/.$wims_read_parm
cle_=!word 1 of $data_
!! process for technical variable definition (replace data_ by value decide by the technical variable)
!if \ isin $cle_
  idtechvar_=!line 1 of $data_
  idtechvar_=!char 2 to -1 of $idtechvar_
  !readproc adm/class/userdef ,$wims_class,$wims_user
  val_=!defof user_techvar_$(idtechvar_) in $userdef
  !default val_=EMPTY
  !reset data_
  data_=!defof techvar_$val_ in wimshome/log/classes/$wims_class/.$wims_read_parm
  !default data_=none
  sequence_withtechvar=1
!endif
!! end process technical variable

condition=$data_
!! check condition
output=yes
!! for display of sequence in case of supervisor condition without technical variable are used 
!! (so supervisor can see real page of user)
!if $wims_user=supervisor and (S notin $wims_read_parm or \ isin $cle_)
  !exit
!endif

!if $condition=none
  output=no
  !exit
!endif
!if $condition!=$empty
  data_=!words2items $condition
  symb_=<,>
  !reset IP_,accessend,accessstart
  !for l_ in $data_
    !set c_=!char 1 of $l_
    !if $(symb_[1])=$c_
      accessend=!char 2 to -1 of $l_
      accessend=!text select char 0123456789 in $accessend
    !else
      !if $(symb_[2])=$c_
        accessstart=!char 2 to -1 of $l_
        accessstart=!text select char 0123456789 in $accessstart
      !else
        IP_=!text select 0123456789.  in $l_
      !endif
    !endif
  !next l_
  !! ------ test for IP
  !! use function checkhost
  !if $IP_!=$empty_
    nb_=!charcnt $IP_
    test_=!checkhost $IP_
    !if $test_!=1
      output=no
      !exit
    !endif
  !endif
  now_=!text select char 0123456789 in $wims_now
  now_=!char 1 to 12 of $now_
  !! ----- test for expiration
  !if $accessend!=$empty
    !if $now_>$accessend
      output=no
      !exit
    !endif
  !endif
  !! ----- test for begin
  !if $accessstart!=$empty
    !if $now_<$accessstart
      output=no
      !exit
    !endif
  !endif
!endif