Subversion Repositories wimsdev

Rev

Rev 5775 | Rev 12190 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4993 bpr 1
 
5417 bpr 2
!!# Input variables: authdef=def file  / superclass
3
!!# Parameters: NOTHING
4
!!# Output : auth_test,auth_error
4993 bpr 5
 
6
auth_test=ERROR
7
 
5015 bpr 8
cas_auth = !defof class_cas_auth in $authdef
9
!default cas_auth=!defof cas_auth in wimshome/log/wims.conf
4993 bpr 10
 
11
ticket = !replace internal & by $\
12
$ in $module_init_parm
5015 bpr 13
module_init_parm=!replace &ticket=.* by in $module_init_parm
5028 bpr 14
type= !getopt type in $ticket
8429 bpr 15
ticket = !getopt ticket in $ticket
4993 bpr 16
!if $ticket != $empty
5015 bpr 17
   url = $wims_ref_name?module=adm/class/classes&$module_init_parm
4993 bpr 18
   !read adm/codeurl $url
5058 bpr 19
   !!response = !exec webget $cas_auth/validate?ticket=$ticket&service=$script_out
20
   tmpdir=$wims_home/tmp/sessions/$wims_session
21
   response=!sh export wims_exec_parm="$cas_auth/validate?ticket=$ticket&service=$script_out" ;\
22
      bin/webget > $tmpdir/getcas ; gunzip -c -f $tmpdir/getcas
4993 bpr 23
   test2 = !line 1 of $response
24
   !if $test2 = yes
25
      auth_user=!line 2 of $response
5775 bpr 26
      auth_user=!lowercase $auth_user
4993 bpr 27
      auth_test=OK
8429 bpr 28
   !else
29
      !if authenticationFailure notin $response
30
!!! answer to serviceValidate (xml)
31
        !set auth_user=!detag $response
32
        !set auth_user=!nonempty lines $auth_user
33
        !set auth_user=!line 1 of  $auth_user
34
        !set auth_user=!nospace $auth_user
35
        !set auth_user=!lowercase $auth_user
36
        !set auth_test=OK
37
      !else
38
        error=bad_cas_connexion
39
        !exit
40
      !endif
4993 bpr 41
   !endif
42
!endif
5072 bpr 43
auth_user_orig=$auth_user
4993 bpr 44
auth_error=$wims_exec_error
45
wims_exec_error=