Nespravne volana funkcia

'; return; }; if (($linkPrefix!="")&&($adminDN!=$certDN)){ if ($dn!=$certDN){ echo "
Nemate pravo editovat tento zaznam!
"; return; }; } else { echo "
pozor, administratorsky pristup!
"; }; //////////////////////////////////////////////////////////// //form paint echo '
'; ?>

"; $lc=@ldap_connect($ldapServer, $ldapPort); if ($debug) echo "connect result is [".$lc."]
"; $ldapV3 = ldap_set_option($ds,LDAP_OPT_PROTOCOL_VERSION,3); if ($debug) echo "ldap protocol v3 je [".$ldapV3."]
"; if ($lc) { if ($debug) echo "Binding as [$ldapLogin:$ldapPwd]
"; if (@ldap_bind($lc, $ldapLogin, $ldapPwd)){ if ($debug) echo "Searching for "; $attr[]="*"; //sosame vsetky attribs if ($debug){ echo "attr[]="; for ($i=0;$i\n"; }; $queryStr="(objectClass=*)"; if ($debug) echo "queryStr=[$queryStr]
\n"; //$result=ldap_search($lc, $ldapDN, "(objectclass=*)", $atr, 0, $search_limit); $result=ldap_search($lc, $dn, $queryStr, $attr, 0, 1); //just 1 record //$result=@ldap_search($lc, $dn); //just 1 record /* ldap_search( connection $this->res base_dn $this->dn_all filter sets the restrictions attributes as array array of attributes returned attrsonly 1 = return only the attributes, 0 = return attributes and values amount number of results to return; 0 means all time limit time limit in seconds; 0 means no limit deref handling of aliases: LDAP_DEREF_NEVER never resolv aliases LDAP_DEREF_SEARCHING not if base object is called LDAP_DEREF_FINDING only if base object is called LDAP_DEREF_ALWAYS always resolv aliases $result=ldap_search($lc, $ldapDN, "(objectclass=*)"); */ if (!isset($result)){ echo "Zaznam $dn nenajdeny.
Pravdepodobne ho prave niekto zmazal.$brn
"; return; }; if ($debug) echo "Search result is ".$result."
"; if ($debug) echo "Number of entires returned is ".ldap_count_entries($lc,$result)."
"; if ($debug) echo "Getting entries ...
"; $info = ldap_get_entries($lc, $result); if ($debug) echo "Data for ".$info["count"]." items returned:


