Issues (1963)

html/user/prefs_remove.php (1 issue)

1
<?php
2
// This file is part of BOINC.
3
// http://boinc.berkeley.edu
4
// Copyright (C) 2008 University of California
5
//
6
// BOINC is free software; you can redistribute it and/or modify it
7
// under the terms of the GNU Lesser General Public License
8
// as published by the Free Software Foundation,
9
// either version 3 of the License, or (at your option) any later version.
10
//
11
// BOINC is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
// See the GNU Lesser General Public License for more details.
15
//
16
// You should have received a copy of the GNU Lesser General Public License
17
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
18
19
include_once("../inc/util.inc");
20
include_once("../inc/prefs.inc");
21
include_once("../inc/prefs_project.inc");
22
23
check_get_args(array("subset", "venue", "confirmed", "cols", "tnow", "ttok"));
24
25
$user = get_logged_in_user();
26
check_tokens($user->authenticator);
27
28
$subset = get_str("subset");
29
$venue = get_str("venue");
30
$confirmed = get_str("confirmed", true);
31
$columns = get_int("cols", true);
32
$c = $columns?"&cols=$columns":"";
33
34
if ($confirmed) {
35
    if ($subset == "global") {
36
        $main_prefs = prefs_parse_global($user->global_prefs);
37
        $main_prefs->$venue = null;
38
        global_prefs_update($user, $main_prefs);
39
    } else {
40
        $main_prefs = prefs_parse_project($user->project_prefs);
41
        $main_prefs->$venue = null;
42
        project_prefs_update($user, $main_prefs);
43
    }
44
    Header("Location: prefs.php?subset=$subset$c");
0 ignored issues
show
Calls to inbuilt PHP functions must be lowercase; expected "header" but found "Header"
Loading history...
45
} else {
46
    page_head(tra("Confirm delete preferences"));
47
    $tokens = url_tokens($user->authenticator);
48
    echo "<p>".
49
        tra("Are you sure you want to delete your separate %1 preferences for %2?", subset_name($subset), $venue).
50
        "</p><br><br>\n";
51
    show_button(
52
        "prefs_remove.php?subset=$subset&venue=$venue&confirmed=yes$c$tokens",
53
        tra("Yes"), tra("Remove preferences")
54
    );
55
    show_button("prefs.php?subset=$subset$c", tra("Cancel"), tra("Cancel"));
56
    page_tail();
57
}
58
59
?>
60