From 7e25c2285fb50b608e7d054d3f6293481530ed18 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Sun, 19 May 2013 17:42:19 -0400 Subject: [PATCH] prevent double-shuffling or double-clearing, fixes issue #6 --- .htaccess | 2 ++ header.php | 13 +------------ index.php | 46 ++++++++++++++++++++++++++++------------------ init.php | 15 +++++++++++++++ 4 files changed, 46 insertions(+), 30 deletions(-) create mode 100644 init.php diff --git a/.htaccess b/.htaccess index e33a49e..231220f 100644 --- a/.htaccess +++ b/.htaccess @@ -9,8 +9,10 @@ RewriteRule ^sms/?$ sms.php RewriteRule ^print.pdf print.php RewriteRule ^shuffle/?$ index.php?shuffle RewriteRule ^shuffle/confirmed/?$ index.php?shuffle&confirmed +RewriteRule ^shuffle/done/?$ index.php?shuffle&done RewriteRule ^clear/?$ index.php?clear RewriteRule ^clear/confirmed/?$ index.php?clear&confirmed +RewriteRule ^clear/done/?$ index.php?clear&done RewriteRule ^add/?$ add.php RewriteRule ^spoon/([^/.]+)/?$ index.php?spoon=$1 RewriteRule ^revive/([^/.]+)/?$ index.php?revive=$1 \ No newline at end of file diff --git a/header.php b/header.php index 7d3dde5..ee1ebc5 100644 --- a/header.php +++ b/header.php @@ -1,15 +1,4 @@ - + diff --git a/index.php b/index.php index 9a7296a..5678e09 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,18 @@ @@ -82,19 +100,15 @@ if(isset($_GET['revive'])) { /*********** SHUFFLING **********/ -if(isset($_GET['shuffle']) && !isset($_GET['confirmed'])) { ?> +if(isset($_GET['shuffle']) && !isset($_GET['confirmed']) && !isset($_GET['done'])) { ?>
×

Are you sure you wanna do that...?

Shuffling is permanent, and your head will roll if you do this at the wrong time. You might wanna save a PDF of the current order first.

- Yes, I'm positive. - No, please forgive me! + Yes, I'm positive. + No, please forgive me!
- +

Spooners have been successfully shuffled.

@@ -103,19 +117,15 @@ if(isset($_GET['shuffle']) && !isset($_GET['confirmed'])) { ?> +if(isset($_GET['clear']) && !isset($_GET['confirmed']) && !isset($_GET['done'])) { ?>
×

Are you sure you wanna do that...?

Clearing the list is permanent, and your head will roll if you do this at the wrong time. You might wanna save a PDF of the current list first.

- Yes, I'm positive. - No, please forgive me! + Yes, I'm positive. + No, please forgive me!
- +

All spooners have been successfully deleted.

diff --git a/init.php b/init.php new file mode 100644 index 0000000..885c68d --- /dev/null +++ b/init.php @@ -0,0 +1,15 @@ + \ No newline at end of file