Subversion Repositories wimsdev

Rev

Rev 5165 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5165 Rev 17665
Line 1... Line -...
1
 
-
 
2
wims_print_precision=15
1
wims_print_precision=15
3
a_=!randint 10^8,10^10
2
a_=!randint 10^8,10^10
4
b_=!randint 10^8,10^10
3
b_=!randint 10^8,10^10
5
cn_code=$a_$b_
4
cn_code=$a_$b_
6
 
5
 
7
url=$back_url?module=adm/raw&ident=$back_ident&passwd=$back_password&code=$cn_code&qclass=$cn_class&rclass=$wims_class&quser=$cn_user
6
url=$back_url?module=adm/raw&ident=$back_ident&passwd=$back_password&code=$cn_code&qclass=$cn_class&rclass=$wims_class&quser=$cn_user
8
!for p in option,data1,data2,format
7
!for p in option,data1,data2,format
9
 CN_$p=!httpquery $(cn_$p)
8
  CN_$p=!httpquery $(cn_$p)
10
!next p
9
!next p
11
URL=$url&job=$cn_method&format=$CN_format&option=$CN_option&data1=$CN_data1&data2=$CN_data2
10
URL=$url&job=$cn_method&format=$CN_format&option=$CN_option&data1=$CN_data1&data2=$CN_data2
12
 
11
 
13
!if $cn_method notwordof getlog getcsv getclassfile getclasstgz
12
!if $cn_method notwordof getlog getcsv getclassfile getclasstgz
14
!! cfr. auth-cas: deal with gzipped data (Content-Encoding: gzip)
13
!! cfr. auth-cas: deal with gzipped data (Content-Encoding: gzip)
15
 tmpdir=$wims_home/tmp/sessions/$wims_session
14
  tmpdir=$wims_home/tmp/sessions/$wims_session
16
 cn_data=!sh export wims_exec_parm="$URL" ; \
15
  cn_data=!sh export wims_exec_parm="$URL" ; \
17
    bin/webget > $tmpdir/getdata.gz ; gunzip -c -f $tmpdir/getdata
16
    bin/webget > $tmpdir/getdata.gz ; gunzip -c -f $tmpdir/getdata
18
!! cn_data=!exec webget $URL
17
!! cn_data=!exec webget $URL
19
 cn_status=!line 1 of $cn_data
18
  cn_status=!line 1 of $cn_data
20
 cn_data=!line 2 to -1 of $cn_data
19
  cn_data=!line 2 to -1 of $cn_data
21
 cn_status=!trim $cn_status
20
  cn_status=!trim $cn_status
22
 cn_status=!upper $cn_status
21
  cn_status=!upper $cn_status
23
 !distribute words $cn_status into cn_status,cnr_code
22
  !distribute words $cn_status into cn_status,cnr_code
24
 !if $cn_status=OK and $cn_method iswordof authuser addclass
23
  !if $cn_status=OK and $cn_method iswordof authuser addclass
25
  cn_data=!word 1 of $cn_data
24
    cn_data=!word 1 of $cn_data
26
 !endif
25
  !endif
27
!else
26
!else
28
 !if $cn_method iswordof getcsv
27
  !if $cn_method iswordof getcsv
29
  tmpdir=$wims_home/tmp/sessions/$wims_session
28
    tmpdir=$wims_home/tmp/sessions/$wims_session
30
  cn_data=!sh export wims_exec_parm="$URL" ; \
29
    cn_data=!sh export wims_exec_parm="$URL" ; \
31
    bin/webget > $tmpdir/getdata.gz ; gunzip -c -f $tmpdir/getdata
30
    bin/webget > $tmpdir/getdata.gz ; gunzip -c -f $tmpdir/getdata
32
  !sh gunzip -c -f $tmpdir/getdata> $wims_home/$wims_sesdir/webget.data
31
    !sh gunzip -c -f $tmpdir/getdata> $wims_home/$wims_sesdir/webget.data
33
!! these lines used to work when getcsv returned the OK+ctl
32
!! these lines used to work when getcsv returned the OK+ctl
34
!! it does not behave like that any longer (except for ERRORS??)
33
!! it does not behave like that any longer (except for ERRORS??)
35
  cn_status=!sh head -1 $wims_home/$wims_sesdir/webget.data
34
    cn_status=!sh head -1 $wims_home/$wims_sesdir/webget.data
36
  !distribute words $cn_status into cn_status,cnr_code
35
    !distribute words $cn_status into cn_status,cnr_code
37
  !if $cn_status issametext ERROR
36
    !if $cn_status issametext ERROR
38
   cn_data=!record 0 of wimshome/$wims_sesdir/webget.data
37
      cn_data=!record 0 of wimshome/$wims_sesdir/webget.data
39
  !endif
38
    !endif
40
!! if getcsv, we are ok if the first word is "login" (FIXME: CHECK THIS)
39
!! if getcsv, we are ok if the first word is "login" (FIXME: CHECK THIS)
41
  !if login isitemof $cn_status
40
    !if login isitemof $cn_status
42
   cn_status=OK
41
      cn_status=OK
43
   cn_code=$cnr_code
42
      cn_code=$cnr_code
44
  !endif
43
    !endif
45
 !else
44
  !else
46
!! FIXME: the only remaining should be getclasstgz?? how about getlog getclassfile
45
!! FIXME: the only remaining should be getclasstgz?? how about getlog getclassfile
47
  tmpdir=$wims_home/tmp/sessions/$wims_session
46
    tmpdir=$wims_home/tmp/sessions/$wims_session
48
  cn_data=!sh export wims_exec_parm="$URL" ; \
47
    cn_data=!sh export wims_exec_parm="$URL" ; \
49
    bin/webget > $wims_home/$wims_sesdir/webget.data 
48
      bin/webget > $wims_home/$wims_sesdir/webget.data
50
!! FIXME: need to insert some check!!
49
!! FIXME: need to insert some check!!
51
  cn_status=OK
50
    cn_status=OK
52
  cn_code=$cnr_code
51
    cn_code=$cnr_code
53
 !endif
52
  !endif
54
!endif
53
!endif
55
 
54
 
56
!if $cn_status=OK and $cn_code!=$cnr_code
55
!if $cn_status=OK and $cn_code!=$cnr_code
57
 cn_status=ERROR
56
  cn_status=ERROR
58
 cn_data=return code discord
57
  cn_data=return code discord
59
!endif
58
!endif
60
 
-