0 or pla_error( $lang['ldif_file_empty'] ); check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] ); include 'header.php'; ?>

: ": ()



hasVersionNumber()){ display_warning($ldifReader->getWarningMessage()); } $i=0; // if .. else not mandatory but should be easier to maintain if( $continuous_mode ){ while( $ldifReader->readEntry() ){ $i++; // get the entry. $currentEntry = $ldifReader->getCurrentEntry(); $changeType = $currentEntry->getChangeType(); echo "".$actionString[$changeType]." ".$currentEntry->dn; if($ldifReader->hasRaisedException()){ echo " ".$lang['failed']."
"; $exception = $ldifReader->getLdapLdifReaderException(); echo "".$lang['ldif_line_number'].": ".$exception->lineNumber."
"; echo "".$lang['ldif_line'].": ".$exception->currentLine."
"; echo "".$lang['desc'].": ".$exception->message."
"; } else{ if($ldapWriter->ldapModify($currentEntry)) echo " ".$lang['success']."
"; else{ echo " ".$lang['failed']."
"; echo "Error Code: ".ldap_errno($ds)."
"; echo "".$lang['desc'].": ".ldap_error($ds)."
"; } } if( 0 == $i % 5 ) flush(); }// end while } else{ //while we have a valid entry, while($entry = $ldifReader->readEntry()){ $i++; $changeType = $entry->getChangeType(); echo "".$actionString[$changeType]." ".$entry->dn; if($ldapWriter->ldapModify($entry)){ echo " ".$lang['success']."
"; if( 0 == $i % 5 ) flush(); } else{ echo " ".$lang['failed']."

"; reload_left_frame(); pla_error( $actionErrorMsg[$changeType]. " " . htmlspecialchars( $entry->dn ), ldap_error( $ds ), ldap_errno( $ds ) ); } } // if any errors occurs during reading file ,"catch" the exception and display it here. if($ldifReader->hasRaisedException()){ //get the entry which raise the exception,quick hack here $currentEntry = $ldifReader->getCurrentEntry(); if($currentEntry->dn !=""){ echo "".$actionString[$currentEntry->getChangeType()]." ".$currentEntry->dn." ".$lang['failed']."
"; } //get the exception wich was raised $exception = $ldifReader->getLdapLdifReaderException(); echo "
"; echo "
"; display_pla_parse_error($exception,$currentEntry); } } // close the file $ldifReader->done(); //close the ldap connection $ldapWriter->ldapClose(); reload_left_frame(); function reload_left_frame(){ global $server_id; echo "\r\n"; } function display_error_message($error_message){ echo "
".$error_message."
"; } function display_warning($warning){ echo "
".$warning."
"; } function display_pla_parse_error($exception,$faultyEntry){ global $lang; global $actionErrorMsg; $errorMessage = $actionErrorMsg[$faultyEntry->getChangeType()]; print("
"); print(""); print(""); print("
"); } ?>

".$lang['ldif_parse_error']."

"); print("
"); print($errorMessage." ". $faultyEntry->dn); print("

"); print("".$lang['desc'].": ".$exception->message); print("

"); print("

"); print("".$lang['ldif_line'].": ".$exception->currentLine); print("

"); print("

"); print("".$lang['ldif_line_number'].": ".$exception->lineNumber); print("

"); print("
"); print("

\r\n"); print("

"); print(""); print(sprintf($lang['ferror_submit_bug'] , get_href( 'add_bug' ))); print("

"); print("
"); print("