Skip to content
Snippets Groups Projects
Commit ceaa5caa authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

rename keys for ldap user and its password

parent 6988ed5c
No related branches found
No related tags found
No related merge requests found
......@@ -10,8 +10,8 @@ class imlldap {
private $_aLdap = array(
'server' => false,
'port' => false,
'DnLookupUser' => false, // ldap rdn oder dn
'PwLookupUser' => false,
'DnLdapUser' => false, // ldap rdn oder dn
'PwLdapUser' => false,
'DnUserNode' => false, // ou=People...
'DnAppNode' => false, // cn=AppGroup...
'protoVersion' => 3,
......@@ -84,8 +84,8 @@ class imlldap {
* @param array $aConfig new config items
* 'server' => 'ldaps://ldap.example.com',
* 'port' => 636,
* 'DnLookupUser' => 'cn=Lookup,ou=ServiceAccounts,dc=org,dc=example.com', // ldap rdn oder dn
* 'PwLookupUser' => 'IkHEFFzlZ...99j0h8WdI0LrLhxU', // password
* 'DnLdapUser' => 'cn=Lookup,ou=ServiceAccounts,dc=org,dc=example.com', // ldap rdn oder dn
* 'PwLdapUser' => 'IkHEFFzlZ...99j0h8WdI0LrLhxU', // password
* 'DnUserNode' => 'ou=People,ou=ORG,dc=org,dc=example.com',
* 'DnAppNode' => '' optional dn ... if a user must be member of a given group
* 'protoVersion' => 3
......@@ -210,7 +210,7 @@ class imlldap {
*/
public function search($sSearchFilter, $aAttributesToGet=array("*")) {
if (!$this->_ldapBind) {
$this->bind($this->_aLdap['DnLookupUser'], $this->_aLdap['PwLookupUser']);
$this->bind($this->_aLdap['DnLdapUser'], $this->_aLdap['PwLdapUser']);
}
$this->_w(__FUNCTION__ . ' DN = '.$this->_aLdap['DnUserNode'] . ' filter = '.$sSearchFilter);
......@@ -237,7 +237,7 @@ class imlldap {
*/
public function getUserInfo($sUser, $aAttributesToGet=array("*")) {
if (!$this->_ldapBind) {
$this->bind($this->_aLdap['DnLookupUser'], $this->_aLdap['PwLookupUser']);
$this->bind($this->_aLdap['DnLdapUser'], $this->_aLdap['PwLdapUser']);
}
// generate search filter
......@@ -284,7 +284,7 @@ class imlldap {
*/
public function setPassword($sUser, $sPW){
if (!$this->_ldapBind) {
$this->bind($this->_aLdap['DnLookupUser'], $this->_aLdap['PwLookupUser']);
$this->bind($this->_aLdap['DnLdapUser'], $this->_aLdap['PwLdapUser']);
}
$sDn=$this->getUserDn($sUser);
if ($sDn){
......@@ -305,7 +305,7 @@ class imlldap {
public function objAdd($sDn, $aItem){
$this->_w(__FUNCTION__ . '("'.$sDn.'", [array])');
if (!$this->_ldapBind) {
$this->bind($this->_aLdap['DnLookupUser'], $this->_aLdap['PwLookupUser']);
$this->bind($this->_aLdap['DnLdapUser'], $this->_aLdap['PwLdapUser']);
}
return ldap_add($this->_ldapConn, $sDn, $aItem);
}
......@@ -321,7 +321,7 @@ class imlldap {
public function objAddAttr($sDn, $aItem){
$this->_w(__FUNCTION__ . '("'.$sDn.'", [array])');
if (!$this->_ldapBind) {
$this->bind($this->_aLdap['DnLookupUser'], $this->_aLdap['PwLookupUser']);
$this->bind($this->_aLdap['DnLdapUser'], $this->_aLdap['PwLdapUser']);
}
if ($sDn && is_array($aItem)){
$this->_w(__FUNCTION__ . ' ' . $this->_ldapConn ? 'Verbindung da' : 'kein LDAP Connect');
......@@ -346,7 +346,7 @@ class imlldap {
public function objUpdate($sDn, $aItem){
$this->_w(__FUNCTION__ . '("'.$sDn.'", [array])');
if (!$this->_ldapBind) {
$this->bind($this->_aLdap['DnLookupUser'], $this->_aLdap['PwLookupUser']);
$this->bind($this->_aLdap['DnLdapUser'], $this->_aLdap['PwLdapUser']);
}
if ($sDn && is_array($aItem)){
return ldap_mod_replace($this->_ldapConn, $sDn, $aItem);
......@@ -366,7 +366,7 @@ class imlldap {
public function objDelete($sDn){
$this->_w(__FUNCTION__ . '("'.$sDn.'")');
if (!$this->_ldapBind) {
$this->bind($this->_aLdap['DnLookupUser'], $this->_aLdap['PwLookupUser']);
$this->bind($this->_aLdap['DnLdapUser'], $this->_aLdap['PwLdapUser']);
}
if ($sDn){
......@@ -392,7 +392,7 @@ class imlldap {
public function objDeleteAttr($sDn, $aItem){
$this->_w(__FUNCTION__ . '("'.$sDn.'", [array])');
if (!$this->_ldapBind) {
$this->bind($this->_aLdap['DnLookupUser'], $this->_aLdap['PwLookupUser']);
$this->bind($this->_aLdap['DnLdapUser'], $this->_aLdap['PwLdapUser']);
}
if ($sDn && is_array($aItem)){
$this->_w(__FUNCTION__ . ' ' . $this->_ldapConn ? 'Verbindung da' : 'kein LDAP Connect');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment