-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser.php
56 lines (42 loc) · 1008 Bytes
/
user.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/*
include("../../phpIncludes/connect.php");
$fart = openDBConnection();
echo "openDBConnection: ";
foreach ($fart as $key => $value) {
echo $key." : ".$value;
}
echo "<br />";
*/
//$sql = "SELECT * FROM rooms WHERE 1";
//$result = mysql_query($sql,$fart);
//print_r ($result);
$dbConnection = OCILogon("aclc", "diggler", "CURL");
if (!$dbConnection) {
print ("aaaaaaak!");
die();
}
//echo $dbConnection;
$result = mysql_query($sql,$dbConnection);
print_r ($result);
function VerifyWesUser($username, $password) {
$adcontroller['0'] = "ldaps://landroval.wesad.wesleyan.edu/";
$adcontroller['1'] = "ldaps://landroval.wesad.wesleyan.edu/";
$adusername = $username . "@wesad.wesleyan.edu";
$ds = ldap_connect($adcontroller[rand(0,1)]);
if (!ds) {
return 0;
}
$ldapbind = @ldap_bind($ds,$adusername,$password);
if ($ldapbind) {
ldap_unbind($ds);
return 1;
} else {
ldap_unbind($ds);
return 0;
}
return 0;
}
$trala = VerifyWesUser('bmorgan', '');
echo $trala; //1 if verified, 0 if not!
?>