less PHP notices

This commit is contained in:
Roland Gruber 2006-01-23 19:26:16 +00:00
parent c862b37ce3
commit b5f3813c83
2 changed files with 4 additions and 3 deletions

View File

@ -1357,11 +1357,11 @@ class accountContainer {
$this->rdn = split("=", substr($dn, 0, strpos($dn, ','))); $this->rdn = split("=", substr($dn, 0, strpos($dn, ',')));
$this->rdn = $this->rdn[0]; $this->rdn = $this->rdn[0];
$attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry); $attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry);
$attrNames = array_keys($attr);
// remove 'count' entries and numerical entries // remove 'count' entries and numerical entries
for ($i = 0; $i < count($attr); $i++) { for ($i = 0; $i < count($attr); $i++) {
if (isset($attr[$i])) unset($attr[$i]); if (isset($attr[$i])) unset($attr[$i]);
} }
$attrNames = array_keys($attr);
for ($i = 0; $i < sizeof($attrNames); $i++) unset($attr[$attrNames[$i]]['count']); for ($i = 0; $i < sizeof($attrNames); $i++) unset($attr[$attrNames[$i]]['count']);
unset($attr['count']); unset($attr['count']);
// get binary attributes // get binary attributes

View File

@ -430,6 +430,7 @@ class inetOrgPerson extends baseModule {
* @return array list of info/error messages * @return array list of info/error messages
*/ */
function process_attributes(&$post) { function process_attributes(&$post) {
$triggered_messages = array();
// Load attributes // Load attributes
$this->attributes['description'][0] = $post['description']; $this->attributes['description'][0] = $post['description'];
$this->attributes['sn'][0] = $post['sn']; $this->attributes['sn'][0] = $post['sn'];
@ -514,7 +515,7 @@ class inetOrgPerson extends baseModule {
} }
if ($post['delPhoto']) $this->attributes['jpegPhoto'] = array(); if ($post['delPhoto']) $this->attributes['jpegPhoto'] = array();
// Return error-messages // Return error-messages
if (is_array($triggered_messages)) return $triggered_messages; return $triggered_messages;
} }
/* This function will create the html-page /* This function will create the html-page