Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
20 reyssat 1
 
2
# Input variables: authdef=def file.
3
# Parameters: auth_user, auth_password.
4
 
5
ldap_find=!sh which ldapsearch
6
!if $ldap_find issametext $empty
7
 auth_test=ERROR no_ldap
8
 !exit
9
!endif
10
 
11
ldap_host=!defof class_ldap_host in $authdef
12
ldap_port=!defof class_ldap_port in $authdef
13
!default ldap_port=389
14
ldap_version=!defof class_ldap_version in $authdef
15
!default ldap_version=3
16
ldap_base=!defof class_ldap_base in $authdef
17
ldap_branch=!defof class_ldap_branch in $authdef
414 bpr 18
!default ldap_branch=ou=people
20 reyssat 19
ldap_uid=!defof class_ldap_uid in $authdef
414 bpr 20
!default ldap_uid=uid
20 reyssat 21
 
414 bpr 22
ldap_id=!replace internal " by in $ldap_uid=$(wims_read_parm[1]),$ldap_branch,$ldap_base
20 reyssat 23
 
414 bpr 24
ldap_search=!sh ldapsearch -x -h $ldap_host -p $ldap_port -b "$ldap_id" -D "$ldap_id" -w "$(wims_read_parm[2])"
20 reyssat 25
 
26
ldap_cnt=!linecnt $ldap_search
27
!for i=1 to $ldap_cnt
28
 l=!line $i of $ldap_search
29
 !if $l issametext result: 0 Success
414 bpr 30
  auth_test=OK
20 reyssat 31
 !endif
32
!next i
33
 
34
auth_error=$wims_exec_error
35
wims_exec_error=
36