[#14577] Virtual address books are not deleted
Summary Virtual address books are not deleted
Queue Turba
Queue Version 4.2.18
Type Bug
State Resolved
Priority 1. Low
Owners mrubinsk@horde.org
Requester wahnes@uni-koeln.de
Created 2017-02-13 (923 days ago)
Due
Updated 2017-10-20 (674 days ago)
Assigned 2017-02-21 (915 days ago)
Resolved 2017-02-25 (911 days ago)
Milestone
Patch No

Comments
wahnes@uni-koeln.de 2017-02-13 12:59:59
Virtual address books belonging to a certain user are not deleted when 
that user's data is to be deleted (horde-remove-user-data).

Jan Schneider <jan@horde.org> 2017-02-21 21:29:53
Michael, can you take a look?

I've tracked it so far down that I know this happens because when 
trying to instantiate the Vbook driver, it relies on the base share. 
That one doesn't exist, because it is pulled from $cfgSources. But 
that doesn't contain the correct address books, because 
removeUserData() is executed in the context of the admin user.
Of course this is the fault of our $cfgSources being a static global, 
for a hot fix, we should be able to pass the base share information to 
the driver factory for vbooks, to not rely on the lookup from 
$cfgSources based on the share name.

Git Commit <commits@lists.horde.org> 2017-02-25 04:47:48
Changes have been made in Git (master):

commit 67f23e355a8d2133a5a0ba9fd05a8e629c8074d0
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Fri Feb 24 23:43:38 2017 -0500

     Bug: 14577 Fix removing virtual address books with removeUserData().

     We need to workaround the fact that the cfgSources array is dynamically
     built for the currently logged in user, but when removeUserData is
     called, we are logged in as the admin user, not the user we are
     removing. In this case, built a separate cfgSource structure out of
     the shares we know are owned by the user being removed.

  turba/lib/Application.php    | 10 ++++++++--
  turba/lib/Driver/Vbook.php   | 31 ++++++++++++++++++++++++++++---
  turba/lib/Factory/Driver.php | 29 +++++++++++++++++++++--------
  turba/lib/Turba.php          | 31 ++++++++++++++++++++++---------
  4 files changed, 79 insertions(+), 22 deletions(-)

http://github.com/horde/horde/commit/67f23e355a8d2133a5a0ba9fd05a8e629c8074d0

Git Commit <commits@lists.horde.org> 2017-02-25 04:54:37
Changes have been made in Git (FRAMEWORK_5_2):

commit 9f64616a2636810ec30b3286f1ac3dc2289e3e51
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Fri Feb 24 23:43:38 2017 -0500

     Bug: 14577 Fix removing virtual address books with removeUserData().

     We need to workaround the fact that the cfgSources array is dynamically
     built for the currently logged in user, but when removeUserData is
     called, we are logged in as the admin user, not the user we are
     removing. In this case, built a separate cfgSource structure out of
     the shares we know are owned by the user being removed.

  turba/lib/Application.php    | 10 ++++++++--
  turba/lib/Driver/Vbook.php   | 41 ++++++++++++++++++++++++++++++++++++++---
  turba/lib/Factory/Driver.php | 28 ++++++++++++++++++----------
  turba/lib/Turba.php          | 31 ++++++++++++++++++++++---------
  4 files changed, 86 insertions(+), 24 deletions(-)

http://github.com/horde/horde/commit/9f64616a2636810ec30b3286f1ac3dc2289e3e51

Git Commit <commits@lists.horde.org> 2017-10-20 20:34:52
Changes have been made in Git (FRAMEWORK_5_2):

commit 95fa317be8b1dc0977790ccf5d67254209f89646
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Fri, 24 Feb 2017 23:53:23 -0500

Bug: 14577 Fix removing virtual address books with removeUserData().

We need to workaround the fact that the cfgSources array is dynamically
built for the currently logged in user, but when removeUserData is
called, we are logged in as the admin user, not the user we are
removing. In this case, built a separate cfgSource structure out of
the shares we know are owned by the user being removed.

  M lib/Application.php
  M lib/Driver/Vbook.php
  M lib/Factory/Driver.php
  M lib/Turba.php

https://github.com/horde/turba/commit/95fa317be8b1dc0977790ccf5d67254209f89646