Subversion Repositories wimsdev

Rev

Rev 12190 | Rev 12555 | 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
12190 bpr 17
  url = $wims_ref_name?module=adm/class/classes&$module_init_parm
18
  !read adm/codeurl $url
19
  tmpdir=$wims_home/tmp/sessions/$wims_session
20
  response=!sh export wims_exec_parm="$cas_auth/validate?ticket=$ticket&service=$script_out" ;\
5058 bpr 21
      bin/webget > $tmpdir/getcas ; gunzip -c -f $tmpdir/getcas
12190 bpr 22
  test2 = !line 1 of $response
23
  !if $test2 = yes
24
    auth_user=!line 2 of $response
25
    auth_user=!lowercase $auth_user
26
    auth_test=OK
27
  !else
12191 bpr 28
    response=!sh export wims_exec_parm="$cas_auth/serviceValidate?ticket=$ticket&service=$script_out" ;\
29
    bin/webget > $tmpdir/getcas ; gunzip -c -f $tmpdir/getcas
12190 bpr 30
    !if authenticationFailure notin $response
8429 bpr 31
!!! answer to serviceValidate (xml)
12191 bpr 32
      !set auth_user=!detag $response
12190 bpr 33
      !set auth_user=!nonempty lines $auth_user
34
      !set auth_user=!line 1 of  $auth_user
35
      !set auth_user=!nospace $auth_user
36
      !set auth_user=!lowercase $auth_user
37
      !set auth_test=OK
38
    !else
39
      error=bad_cas_connexion
40
      !exit
41
    !endif
42
  !endif
4993 bpr 43
!endif
5072 bpr 44
auth_user_orig=$auth_user
4993 bpr 45
auth_error=$wims_exec_error
46
wims_exec_error=