Server geändert
This commit is contained in:
@ -2,7 +2,7 @@ adLDAP - PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
|
||||
|
||||
Written by Scott Barnett, Richard Hyland
|
||||
email: scott@wiggumworld.com, adldap@richardhyland.com
|
||||
http://adldap.sourceforge.net/
|
||||
https://adldap.sourceforge.net/
|
||||
|
||||
|
||||
CHANGELOG
|
||||
|
@ -3,7 +3,7 @@ Version 3.3.2
|
||||
|
||||
Written by Scott Barnett, Richard Hyland
|
||||
email: scott@wiggumworld.com, adldap@richardhyland.com
|
||||
http://adldap.sourceforge.net/
|
||||
https://adldap.sourceforge.net/
|
||||
|
||||
We'd appreciate any improvements or additions to be submitted back
|
||||
to benefit the entire community :)
|
||||
@ -15,11 +15,11 @@ called "includes/". If you want to use somewhere else, just edit the
|
||||
include directives in the scripts.
|
||||
|
||||
The examples should be pretty self explanatory. If you require more
|
||||
information, please visit http://adldap.sourceforge.net/
|
||||
information, please visit https://adldap.sourceforge.net/
|
||||
|
||||
-------------------
|
||||
|
||||
For full API documentation see http://adldap.sourceforge.net/wiki/doku.php?id=api
|
||||
For full API documentation see https://adldap.sourceforge.net/wiki/doku.php?id=api
|
||||
|
||||
1. Copy adLDAP.php to your server
|
||||
2. Edit the configuring variables in the class itself if you so wish to
|
||||
|
@ -1,2 +1,2 @@
|
||||
http://www.administrator.de/index.php?content=31891
|
||||
http://www.php.de/php-einsteiger/50623-login-mittels-active-directory-ldap.html
|
||||
https://www.administrator.de/index.php?content=31891
|
||||
https://www.php.de/php-einsteiger/50623-login-mittels-active-directory-ldap.html
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
* Written by Scott Barnett, Richard Hyland
|
||||
* email: scott@wiggumworld.com, adldap@richardhyland.com
|
||||
* http://adldap.sourceforge.net/
|
||||
* https://adldap.sourceforge.net/
|
||||
*
|
||||
* Copyright (c) 2006-2010 Scott Barnett, Richard Hyland
|
||||
*
|
||||
@ -28,10 +28,10 @@
|
||||
* @package adLDAP
|
||||
* @author Scott Barnett, Richard Hyland
|
||||
* @copyright (c) 2006-2010 Scott Barnett, Richard Hyland
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
|
||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
|
||||
* @revision $Revision: 91 $
|
||||
* @version 3.3.2
|
||||
* @link http://adldap.sourceforge.net/
|
||||
* @link https://adldap.sourceforge.net/
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -57,7 +57,7 @@ define ('ADLDAP_CONTAINER', 'CN');
|
||||
* much information on other users as you could as a domain admin.
|
||||
*
|
||||
* Before asking questions, please read the Documentation at
|
||||
* http://adldap.sourceforge.net/wiki/doku.php?id=api
|
||||
* https://adldap.sourceforge.net/wiki/doku.php?id=api
|
||||
*/
|
||||
class adLDAP {
|
||||
/**
|
||||
@ -98,7 +98,7 @@ class adLDAP {
|
||||
protected $_ad_password=NULL;
|
||||
|
||||
/**
|
||||
* AD does not return the primary group. http://support.microsoft.com/?kbid=321360
|
||||
* AD does not return the primary group. https://support.microsoft.com/?kbid=321360
|
||||
* This tweak will resolve the real primary group.
|
||||
* Setting to false will fudge "Domain Users" and is much faster. Keep in mind though that if
|
||||
* someone's primary group is NOT domain users, this is obviously going to mess up the results
|
||||
@ -109,7 +109,7 @@ class adLDAP {
|
||||
|
||||
/**
|
||||
* Use SSL (LDAPS), your server needs to be setup, please see
|
||||
* http://adldap.sourceforge.net/wiki/doku.php?id=ldap_over_ssl
|
||||
* https://adldap.sourceforge.net/wiki/doku.php?id=ldap_over_ssl
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@ -340,7 +340,7 @@ class adLDAP {
|
||||
}
|
||||
|
||||
if ($this->ldap_supported() === false) {
|
||||
throw new adLDAPException('No LDAP support for PHP. See: http://www.php.net/ldap');
|
||||
throw new adLDAPException('No LDAP support for PHP. See: https://www.php.net/ldap');
|
||||
}
|
||||
|
||||
return $this->connect();
|
||||
@ -1030,13 +1030,13 @@ class adLDAP {
|
||||
*
|
||||
* @param string $username The username to query
|
||||
* @param book $isGUID Is the username passed a GUID or a samAccountName
|
||||
* @requires bcmath http://www.php.net/manual/en/book.bc.php
|
||||
* @requires bcmath https://www.php.net/manual/en/book.bc.php
|
||||
* @return array
|
||||
*/
|
||||
public function user_password_expiry($username,$isGUID=false) {
|
||||
if ($username===NULL){ return ("Missing compulsory field [username]"); }
|
||||
if (!$this->_bind){ return (false); }
|
||||
if (!function_exists('bcmod')) { return ("Missing function support [bcmod] http://www.php.net/manual/en/book.bc.php"); };
|
||||
if (!function_exists('bcmod')) { return ("Missing function support [bcmod] https://www.php.net/manual/en/book.bc.php"); };
|
||||
|
||||
$userinfo = $this->user_info($username, array("pwdlastset", "useraccountcontrol"), $isGUID);
|
||||
$pwdlastset = $userinfo[0]['pwdlastset'][0];
|
||||
@ -1065,7 +1065,7 @@ class adLDAP {
|
||||
$maxpwdage = $info[0]['maxpwdage'][0];
|
||||
|
||||
|
||||
// See MSDN: http://msdn.microsoft.com/en-us/library/ms974598.aspx
|
||||
// See MSDN: https://msdn.microsoft.com/en-us/library/ms974598.aspx
|
||||
//
|
||||
// pwdLastSet contains the number of 100 nanosecond intervals since January 1, 1601 (UTC),
|
||||
// stored in a 64 bit integer.
|
||||
@ -1467,7 +1467,7 @@ class adLDAP {
|
||||
|
||||
/**
|
||||
* Returns a folder listing for a specific OU
|
||||
* See http://adldap.sourceforge.net/wiki/doku.php?id=api_folder_functions
|
||||
* See https://adldap.sourceforge.net/wiki/doku.php?id=api_folder_functions
|
||||
*
|
||||
* @param array $folder_name An array to the OU you wish to list.
|
||||
* If set to NULL will list the root, strongly recommended to set
|
||||
@ -1681,7 +1681,7 @@ class adLDAP {
|
||||
|
||||
/**
|
||||
* Add an X400 address to Exchange
|
||||
* See http://tools.ietf.org/html/rfc1685 for more information.
|
||||
* See https://tools.ietf.org/html/rfc1685 for more information.
|
||||
* An X400 Address looks similar to this X400:c=US;a= ;p=Domain;o=Organization;s=Doe;g=John;
|
||||
*
|
||||
* @param string $username The username of the user to add the X400 to to
|
||||
@ -2090,7 +2090,7 @@ class adLDAP {
|
||||
|
||||
/**
|
||||
* Coping with AD not returning the primary group
|
||||
* http://support.microsoft.com/?kbid=321360
|
||||
* https://support.microsoft.com/?kbid=321360
|
||||
*
|
||||
* For some reason it's not possible to search on primarygrouptoken=XXX
|
||||
* If someone can show otherwise, I'd like to know about it :)
|
||||
@ -2121,7 +2121,7 @@ class adLDAP {
|
||||
|
||||
/**
|
||||
* Coping with AD not returning the primary group
|
||||
* http://support.microsoft.com/?kbid=321360
|
||||
* https://support.microsoft.com/?kbid=321360
|
||||
*
|
||||
* This is a re-write based on code submitted by Bruce which prevents the
|
||||
* need to search each security group to find the true primary group
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
* Written by Scott Barnett, Richard Hyland
|
||||
* email: scott@wiggumworld.com, adldap@richardhyland.com
|
||||
* http://adldap.sourceforge.net/
|
||||
* https://adldap.sourceforge.net/
|
||||
*
|
||||
* Copyright (c) 2006-2010 Scott Barnett, Richard Hyland
|
||||
*
|
||||
@ -28,10 +28,10 @@
|
||||
* @package adLDAP
|
||||
* @author Scott Barnett, Richard Hyland
|
||||
* @copyright (c) 2006-2010 Scott Barnett, Richard Hyland
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
|
||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
|
||||
* @revision $Revision: 91 $
|
||||
* @version 3.3.2
|
||||
* @link http://adldap.sourceforge.net/
|
||||
* @link https://adldap.sourceforge.net/
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -57,7 +57,7 @@ define ('ADLDAP_CONTAINER', 'CN');
|
||||
* much information on other users as you could as a domain admin.
|
||||
*
|
||||
* Before asking questions, please read the Documentation at
|
||||
* http://adldap.sourceforge.net/wiki/doku.php?id=api
|
||||
* https://adldap.sourceforge.net/wiki/doku.php?id=api
|
||||
*/
|
||||
class adLDAP {
|
||||
/**
|
||||
@ -101,7 +101,7 @@ class adLDAP {
|
||||
protected $_ad_password="ldHS332";
|
||||
|
||||
/**
|
||||
* AD does not return the primary group. http://support.microsoft.com/?kbid=321360
|
||||
* AD does not return the primary group. https://support.microsoft.com/?kbid=321360
|
||||
* This tweak will resolve the real primary group.
|
||||
* Setting to false will fudge "Domain Users" and is much faster. Keep in mind though that if
|
||||
* someone's primary group is NOT domain users, this is obviously going to mess up the results
|
||||
@ -112,7 +112,7 @@ class adLDAP {
|
||||
|
||||
/**
|
||||
* Use SSL (LDAPS), your server needs to be setup, please see
|
||||
* http://adldap.sourceforge.net/wiki/doku.php?id=ldap_over_ssl
|
||||
* https://adldap.sourceforge.net/wiki/doku.php?id=ldap_over_ssl
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@ -343,7 +343,7 @@ class adLDAP {
|
||||
}
|
||||
|
||||
if ($this->ldap_supported() === false) {
|
||||
throw new adLDAPException('No LDAP support for PHP. See: http://www.php.net/ldap');
|
||||
throw new adLDAPException('No LDAP support for PHP. See: https://www.php.net/ldap');
|
||||
}
|
||||
|
||||
return $this->connect();
|
||||
@ -1033,13 +1033,13 @@ class adLDAP {
|
||||
*
|
||||
* @param string $username The username to query
|
||||
* @param book $isGUID Is the username passed a GUID or a samAccountName
|
||||
* @requires bcmath http://www.php.net/manual/en/book.bc.php
|
||||
* @requires bcmath https://www.php.net/manual/en/book.bc.php
|
||||
* @return array
|
||||
*/
|
||||
public function user_password_expiry($username,$isGUID=false) {
|
||||
if ($username===NULL){ return ("Missing compulsory field [username]"); }
|
||||
if (!$this->_bind){ return (false); }
|
||||
if (!function_exists('bcmod')) { return ("Missing function support [bcmod] http://www.php.net/manual/en/book.bc.php"); };
|
||||
if (!function_exists('bcmod')) { return ("Missing function support [bcmod] https://www.php.net/manual/en/book.bc.php"); };
|
||||
|
||||
$userinfo = $this->user_info($username, array("pwdlastset", "useraccountcontrol"), $isGUID);
|
||||
$pwdlastset = $userinfo[0]['pwdlastset'][0];
|
||||
@ -1068,7 +1068,7 @@ class adLDAP {
|
||||
$maxpwdage = $info[0]['maxpwdage'][0];
|
||||
|
||||
|
||||
// See MSDN: http://msdn.microsoft.com/en-us/library/ms974598.aspx
|
||||
// See MSDN: https://msdn.microsoft.com/en-us/library/ms974598.aspx
|
||||
//
|
||||
// pwdLastSet contains the number of 100 nanosecond intervals since January 1, 1601 (UTC),
|
||||
// stored in a 64 bit integer.
|
||||
@ -1471,7 +1471,7 @@ class adLDAP {
|
||||
|
||||
/**
|
||||
* Returns a folder listing for a specific OU
|
||||
* See http://adldap.sourceforge.net/wiki/doku.php?id=api_folder_functions
|
||||
* See https://adldap.sourceforge.net/wiki/doku.php?id=api_folder_functions
|
||||
*
|
||||
* @param array $folder_name An array to the OU you wish to list.
|
||||
* If set to NULL will list the root, strongly recommended to set
|
||||
@ -1685,7 +1685,7 @@ class adLDAP {
|
||||
|
||||
/**
|
||||
* Add an X400 address to Exchange
|
||||
* See http://tools.ietf.org/html/rfc1685 for more information.
|
||||
* See https://tools.ietf.org/html/rfc1685 for more information.
|
||||
* An X400 Address looks similar to this X400:c=US;a= ;p=Domain;o=Organization;s=Doe;g=John;
|
||||
*
|
||||
* @param string $username The username of the user to add the X400 to to
|
||||
@ -2094,7 +2094,7 @@ class adLDAP {
|
||||
|
||||
/**
|
||||
* Coping with AD not returning the primary group
|
||||
* http://support.microsoft.com/?kbid=321360
|
||||
* https://support.microsoft.com/?kbid=321360
|
||||
*
|
||||
* For some reason it's not possible to search on primarygrouptoken=XXX
|
||||
* If someone can show otherwise, I'd like to know about it :)
|
||||
@ -2125,7 +2125,7 @@ class adLDAP {
|
||||
|
||||
/**
|
||||
* Coping with AD not returning the primary group
|
||||
* http://support.microsoft.com/?kbid=321360
|
||||
* https://support.microsoft.com/?kbid=321360
|
||||
*
|
||||
* This is a re-write based on code submitted by Bruce which prevents the
|
||||
* need to search each security group to find the true primary group
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
* Written by Scott Barnett, Richard Hyland
|
||||
* email: scott@wiggumworld.com, adldap@richardhyland.com
|
||||
* http://adldap.sourceforge.net/
|
||||
* https://adldap.sourceforge.net/
|
||||
*
|
||||
* Copyright (c) 2006-2010 Scott Barnett, Richard Hyland
|
||||
*
|
||||
@ -28,10 +28,10 @@
|
||||
* @package adLDAP
|
||||
* @author Scott Barnett, Richard Hyland
|
||||
* @copyright (c) 2006-2010 Scott Barnett, Richard Hyland
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
|
||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
|
||||
* @revision $Revision: 91 $
|
||||
* @version 3.3.2
|
||||
* @link http://adldap.sourceforge.net/
|
||||
* @link https://adldap.sourceforge.net/
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -57,7 +57,7 @@ define ('ADLDAP_CONTAINER', 'CN');
|
||||
* much information on other users as you could as a domain admin.
|
||||
*
|
||||
* Before asking questions, please read the Documentation at
|
||||
* http://adldap.sourceforge.net/wiki/doku.php?id=api
|
||||
* https://adldap.sourceforge.net/wiki/doku.php?id=api
|
||||
*/
|
||||
class adLDAP {
|
||||
/**
|
||||
@ -101,7 +101,7 @@ class adLDAP {
|
||||
protected $_ad_password="ldHS332";
|
||||
|
||||
/**
|
||||
* AD does not return the primary group. http://support.microsoft.com/?kbid=321360
|
||||
* AD does not return the primary group. https://support.microsoft.com/?kbid=321360
|
||||
* This tweak will resolve the real primary group.
|
||||
* Setting to false will fudge "Domain Users" and is much faster. Keep in mind though that if
|
||||
* someone's primary group is NOT domain users, this is obviously going to mess up the results
|
||||
@ -112,7 +112,7 @@ class adLDAP {
|
||||
|
||||
/**
|
||||
* Use SSL (LDAPS), your server needs to be setup, please see
|
||||
* http://adldap.sourceforge.net/wiki/doku.php?id=ldap_over_ssl
|
||||
* https://adldap.sourceforge.net/wiki/doku.php?id=ldap_over_ssl
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@ -343,7 +343,7 @@ class adLDAP {
|
||||
}
|
||||
|
||||
if ($this->ldap_supported() === false) {
|
||||
throw new adLDAPException('No LDAP support for PHP. See: http://www.php.net/ldap');
|
||||
throw new adLDAPException('No LDAP support for PHP. See: https://www.php.net/ldap');
|
||||
}
|
||||
|
||||
return $this->connect();
|
||||
@ -1033,13 +1033,13 @@ class adLDAP {
|
||||
*
|
||||
* @param string $username The username to query
|
||||
* @param book $isGUID Is the username passed a GUID or a samAccountName
|
||||
* @requires bcmath http://www.php.net/manual/en/book.bc.php
|
||||
* @requires bcmath https://www.php.net/manual/en/book.bc.php
|
||||
* @return array
|
||||
*/
|
||||
public function user_password_expiry($username,$isGUID=false) {
|
||||
if ($username===NULL){ return ("Missing compulsory field [username]"); }
|
||||
if (!$this->_bind){ return (false); }
|
||||
if (!function_exists('bcmod')) { return ("Missing function support [bcmod] http://www.php.net/manual/en/book.bc.php"); };
|
||||
if (!function_exists('bcmod')) { return ("Missing function support [bcmod] https://www.php.net/manual/en/book.bc.php"); };
|
||||
|
||||
$userinfo = $this->user_info($username, array("pwdlastset", "useraccountcontrol"), $isGUID);
|
||||
$pwdlastset = $userinfo[0]['pwdlastset'][0];
|
||||
@ -1068,7 +1068,7 @@ class adLDAP {
|
||||
$maxpwdage = $info[0]['maxpwdage'][0];
|
||||
|
||||
|
||||
// See MSDN: http://msdn.microsoft.com/en-us/library/ms974598.aspx
|
||||
// See MSDN: https://msdn.microsoft.com/en-us/library/ms974598.aspx
|
||||
//
|
||||
// pwdLastSet contains the number of 100 nanosecond intervals since January 1, 1601 (UTC),
|
||||
// stored in a 64 bit integer.
|
||||
@ -1470,7 +1470,7 @@ class adLDAP {
|
||||
|
||||
/**
|
||||
* Returns a folder listing for a specific OU
|
||||
* See http://adldap.sourceforge.net/wiki/doku.php?id=api_folder_functions
|
||||
* See https://adldap.sourceforge.net/wiki/doku.php?id=api_folder_functions
|
||||
*
|
||||
* @param array $folder_name An array to the OU you wish to list.
|
||||
* If set to NULL will list the root, strongly recommended to set
|
||||
@ -1684,7 +1684,7 @@ class adLDAP {
|
||||
|
||||
/**
|
||||
* Add an X400 address to Exchange
|
||||
* See http://tools.ietf.org/html/rfc1685 for more information.
|
||||
* See https://tools.ietf.org/html/rfc1685 for more information.
|
||||
* An X400 Address looks similar to this X400:c=US;a= ;p=Domain;o=Organization;s=Doe;g=John;
|
||||
*
|
||||
* @param string $username The username of the user to add the X400 to to
|
||||
@ -2093,7 +2093,7 @@ class adLDAP {
|
||||
|
||||
/**
|
||||
* Coping with AD not returning the primary group
|
||||
* http://support.microsoft.com/?kbid=321360
|
||||
* https://support.microsoft.com/?kbid=321360
|
||||
*
|
||||
* For some reason it's not possible to search on primarygrouptoken=XXX
|
||||
* If someone can show otherwise, I'd like to know about it :)
|
||||
@ -2124,7 +2124,7 @@ class adLDAP {
|
||||
|
||||
/**
|
||||
* Coping with AD not returning the primary group
|
||||
* http://support.microsoft.com/?kbid=321360
|
||||
* https://support.microsoft.com/?kbid=321360
|
||||
*
|
||||
* This is a re-write based on code submitted by Bruce which prevents the
|
||||
* need to search each security group to find the true primary group
|
||||
|
@ -33,7 +33,7 @@ if ($_POST["oldform"]){ //prevent null bind
|
||||
//establish your session and redirect
|
||||
session_start();
|
||||
$_SESSION["username"]=$username;
|
||||
$redir="Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/menu.htm";
|
||||
$redir="Location: https://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/menu.htm";
|
||||
header($redir);
|
||||
exit;
|
||||
}
|
||||
|
Reference in New Issue
Block a user