Browse files

No changes, just rearranging code a little

  • Loading branch information...
1 parent b1b4e59 commit 3fca9299365411f759b577b2e4f6c1f1f8ccdd12 moodler committed Dec 31, 2004
Showing with 18 additions and 10 deletions.
  1. +18 −10 message/index.php
View
28 message/index.php
@@ -7,16 +7,24 @@
require_login(0, false);
/// optional variables that may be passed in
-$tab = optional_param('tab', 'contacts'); // current tab - default to contacts
-$addcontact = optional_param('addcontact', false); // adding a contact
-$removecontact = optional_param('removecontact', false); // removing a contact
-$blockcontact = optional_param('blockcontact', false); // blocking a contact
-$unblockcontact = optional_param('unblockcontact', false); // unblocking a contact
-
-if (($addcontact !== false) and confirm_sesskey()) message_add_contact($addcontact);
-if (($removecontact !== false) and confirm_sesskey()) message_remove_contact($removecontact);
-if (($blockcontact !== false) and confirm_sesskey()) message_block_contact($blockcontact);
-if (($unblockcontact !== false) and confirm_sesskey()) message_unblock_contact($unblockcontact);
+$tab = optional_param('tab', 'contacts'); // current tab - default to contacts
+$addcontact = optional_param('addcontact', 0, PARAM_INT); // adding a contact
+$removecontact = optional_param('removecontact', 0, PARAM_INT); // removing a contact
+$blockcontact = optional_param('blockcontact', 0, PARAM_INT); // blocking a contact
+$unblockcontact = optional_param('unblockcontact', 0, PARAM_INT); // unblocking a contact
+
+if ($addcontact and confirm_sesskey()) {
+ message_add_contact($addcontact);
+}
+if ($removecontact and confirm_sesskey()) {
+ message_remove_contact($removecontact);
+}
+if ($blockcontact and confirm_sesskey()) {
+ message_block_contact($blockcontact);
+}
+if ($unblockcontact and confirm_sesskey()) {
+ message_unblock_contact($unblockcontact);
+}
/// a print function is associated with each tab

0 comments on commit 3fca929

Please sign in to comment.