\n"; if ($debug) echo "info[count] = ".$info["count"]."
"; if (ldap_count_entries($lc,$result)){ //ziskame zoznam attribs podla toho co mame zadane v setup.php/schema $attrList=getArraySlice($schema,0); //attrList je pole a vyzera nejako takto: ("cn","sn","givenName",...) $attrString=implode(",",$attrList); if ($debug) echo "attrString=[".$attrString."]$brn"; //attrString je string a vyzera nejako takto: "cn,sn,givenName,..." //mohol by som to spucit do jedneho s nasledujucim preikazom, ale vyzeralo //by to velmi hnusne a o par dni by som to urcite ani sam nepochopil $attrValues=getRecordAttribList($info[0],$attrString); //attrValues je pole a obsahuje vyplnene data v rovnakom poradi ako $attrList //toto budeme potrebovat right now tak si to vysosneme este raz list($cn, $sn, $givenName) = getRecordAttribList($info[0],"cn,sn,givenname"); } else { echo "Zaznam nebol najdeny.
\n"; return; }; echo '
'; echo ''."\n"; echo ''."\n"; $itemCount=0; for ($i=0; $i'; echo ''."\n".''."\n".''."\n"; }; echo ''; echo ''."\n"; echo '
'; echo ( (($sn=="")||($givenName=="")) ? ($cn) : ("$sn, $givenName") ); echo '
AtributHodnotaVlastnosti
'; //name echo ''.$schema[$i][1].''.$brn; //attr description for dumbheads echo " (".$schema[$i][0].")"; //attr name echo ''; //value //$multiValue = getSchemaFlag($i,$SCHEMA_ZERO_N + $SCHEMA_ONE_N); $multiValue=false; if (!getSchemaFlag($i,$SCHEMA_READ_ONLY)){ //editovatelna hodnota if (!getSchemaFlag($i,$SCHEMA_SECRET)){ //not secret hodnota if (!getSchemaFlag($i,$SCHEMA_BINARY)){ //not binary hodnota if (is_array($attrValues[$i])){ //multivalue for ($mv=0; $mv<(sizeof($attrValues[$i])-1);$mv++){ //echo $attrValues[$i][$mv]."
\n"; echo ''."\n"; //echo ' name="itemId_'.$itemCount.'" value="'.$i.'">'."\n"; echo ''."\n"; //echo ' name="item_'.$itemCount.'" value="'.$attrValues[$i].'">'; $itemCount++; }; //mv } else { echo ''."\n"; //echo ' name="itemId_'.$itemCount.'" value="'.$i.'">'."\n"; echo ''."\n"; //echo ' name="item_'.$itemCount.'" value="'.$attrValues[$i].'">'; $itemCount++; }; if ($multiValue){ //potencialna multivalue echo ''."\n"; echo '(+)'."\n"; $itemCount++; }; } else { //binary if (is_array($attrValues[$i])){ //multivalue for ($mv=0; $mv<(sizeof($attrValues[$i])-1);$mv++){ //echo $attrValues[$i][$mv]."
\n"; echo ''."\n"; //echo ' name="item_index[]" value="'.$i.'">'."\n"; //echo ' name="itemId_'.$itemCount.'" value="'.$i.'">'."\n"; echo ''; //echo ''; echo ' zmazat tuto binarnu polozku'."\n"; $itemCount++; }; //mv } else { if (""!=$attrValues[$i]){ echo ''."\n"; //echo ' name="itemId_'.$itemCount.'" value="'.$i.'">'."\n"; echo ''; //echo ''; echo ' zmazat tuto binarnu polozku'."\n"; $itemCount++; } else { echo "prazdna polozka\n"; }; }; }; } else { //secret hodnota if (!getSchemaFlag($i,$SCHEMA_BINARY)){ if (is_array($attrValues[$i])){ //multivalue for ($mv=0; $mv<(sizeof($attrValues[$i])-1);$mv++){ //echo $attrValues[$i][$mv]."
\n"; echo ''."\n"; //echo ' name="item_index[]" value="'.$i.'">'."\n"; //echo ' name="itemId_'.$itemCount.'" value="'.$i.'">'."\n"; echo ''."\n"; //echo ' name="item_'.$itemCount.'" value="'.$attrValues[$i].'">'; $itemCount++; }; //mv } else { //not binary hodnota echo ''."\n"; //echo ' name="itemId_'.$itemCount.'" value="'.$i.'">'."\n"; echo ''."\n"; //echo ' name="item_'.$itemCount.'" value="'.$attrValues[$i].'">'; $itemCount++; }; //if array } else { //binary echo ''."\n"; //echo ' name="item_index[]" value="'.$i.'">'."\n"; //echo ' name="itemId_'.$itemCount.'" value="'.$i.'">'."\n"; echo ''; //echo ''; echo ' zmazat tuto binarnu polozku'."\n"; $itemCount++; }; }; } else { //read only, takze len vypiseme. //toto je cele prevzate z search_single_result_detail.php //value if (!getSchemaFlag($i,$SCHEMA_BINARY)){ //normalna hodnota if (!getSchemaFlag($i,$SCHEMA_SECRET)){ //normalna hodnota echo $attrValues[$i]; } else { //secret hodnota if ($attrValues[$i]!=""){ echo "*s*e*c*r*e*t*"; } else { //nepiseme ze tam nie je heslo //echo "n/a"; }; }; } else { //binarna hodnota echo "binary"; }; }; echo '
'; //flags echo iconDef( ((getSchemaFlag($i,$SCHEMA_READ_ONLY)) ? ("read_only") : ("read_only-no")), 1 ); echo iconDef( ((getSchemaFlag($i,$SCHEMA_ADMIN_READ_ONLY)) ? ("read_only_admin") : ("read_only_admin-no")), 1 ); echo iconDef( ((getSchemaFlag($i,$SCHEMA_ONE)) ? ("one") : ("one-no")), 1 ); echo iconDef( ((getSchemaFlag($i,$SCHEMA_ZERO_N)) ? ("zero_n") : ("zero_n-no")), 1 ); echo iconDef( ((getSchemaFlag($i,$SCHEMA_ONE_N)) ? ("one_n") : ("one_n-no")), 1 ); echo iconDef( ((getSchemaFlag($i,$SCHEMA_BINARY)) ? ("binary") : ("binary-no")), 1 ); echo '
   
'; echo ''; echo ''; echo ''; echo '
'; } else { echo "Nemozem sa nalogovat na LDAP server! Je nutne skontrolovat konfiguraciu $wpldapName.
\nKontaktuje prosim administratora systemu."; }; // if bind if ($debug) echo "Closing connection"; ldap_close($lc); } else { echo "Nemozem sa pripojit k LDAP serveru na adrese $ldapServer:$ldapPort
\nKontaktuje prosim administratora systemu."; }; ?>