Commit deaac85516b451013afd0bf603509728105ebe9c
1 parent
012783b6
Exists in
master
and in
1 other branch
- excluído arquivo desnecessário
git-svn-id: http://svn.softwarepublico.gov.br/svn/cacic/cacic/trunk/gerente@909 fecfc0c7-e812-0410-ae72-849f08638ee7
Showing
1 changed file
with
0 additions
and
91 deletions
Show diff stats
ldap.php
... | ... | @@ -1,91 +0,0 @@ |
1 | -<? | |
2 | -// LDAP variables | |
3 | - | |
4 | -$ldaphost = "dataprevasdfdsf"; // your ldap servers | |
5 | -$ldapport = 389; // your ldap server's port number | |
6 | - | |
7 | -// Connecting to LDAP | |
8 | -$ldapconn = ldap_connect($ldaphost, $ldapport) | |
9 | - or die("Could not connect to $ldaphost"); | |
10 | -echo 'OK!'; | |
11 | - | |
12 | -$strMessage = ''; | |
13 | -if ($_POST['btLogin']==' Login ') | |
14 | - { | |
15 | - | |
16 | - function ldap_binder($strDomainName,$strUserName,$strUserPassword) | |
17 | - { | |
18 | - $ldap_addr = $strDomainName; // Change this to the IP address of the LDAP server | |
19 | - $ldap_conn = ldap_connect($ldap_addr) or die("Couldn't connect!"); | |
20 | - ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3); | |
21 | - $ldap_rdn = $strDomainName."\\".$strUserName; | |
22 | - $ldap_pass = $strUserPassword; | |
23 | - | |
24 | - // Authenticate the user against the domain controller | |
25 | - $flag_ldap = ldap_bind($ldap_conn,$ldap_rdn,$ldap_pass); | |
26 | - return $flag_ldap; | |
27 | - } | |
28 | - | |
29 | - // bind with appropriate dn to give update access | |
30 | - $r = ldap_binder($_POST['frmDomainName'],$_POST['frmUserName'], $_POST['frmUserPassword']); | |
31 | - echo 'R=> '.$r. "<br />"; | |
32 | - | |
33 | - | |
34 | - | |
35 | -$attrs = get_entry_system_attrs( $ldap_conn, $ldap_rdn, $deref=LDAP_DEREF_NEVER ); | |
36 | - | |
37 | -for ($i=0; $i < count($attrs); $i++) | |
38 | - echo '=> '.$attrs[$i] . "<br />"; | |
39 | - | |
40 | - $strMessage = '<font size=2 color='; | |
41 | - // verify binding | |
42 | - echo 'r0=>'.$r[0].'<br>'; | |
43 | - echo 'r1=>'.$r[1].'<br>'; | |
44 | - if ($r) | |
45 | - $strMessage .= 'blue>Conexão Efetuada no Domínio!'; | |
46 | - else | |
47 | - $strMessage .= 'red>Conexão NÃO Efetuada no Domínio!'; | |
48 | - | |
49 | - $strMessage .= '</font>'; | |
50 | - } | |
51 | -?> | |
52 | -<form id="form1" name="form1" method="post" action=""> | |
53 | -<table width="200" border="0" align="center" cellpadding="0" cellspacing="0"> | |
54 | - | |
55 | - <tr> | |
56 | - <td><div align="center">Domínio</div></td> | |
57 | - <td><div align="center"></div></td> | |
58 | - <td><div align="center">Usuário</div></td> | |
59 | - <td><div align="center"></div></td> | |
60 | - <td><div align="center">Senha</div></td> | |
61 | - </tr> | |
62 | - <tr> | |
63 | - <td> | |
64 | - <label> | |
65 | - <div align="center"> | |
66 | - <input name="frmDomainName" type="text" id="frmDomainName" size="20" maxlength="20" /> | |
67 | - </div> | |
68 | - </label> </td> | |
69 | - <td><div align="center"></div></td> | |
70 | - <td><div align="center"> | |
71 | - <input name="frmUserName2" type="text" id="frmUserName2" size="20" maxlength="20" /> | |
72 | - </div></td> | |
73 | - <td><div align="center"></div></td> | |
74 | - <td><div align="center"> | |
75 | - <input name="frmUserPassword" type="password" id="frmUserPassword" size="20" maxlength="20" /> | |
76 | - </div></td> | |
77 | - </tr> | |
78 | - <tr> | |
79 | - <td colspan="5"><div align="center"><? echo $strMessage;?> | |
80 | - </div> | |
81 | - <div align="center"></div></td> | |
82 | - </tr> | |
83 | - | |
84 | - <tr> | |
85 | - <td colspan="5"><div align="center"> | |
86 | - <input type="submit" name="btLogin" id="btLogin" value=" Login " /> | |
87 | - </div></td> | |
88 | - </tr> | |
89 | -</table> | |
90 | - | |
91 | -</form> | |
92 | 0 | \ No newline at end of file |