Ops: increase mod_time when repairing preferences

Increasing mod_time will trigger a resend of the repaired preferences on the next RPC to the Client updating the preferences there.
This commit is contained in:
Christian Beer 2016-10-27 14:51:13 +02:00
parent 2e07e83275
commit b3ff3b8fcb
1 changed files with 7 additions and 2 deletions

View File

@ -34,8 +34,13 @@ function process_set($users) {
echo "repairing prefs for user $user->id\n";
$p = repair_prefs($user->global_prefs);
if ($p) {
$retval = @simplexml_load_string($p);
if ($retval) {
$xml_obj = @simplexml_load_string($p);
if ($xml_obj) {
// increase mod_time by 1 second so new preferences are propagated to the Client
$xml_obj->mod_time = 1 + intval($xml_obj->mod_time);
$p = $xml_obj->asXML();
// remove XML header
$p = implode("\n", array_slice(explode("\n", $p), 1));
$user->update("global_prefs='$p'");
echo " repair succeeded\n";
} else {