--- signup.module~	2006-02-01 02:34:34.000000000 -0800
+++ signup.module	2006-02-01 04:17:18.000000000 -0800
@@ -472,6 +472,21 @@ function signup_close_signup($nid, $cron
   }
 }
 
+
+/**
+ * Callback function for opening signups
+ * @ingroup signup_callback
+ */
+function signup_open_signup($nid, $cron = 'no') {
+
+  //open the specified node for signups, and head back to the admin/signup page if it's not a cron task
+  db_query("UPDATE {signup} SET completed = 0 WHERE nid = %d", $nid);
+  if ($cron == 'no') {
+    drupal_goto('admin/signup');
+  }
+}
+
+
 /**
  * Callback function for generating a detail report of signup conflicts
  * @ingroup signup_callback
@@ -587,6 +602,14 @@ function signup_user_signup() {
     case t('Cancel Signup'):
       signup_cancel_signup($edit['uid'], $edit['nid']);
       break;
+
+    case t('Open Signups'):
+      signup_open_signup($edit['nid']);
+      break;  
+
+    case t('Close Signups'):
+      signup_close_signup($edit['nid']);
+      break;  
   }
 
   //send the user back to the same page, or to node if it's not available
@@ -608,10 +631,31 @@ function signup_user_signup() {
  */
 function signup_user_signups_form($node) {
 
+  $output = "<h1>" . check_plain($node->title) . "</h1>";
+
+  // first see signups have already been closed for this node, and if
+  // so, print out something about that along with a button to re-open
+  // signups... 
+  $ctrl_row = array();
+  if ($node->signup_completed) {
+    $ctrl_row[] = array( t('Signups <b>closed</b> for this event'), 
+                         form(form_hidden('nid', $node->nid) .
+                            form_submit(t('Open Signups')), 'post',
+                              url('signup', drupal_get_destination())) );
+
+  } else {
+    $ctrl_row[] = array( t('Signups <b>open</b> for this event'), 
+                         form(form_hidden('nid', $node->nid) .
+                            form_submit(t('Close Signups')), 'post',
+                              url('signup', drupal_get_destination())) );
+  }
+  $output .= '<br/>';
+  $output .= theme('table', NULL, $ctrl_row);
+  $output .= '<br/>';
+
   //pull all user signed up for this event, and start table creation
   $result = db_query("SELECT u.uid, u.name, s.signup_time, s.form_data FROM {signup_log} s INNER JOIN {users} u ON
     u.uid = s.uid WHERE s.nid =%d", $node->nid);
-  $output = "<h1>" . check_plain($node->title) . "</h1>";
   $header = array(array('data' => t('%d individual(s) signed up', array('%d' => db_num_rows($result))), 'colspan' => 3));
   $rows = array();
 
