function var_export_members() { if (!is_array($array)) { $dn = base64_decode($_GET["data"]); $dnText = utf8_decode($dn); $ad = new ActiveDirectory($_GET["ADID"]); if ($ad->ldap_last_error != null) { echo "<div style='color:#d32d2d;font-size:12px'>{$ad->ldap_last_error}<hr></div>"; } } //$link_identifier, $base_dn, $filter, array $attributes = null, $attrsonly = null, $sizelimit = null, $timelimit = null, $deref = null if (!is_numeric($entriesNumber)) { $entriesNumber = 50; } $res = @ldap_read($ad->ldap_connection, $dn, "(objectClass=*)", array("member", "MemberOf"), null, $entriesNumber, 20); $log[] = "Parse DN: {$dn} for member, MemberOf"; if (!$res) { $log[] = 'Error LDAP search number ' . ldap_errno($ad->ldap_connection) . "\nAction:LDAP search\ndn:{$this->suffix}\n{$filter}\n" . ldap_err2str(ldap_errno($ad->ldap_connection)); echo @implode("<br>", $log); return array(); } $hash = ldap_get_entries($ad->ldap_connection, $res); $log[] = "Attribute member =" . $hash[0]["member"]["count"]; for ($i = 0; $i < $hash[0]["member"]["count"]; $i++) { $dn = $hash[0]["member"][$i]; $log[] = "Found dn = «{$dn}»"; if ($dn == null) { continue; } $log[] = "Dump dn = «{$dn}»"; $Props = $ad->DumpDN($dn); if (!is_array($Props)) { continue; } $html = $html . "<table style='width:99%' class=form>\n\t\t\t<tr>\n\t\t\t\t<td colspan=2 style='font-size:16px;'> «{$dn}»</td>\n\t\t\t</tr>\n\t\t\t"; while (list($num, $ligne) = each($Props)) { if (is_array($ligne)) { $ligne = var_export_popup($ligne, true); } else { $ligne = utf8_decode($ligne); $ligne = htmlentities($ligne); $ligne = str_replace("'", "`", $ligne); } $html = $html . "\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=legend style='font-size:13px' valign='top'>{$num}:</td>\n\t\t\t\t\t<td style='font-size:13px'><strong>{$ligne}</strong></td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t"; } $html = $html . "</table>"; } echo "</div style='font-size:12px'><code>" . @implode("<br>", $log) . "</div>{$html}"; }
exit; } if (isset($_GET["var-export-js"])) { var_export_js(); exit; } if (isset($_GET["var-export-popup"])) { var_export_popup(); exit; } if (isset($_GET["var-export-tabs"])) { var_export_tabs(); exit; } if (isset($_GET["var-dump-ad-group"])) { var_export_popup(); exit; } if (isset($_GET["var-dump-ad-members"])) { var_export_members(); exit; } if (isset($_POST["field"])) { prepare_connection(); exit; } if (isset($_POST["dnenc"])) { add(); exit; } if (isset($_POST["delete"])) {