BOINC /
boinc
| 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/db.inc"); |
||
| 20 | include_once("../inc/util.inc"); |
||
| 21 | include_once("../inc/prefs.inc"); |
||
| 22 | include_once("../inc/prefs_project.inc"); |
||
| 23 | |||
| 24 | $user = get_logged_in_user(); |
||
|
0 ignored issues
–
show
|
|||
| 25 | |||
| 26 | $action = sanitize_tags(get_str("action", true)); |
||
| 27 | $subset = sanitize_tags(get_str("subset")); |
||
| 28 | $venue = sanitize_tags(get_str("venue", true)); |
||
| 29 | $columns = get_int("cols", true); |
||
| 30 | $c = $columns?"&cols=$columns":""; |
||
| 31 | check_subset($subset); |
||
| 32 | if ($action) { |
||
| 33 | check_tokens($user->authenticator); |
||
| 34 | if ($subset == "global") { |
||
| 35 | $main_prefs = prefs_parse_global($user->global_prefs); |
||
| 36 | if ($venue) $prefs = $main_prefs->$venue; |
||
| 37 | else $prefs = $main_prefs; |
||
| 38 | $error = prefs_global_parse_form($prefs); |
||
| 39 | if ($error != false) { |
||
| 40 | $title = tra("Edit %1 preferences", subset_name($subset)); |
||
| 41 | if ($venue) $title = "$title for $venue"; |
||
| 42 | page_head($title); |
||
| 43 | |||
| 44 | echo PREFS_FORM_DESC1; |
||
| 45 | echo PREFS_FORM_ERROR_DESC; |
||
| 46 | |||
| 47 | print_prefs_form( |
||
| 48 | "edit", $subset, $venue, $user, $prefs, $columns, $error |
||
| 49 | ); |
||
| 50 | } else { |
||
| 51 | if ($venue) $main_prefs->$venue = $prefs; |
||
| 52 | else $main_prefs = $prefs; |
||
| 53 | global_prefs_update($user, $main_prefs); |
||
| 54 | Header("Location: prefs.php?subset=$subset&updated=1$c"); |
||
|
0 ignored issues
–
show
|
|||
| 55 | } |
||
| 56 | } else { |
||
| 57 | $main_prefs = prefs_parse_project($user->project_prefs); |
||
| 58 | if ($venue) $prefs = $main_prefs->$venue; |
||
| 59 | else $prefs = $main_prefs; |
||
| 60 | |||
| 61 | $project_error = prefs_project_parse_form($prefs); |
||
| 62 | $error = prefs_resource_parse_form($prefs); |
||
| 63 | if ($error != false || $project_error != false) { |
||
| 64 | $title = tra("Edit %1 preferences", subset_name($subset)); |
||
| 65 | if ($venue) $title = tra("%1 for %2", $title, $venue); |
||
| 66 | page_head($title); |
||
| 67 | |||
| 68 | echo PREFS_FORM_ERROR_DESC; |
||
| 69 | |||
| 70 | print_prefs_form( |
||
| 71 | "edit", $subset, $venue, $user, $prefs, $columns, $error, |
||
| 72 | $project_error |
||
| 73 | ); |
||
| 74 | } else { |
||
| 75 | if ($venue) { |
||
| 76 | $main_prefs->$venue = $prefs; |
||
| 77 | } else { |
||
| 78 | $main_prefs = $prefs; |
||
| 79 | prefs_privacy_parse_form($user); |
||
| 80 | prefs_consent_parse_update($user); |
||
| 81 | } |
||
| 82 | |||
| 83 | project_prefs_update($user, $main_prefs); |
||
| 84 | |||
| 85 | if (!$venue) { |
||
| 86 | venue_parse_form($user); |
||
| 87 | $user->update("venue='$user->venue'"); |
||
| 88 | } |
||
| 89 | Header("Location: prefs.php?subset=$subset&updated=1$c"); |
||
|
0 ignored issues
–
show
|
|||
| 90 | } |
||
| 91 | } |
||
| 92 | } else { |
||
| 93 | $title = tra("Edit %1 preferences", subset_name($subset)); |
||
| 94 | if ($venue) $title = tra("%1 for %2", $title, $venue); |
||
| 95 | page_head($title); |
||
| 96 | checkbox_clicked_js(); |
||
| 97 | |||
| 98 | if ($subset == "global") { |
||
| 99 | echo PREFS_FORM_DESC1; |
||
| 100 | $prefs = prefs_parse_global($user->global_prefs); |
||
| 101 | if ($venue) { |
||
| 102 | $prefs = $prefs->$venue; |
||
| 103 | } |
||
| 104 | } else { |
||
| 105 | $prefs = prefs_parse_project($user->project_prefs); |
||
| 106 | if ($venue) { |
||
| 107 | $prefs = $prefs->$venue; |
||
| 108 | } |
||
| 109 | } |
||
| 110 | print_prefs_form("edit", $subset, $venue, $user, $prefs, $columns); |
||
| 111 | } |
||
| 112 | echo "<a href=prefs.php?subset=$subset$c>".tra("Back to preferences")."</a>\n"; |
||
| 113 | page_tail(); |
||
| 114 | |||
| 115 | ?> |
||
| 116 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.