Rev 20 | Rev 5165 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 20 | Rev 5163 | ||
---|---|---|---|
Line 9... | Line 9... | ||
9 | CN_$p=!httpquery $(cn_$p) |
9 | CN_$p=!httpquery $(cn_$p) |
10 | !next p |
10 | !next p |
11 | URL=$url&job=$cn_method&format=$CN_format&option=$CN_option&data1=$CN_data1&data2=$CN_data2 |
11 | URL=$url&job=$cn_method&format=$CN_format&option=$CN_option&data1=$CN_data1&data2=$CN_data2 |
12 | 12 | ||
13 | !if $cn_method notwordof getlog getcsv getclassfile getclasstgz |
13 | !if $cn_method notwordof getlog getcsv getclassfile getclasstgz |
- | 14 | !! cfr. auth-cas: deal with gzipped data (Content-Encoding: gzip) |
|
- | 15 | tmpdir=$wims_home/tmp/sessions/$wims_session |
|
- | 16 | cn_data=!sh export wims_exec_parm="$URL" ; \ |
|
- | 17 | bin/webget > $tmpdir/getdata.gz ; gunzip -c -f $tmpdir/getdata |
|
14 | cn_data=!exec webget $URL |
18 | !! cn_data=!exec webget $URL |
15 | cn_status=!line 1 of $cn_data |
19 | cn_status=!line 1 of $cn_data |
16 | cn_data=!line 2 to -1 of $cn_data |
20 | cn_data=!line 2 to -1 of $cn_data |
17 | cn_status=!trim $cn_status |
21 | cn_status=!trim $cn_status |
18 | cn_status=!upper $cn_status |
22 | cn_status=!upper $cn_status |
19 | !distribute words $cn_status into cn_status,cnr_code |
23 | !distribute words $cn_status into cn_status,cnr_code |
20 | !if $cn_status=OK and $cn_method iswordof authuser addclass |
24 | !if $cn_status=OK and $cn_method iswordof authuser addclass |
21 | cn_data=!word 1 of $cn_data |
25 | cn_data=!word 1 of $cn_data |
22 | !endif |
26 | !endif |
23 | !else |
27 | !else |
- | 28 | tmpdir=$wims_home/tmp/sessions/$wims_session |
|
- | 29 | cn_data=!sh export wims_exec_parm="$URL" ; \ |
|
- | 30 | bin/webget > $tmpdir/getdata.gz ; gunzip -c -f $tmpdir/getdata |
|
- | 31 | !sh gunzip -c -f $tmpdir/getdata> $wims_home/$wims_sesdir/webget.data |
|
- | 32 | !! these lines used to work when getcsv returned the OK+ctl |
|
- | 33 | !! it does not behave like that any longer (except for ERROR??) |
|
- | 34 | cn_status=!sh cd $tmpdir >/dev/null;\ |
|
24 |
|
35 | zcat getdata.gz | head -1;\ |
- | 36 | zcat getdata.gz | tail --lines=+2 >webget.data 2>/dev/null |
|
25 |
|
37 | !! webget_output=webget.out |
26 | cn_status=!sh cd ../$wims_sesdir >/dev/null\ |
38 | !! cn_status=!sh cd ../$wims_sesdir >/dev/null\ |
27 | head -1 webget.out\ |
39 | !! head -1 webget.out\ |
28 | tail +2 webget.out >webget.data 2>/dev/null |
40 | !! tail +2 webget.out >webget.data 2>/dev/null |
29 | !distribute words $cn_status into cn_status,cnr_code |
41 | !distribute words $cn_status into cn_status,cnr_code |
30 | !if $cn_status issametext ERROR |
42 | !if $cn_status issametext ERROR |
31 | cn_data=!record 0 of wimshome/$wims_sesdir/webget.data |
43 | cn_data=!record 0 of wimshome/$wims_sesdir/webget.data |
- | 44 | !endif |
|
- | 45 | !! if getcsv, we are ok if the first word is "login" (CHECK THIS) |
|
- | 46 | !if login isitemof $cn_status |
|
- | 47 | cn_status=OK |
|
- | 48 | cn_code=$cnr_code |
|
32 | !endif |
49 | !endif |
33 | !endif |
50 | !endif |
34 | 51 | ||
35 | !if $cn_status=OK and $cn_code!=$cnr_code |
52 | !if $cn_status=OK and $cn_code!=$cnr_code |
36 | cn_status=ERROR |
53 | cn_status=ERROR |