server; // special case for binary attributes: // we must go read the data from the file. if( $is_binary_val ) { $file = $_FILES['new_value']['tmp_name']; $f = fopen( $file, 'r' ); $binary_value = fread( $f, filesize( $file ) ); fclose( $f ); $new_value = $binary_value; } $new_entry = array( $attr => $new_value ); $add_result = @ldap_mod_add( $ds, $dn, $new_entry ); if( ! $add_result ) { echo $_SESSION['header']; echo "LDAP Account Manager\n"; echo "\n"; echo "\n"; StatusMessage('ERROR', _('Adding attribute failed!'), ldap_error( $ds )); echo ""; exit; } header( "Location: edit.php?dn=$encoded_dn&modified_attrs[]=$encoded_attr" ); ?>