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"); ?>