GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/Scheduler/User/ |
Upload File : |
<? // User/AuthenticateUserNetware.php if ($DEBUG_AuthenticateUser) echo "<b>".basename(__FILE__).":".__LINE__.":</b><br>\n"; ini_set('include_path',ini_get('include_path').PATH_SEPARATOR.$_SERVER['DOCUMENT_ROOT']."/"); // Add the DOCUMENT_ROOT to the include_path. $skipAuthentication = true; include('application.phpinc'); //$DEBUG_AuthenticateUser = true; // if ($DEBUG_AuthenticateUser) echo "<b>".basename(__FILE__).":".__LINE__.":</b><br>\n"; if ($DEBUG_AuthenticateUser) echo __FILE__." on ".$_SERVER['HTTP_HOST']."<br>\n"; $searchstring="(objectclass=user)"; $attnames=array("dn","cn","surname","mail","groupmembership"); $server = "kermit.ridgewater.edu"; //replace this with the DNS hostname or IP of your server !!! if ($DEBUG_AuthenticateUser) echo "\$server=".$server."<br>\n"; if ($DEBUG_AuthenticateUser) echo "\$f['username']=".$f['username']."<br>\n"; if ($DEBUG_AuthenticateUser) echo "\$f['password']=".$f['password']."<br>\n"; $cn = "cn=".$f['username']; $pw = $f['password']; $dn = array(); $dn[] = ",ou=Student,o=HC"; $dn[] = ",ou=Staff,o=HC"; $dn[] = ",ou=Student,ou=Electronics,o=WC"; $dn[] = ",ou=Student,o=WC"; $dn[] = ",ou=Staff,o=WC"; $nds = ldap_connect($server,389); $current_error_reporting = ini_get("error_reporting"); error_reporting(E_ERROR); $sr = false; foreach ($dn as $thisDN) { if (!$sr) { if ($DEBUG_AuthenticateUser) echo "\$thisDN=".$thisDN." \n"; $sr = ldap_bind($nds, $cn.$thisDN, $pw); if ($DEBUG_AuthenticateUser) { if ($sr) { echo "true"; } else { echo "false"; } echo "<br>\n"; } if ($sr) { $dnUsed = $thisDN; } } } if(!$sr){ echo "Not Authenticated;"; echo ldap_error($nds); exit; } error_reporting($current_error_reporting); // Search surname entry $dn = $cn.$dnUsed; if ($DEBUG_AuthenticateUser) echo "\$dn=".$dn."\n"; $sr=ldap_search($nds, $dn, "sn=*"); if ($DEBUG_AuthenticateUser) echo "Search result is " . $sr . "<br>\n"; if ($DEBUG_AuthenticateUser) echo "Number of entires returned is " . ldap_count_entries($nds, $sr) . "<br>\n"; if ($DEBUG_AuthenticateUser) echo "Getting entries ..." . "<br>\n"; $info = ldap_get_entries($nds, $sr); if ($DEBUG_AuthenticateUser) echo "Data for " . $info["count"] . " items returned:" . "<br>\n"; for ($i=0; $i<$info["count"]; $i++) { echo "Authenticated;"; echo $f['username'] . ";"; echo $f['password'] . ";"; echo $info[$i]["givenname"][0] . ";"; echo $info[$i]["sn"][0] . ";"; echo $info[$i]["mail"][0] . ";"; echo $info[$i]["dn"] . ";"; if (isset($info[$i]['logingraceremaining'])) { echo $info[$i]['logingraceremaining'][0] . ";"; } else { echo "6;"; } } // passwordexpirationtime if ($DEBUG_AuthenticateUser) { print_r(getdate())."<br>\n"; echo "<PRE>"; print_r($info); echo "</PRE>\n"; echo "Closing connection"; } ldap_close($nds); ?>