1 | <?php |
||
2 | // This file is part of BOINC. |
||
3 | // http://boinc.berkeley.edu |
||
4 | // Copyright (C) 2012 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 | // reset user's preferences to the defaults |
||
20 | |||
21 | require_once("../inc/util.inc"); |
||
22 | require_once("../inc/prefs.inc"); |
||
23 | |||
24 | $confirmed = get_int("confirmed", true); |
||
25 | $user = get_logged_in_user(); |
||
26 | |||
27 | if (!$confirmed) { |
||
28 | page_head("Confirm reset preferences"); |
||
29 | echo " |
||
30 | You have requested restoring your computing preferences |
||
31 | to the default settings. |
||
32 | Your current preferences will be discarded. |
||
33 | Do you really want to do this? |
||
34 | <br> |
||
35 | "; |
||
36 | show_button("prefs_default.php?confirmed=1", "Yes", "Restore default preferences"); |
||
37 | show_button("prefs.php", "No", "Keep current preferences"); |
||
38 | page_tail(); |
||
39 | } else { |
||
40 | $prefs = default_prefs_global(); |
||
41 | $retval = global_prefs_update($user, $prefs); |
||
42 | if ($retval) { |
||
43 | error_page("Couldn't restore default preferences."); |
||
44 | } else { |
||
45 | Header("Location: prefs.php?subset=global&defaults=1$c"); |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
46 | } |
||
47 | } |
||
48 | |||
49 | ?> |
||
50 |