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

rename keys for ldap user and its password

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