I am developing an ASP.Net MVC 3 intranet site that will use Integrated Windows Authentication exclusively. What are the vulnerabilities of the challenge/response authentication traffic being sent in plain text? Will someone sniffing the network traffic be able to hijack an authenticated session?


Question: Best way to migrate text field to taxonomy reference field
Answer: Using the example/suggestion @Molot posted, I created a batch process and packaged it as a module. Thought I would share.

First, create your taxonomy terms and add your entity reference field to your content type, then create and enable your batch module. Be sure to update the **FIELDS** below.

/**
 * Implements hook_menu().
 */

// Lets add a menu link to initiate the batch process
function convert_field_to_taxonomy_menu() {
    $items = array();
    $items['admin/batch'] = array(
        'title' =&gt; 'Convert to Tax Batch',
        'description' =&gt; 'Run batch operations.',
        'page callback' =&gt; 'drupal_get_form',
        'page arguments' =&gt; array('convert_field_to_taxonomy_form'),
        'access arguments' =&gt; array('administer site configuration'),
        'type' =&gt; MENU_NORMAL_ITEM,
    );
    return $items;
}
// And a button to click
function convert_field_to_taxonomy_form() {
    $form = array();
    $form['submit'] = array('#type' =&gt; 'submit', '#value' =&gt; t('Click here to Start'));
    return $form;
}

function convert_field_to_taxonomy_form_submit($form, $form_state) {
    batch_set(convert_field_to_taxonomy_setup_batch());
}

function convert_field_to_taxonomy_setup_batch() {
    drupal_set_message('Updating Nodes');
    // load all the nodes from content type
    $nodes = node_load_multiple(array(), array('type' =&gt; "**CONTENT_TYPE**"));
    $node_count = count($nodes);

    // build the list of operation functions and function arguments
    foreach($nodes as $nid =&gt; $node) {
        // $operations[] = array(&lt;function name&gt;, &lt;array of arguments to pass to function&gt;);
        $operations[] = array('convert_field_to_taxonomy_method', array($node));
    }

    //put all that information into our batch array
    $batch = array(
        'operations' =&gt; $operations,
        'title' =&gt; t('Convert to Tax Batch'),
        'init_message' =&gt; t('Initializing...'),
        'error_message' =&gt; t('An error occurred'),
        'progress_message' =&gt; t('Operation @current out of @total.'),
        'finished' =&gt; 'convert_field_to_taxonomy_finished_method'
    );
    return $batch;
}

function convert_field_to_taxonomy_method($node, &amp;$context) {
    $context['results'][] = $node-&gt;nid.
    ' : '.check_plain($node-&gt;title);
    // Optional message displayed under the progressbar.
    $context['message'] = t('Processing snapshot "@title"', array('@title' =&gt; $node-&gt;title));

    $vid = 38; // vocab ID
    $edit = array('vid' =&gt; $vid, 'name' =&gt; $node-&gt;**SOURCE_FIELD**['und'][0]['value']);
    $terms = taxonomy_get_term_by_name($edit['name']);
    if (!empty($terms)) {
        // term already exists
        $first_item = array_shift($terms);
        $tid = $first_item-&gt;tid;
    } else {
        // add term and get the tid
        $status = taxonomy_term_save($edit);
        $tid = $edit['tid'];
    }

    $node-&gt;**TARGET_FIELD**['und'][0]['target_id'] = $tid;
    node_save($node);
    $path = drupal_lookup_path("alias", "node/".$node-&gt;nid);
    drupal_set_message("&lt;a href='/$path'&gt;".$node-&gt;title.
        "&lt;/a&gt; updated.");
}

function convert_field_to_taxonomy_finished_method($success, $results, $operations) {
    if ($success) {
        // Here we could do something meaningful with the results.
        // We just display the number of data we processed...
        drupal_set_message(t('@count terms processed.', array('@count' =&gt; count($results))));
    } else {
        // An error occurred.
        // $operations contains the operations that remained unprocessed.
        $error_operation = reset($operations);
        drupal_set_message(t('An error occurred while processing @operation with arguments : @args', array('@operation' =&gt; $error_operation[0], '@args' =&gt; print_r($error_operation[0], TRUE))));
    }
}