| | |
| | | // Build sub_fields filter |
| | | if (!empty($this->prop['sub_fields']) && is_array($this->prop['sub_fields'])) { |
| | | $this->sub_filter = ''; |
| | | foreach ($this->prop['sub_fields'] as $attr => $class) { |
| | | foreach ($this->prop['sub_fields'] as $class) { |
| | | if (!empty($class)) { |
| | | $class = is_array($class) ? array_pop($class) : $class; |
| | | $this->sub_filter .= '(objectClass=' . $class . ')'; |
| | |
| | | $mail_field = $this->fieldmap['email']; |
| | | |
| | | // try to extract surname and firstname from displayname |
| | | $reverse_map = array_flip($this->fieldmap); |
| | | $name_parts = preg_split('/[\s,.]+/', $save_data['name']); |
| | | |
| | | if ($sn_field && $missing[$sn_field]) { |
| | |
| | | // Remove attributes that need to be added separately (child objects) |
| | | $xfields = array(); |
| | | if (!empty($this->prop['sub_fields']) && is_array($this->prop['sub_fields'])) { |
| | | foreach ($this->prop['sub_fields'] as $xf => $xclass) { |
| | | foreach (array_keys($this->prop['sub_fields']) as $xf) { |
| | | if (!empty($newentry[$xf])) { |
| | | $xfields[$xf] = $newentry[$xf]; |
| | | unset($newentry[$xf]); |
| | |
| | | } |
| | | } |
| | | |
| | | foreach ($this->fieldmap as $col => $fld) { |
| | | foreach ($this->fieldmap as $fld) { |
| | | if ($fld) { |
| | | $val = $ldap_data[$fld]; |
| | | $old = $old_data[$fld]; |
| | |
| | | $vlv_active = $this->_vlv_set_controls($this->prop['groups'], $vlv_page+1, $page_size); |
| | | } |
| | | |
| | | $function = $this->_scope2func($this->prop['groups']['scope'], $ns_function); |
| | | $function = $this->_scope2func($this->prop['groups']['scope']); |
| | | $res = @$function($this->conn, $base_dn, $filter, array_unique(array('dn', 'objectClass', $name_attr, $email_attr, $sort_attr))); |
| | | if ($res === false) |
| | | { |