From 79d3c7d3c4b7df138039b6a8f0d9926aa223a370 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 8 Oct 2004 19:57:20 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=4305 --- checkin_notes | 6 ++++++ html/user/prefs_remove.php | 30 ++++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/checkin_notes b/checkin_notes index 48606b6f17..b2d200694e 100755 --- a/checkin_notes +++ b/checkin_notes @@ -18179,3 +18179,9 @@ David 7 Oct 2004 py/Boinc/ db_base.py + +David 8 Oct 2004 + - Add confirm before delete prefs + + html/user/ + prefs_remove.php diff --git a/html/user/prefs_remove.php b/html/user/prefs_remove.php index fce18716d9..dc31fdbace 100644 --- a/html/user/prefs_remove.php +++ b/html/user/prefs_remove.php @@ -10,16 +10,30 @@ $user = get_logged_in_user(); $subset = $_GET["subset"]; $venue = $_GET["venue"]; +$confirmed = $_GET["confirmed"]; -if ($subset == "global") { - $main_prefs = prefs_parse_global($user->global_prefs); - $main_prefs->$venue = null; - global_prefs_update($user, $main_prefs); +if ($confirmed) { + if ($subset == "global") { + $main_prefs = prefs_parse_global($user->global_prefs); + $main_prefs->$venue = null; + global_prefs_update($user, $main_prefs); + } else { + $main_prefs = prefs_parse_project($user->project_prefs); + $main_prefs->$venue = null; + project_prefs_update($user, $main_prefs); + } + Header("Location: prefs.php?subset=$subset"); } else { - $main_prefs = prefs_parse_project($user->project_prefs); - $main_prefs->$venue = null; - project_prefs_update($user, $main_prefs); + page_head("Confirm delete preferences"); + echo " +

+ Are you sure you want to delete your separate ", subset_name($subset), + " preferences for $venue? +

+ Yes + | Cancel + "; + page_tail(); } -Header("Location: prefs.php?subset=$subset"); ?>