# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: millennium.pages.inc
--- millennium.pages.inc Base (1.1.2.7)
+++ millennium.pages.inc Locally Modified (Based On 1.1.2.7)
@@ -10,6 +10,11 @@
  * Callback function from hook_menu() that imports a new node based on a given item or bib record number.
  */
 function millennium_node_import() {
+  // Check for valid token
+  if (!drupal_valid_token($_GET['token'])) {
+    echo t('Invalid token');
+    exit;
+  }
   // Check if URL is permalink
   $url = check_plain($_GET['url']);
   if (preg_match('/^http[s]*:\/\/[^\/]+\/record=([bi][0-9]+)/', $url, $matches)) {
@@ -57,7 +62,7 @@
       return t("@recnum is not a valid Millennium record number (b123456, i123456).", array('@recnum' => $recnum));
     }
     
-    $output = t("You can also !link", array('!link' => l(t("import this record now"), "millennium/import", array('query' => "url=$url"))));
+    $output = t("You can also !link", array('!link' => l(t("import this record now"), "millennium/import", array('query' => "url=$url&token=" . drupal_get_token()))));
     $output .= "<hr />";
     $output .= _millennium_show_conversion($recnum, $base_url);
   }
@@ -90,7 +95,7 @@
   }
   $items[] = t("Node first import date: @date", array("@date" => $data->created));
   $items[] = t("Node last update date: @date", array("@date" => $data->updated));
-  $items[] = l(t('Click here to reimport this node'), 'node/'. $node->nid . '/millennium/reimport');
+  $items[] = l(t('Click here to reimport this node'), 'node/'. $node->nid . '/millennium/reimport', array('query' => 'token=' . drupal_get_token()));
   $output .= theme('item_list', $items);
 
   $output .= "<p></p>";
@@ -114,6 +119,11 @@
  * Callback function from hook_menu that reimports a node using its previously stored bib data
  */
 function millennium_node_reimport($node) {
+  // Check for valid token
+  if (!drupal_valid_token($_GET['token'])) {
+    echo t('Invalid token');
+    exit;
+  }
   $bib_recnum = millennium_bib_recnum_from_node($node->nid);
   $base_url = db_result(db_query("SELECT base_url FROM {millennium_node_bib} WHERE nid=%d", $node->nid));
   if (! $bib_recnum) {
