Drupal: delete source_* tags in preferences when updating

This information is added by the Client when propagating the preferences between projects. When setting new preferences the old information needs to be deleted. I confirmed that this is the correct behaviour in the non-drupal BOINC code.
This commit is contained in:
Christian Beer 2016-08-31 15:42:44 +02:00
parent 74cc72ba83
commit aae29934d3
1 changed files with 7 additions and 0 deletions

View File

@ -844,6 +844,13 @@ function boincwork_save_prefs($prefs, $type = 'general', $venue = null, $account
$main_prefs = array_merge(array('mod_time' => 0), $main_prefs);
}
$main_prefs['mod_time'] = time();
// unset source information, the Client will fill this in again
if (isset($main_prefs['source_project'])) {
unset($main_prefs['source_project']);
}
if (isset($main_prefs['source_scheduler'])) {
unset($main_prefs['source_scheduler']);
}
}
// Convert prefs back to XML and save to database