Index: invite.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/invite/invite.module,v retrieving revision 1.9.2.4 diff -u -p -r1.9.2.4 invite.module --- invite.module 19 Nov 2006 10:26:53 -0000 1.9.2.4 +++ invite.module 28 Nov 2006 00:22:14 -0000 @@ -1,4 +1,5 @@ $multiple = FALSE, '#required' => $required = TRUE, ); + $form['user_settings']['invite_allow_join_delete'] = array( + '#type' => 'checkbox', + '#title' => t('Allow deletion of joined users'), + '#default_value' => variable_get('invite_allow_join_delete', 0), + '#description' => t('After an invitee has registered, this option allows a site administrator the option to delete the invitations marked as joined. Useful for users who delete their account to be re-invited or for users who change their email address') + ); $form['user_roles'] = array( '#type' => 'fieldset', @@ -377,12 +384,30 @@ function invite_page(){ $inc = 0; $result = db_query("SELECT * from {invite} WHERE uid = %d",$user->uid); while ($invite = db_fetch_object($result)){ - $items[] = array($invite->email, (($invite->expiry + (variable_get('invite_expiry', '30')* 24 * 60 * 60))< time()) ? "Expired" :($invite->timestamp ? t('Joined') : t('Pending')),$invite->timestamp ? "delete" : l("delete",'invite/delete/'.urlencode($invite->email))); + $expiry = $invite->expiry + (variable_get('invite_expiry', '30') * 24 * 60 * 60); + if (!$invite->timestamp) { + $email_cell = $invite->email; + if ($expiry < time()) { + $status_cell = t('Expired'); + $action_cell = l("Delete invitation",'invite/delete/'.urlencode($invite->email)); + } + else { + $status_cell = t('Pending'); + $action_cell = l("Delete invitation",'invite/delete/'.urlencode($invite->email)); + } + } + else { + $account = user_load(array('mail' => $invite->email)); + $email_cell = isset($account->uid) ? l($invite->email, 'user/'.$account->uid) : "{$invite->email}"; + $status_cell = t('Joined'); + $action_cell = (variable_get('invite_allow_join_delete', 0) && isset($account->uid)) ? l("Delete invitation",'invite/delete/'.urlencode($invite->email)) : ' '; + } + $items[] = array($email_cell, $status_cell, $action_cell); $inc++; } if (count($items) > 0) { - $headers = array(t('Email'), t('Status'), ''); + $headers = array(t('Email'), t('Status'), ' '); $table = theme('table', $headers, $items, array('id' => 'invite_table')); } else {