6.0.0-beta1
7/7/25

[#7877] removing user data
Summary removing user data
Queue Turba
Queue Version 2.3.1
Type Enhancement
State No Feedback
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester dom.lalot (at) gmail (dot) com
Created 01/21/2009 (6011 days ago)
Due
Updated 03/09/2009 (5964 days ago)
Assigned 02/01/2009 (6000 days ago)
Resolved 03/02/2009 (5971 days ago)
Milestone
Patch No

History
03/09/2009 01:52:37 PM Michael Rubinsky Comment #6 Reply to this comment
So, my guess is that your 'localsql' shares that are not being
removed are not defined as 'default' shares.
What do you mean?
Sorry. What I mean is that there would only every be *one* address 
book (when using shares) that is removed from Turba's data store.  The 
address book that is removed is what (internally, anyway) we call the 
"default", or "personal" address book - the one that would get created 
by default when the user first logs in if there are no other address 
books visible to the user at that time.  It's that last sentence that 
may cause confusion...say you have a "global" address book setup that 
all users can see.  A new user logging in will, in that case, *not* 
have a "default" address book created...therefore, will not have any 
address book removed automatically when the user's account is removed.



This was done as a precaution against inadvertently nuking data that 
other users may be using in a shared environment.
03/09/2009 07:57:26 AM dom (dot) lalot (at) gmail (dot) com Comment #5 Reply to this comment
Oops.. Sorry for the delay, I did not see your post
Currently the removeUserData api will only attempt to remove a user's
*default* share to reduce the possibility of accidentally deleting
shares that other users may have data in.  A default share is only
designated as a default share if, when the user initially logs in,
there is *no* other source that the user has access to.

So, my guess is that your 'localsql' shares that are not being
removed are not defined as 'default' shares.
What do you mean?



in turba prefs.php



// Address books to be displayed in the address book selection widget

// and in the Browse menu item.  The address book name is stored using

// the source key from sources.php (e.g. "localsql").  Separate

// entries with "\n" , e. g. 'value' => "localsql\nlocalldap" (the

// double quotes are REQUIRED).  If 'value' is empty (''), all address

// books that the user has permissions to will be listed.

$_prefs['addressbooks'] = array(

     'value' => '',

     'locked' => false,

     'shared' => false,

     'type' => 'implicit',

);



// Default directory

$_prefs['default_dir'] = array(

     'value' => '',

     // 'value' => 'localsql',

     'locked' => false,

     'shared' => false,

     'type' => 'select',

     'desc' => _("This will be the default address book when adding or 
importing contacts."),

);



my setup:



default_dir has been commented out as it has side effect (If I 
remember, localsql was not good when in shared mode..). In imp, there 
is a prefs to say where to add contacts and I added also a hook for 
seaerch sources (imp or kronolith) in horde/config/hooks.php:

function _prefs_hook_search_sources($username = null)



Anyway leaving default_dir blank, everything is working perfectly


03/02/2009 11:32:45 PM Michael Rubinsky State ⇒ No Feedback
 
02/01/2009 06:45:49 PM Michael Rubinsky Comment #4
State ⇒ Feedback
Reply to this comment
Currently the removeUserData api will only attempt to remove a user's 
*default* share to reduce the possibility of accidentally deleting 
shares that other users may have data in.  A default share is only 
designated as a default share if, when the user initially logs in, 
there is *no* other source that the user has access to.



So, my guess is that your 'localsql' shares that are not being removed 
are not defined as 'default' shares.
02/01/2009 06:33:27 PM Chuck Hagenbuch Assigned to Michael Rubinsky
State ⇒ Assigned
 
01/21/2009 04:16:02 PM dom (dot) lalot (at) gmail (dot) com Comment #3 Reply to this comment
removeUserData isn't supported by the LDAP driver.
Hello Chuck



I understand that for ldap, but not for the sql side



In my sources.php



$cfgSources['localsql'] = array(

     'title' => _("My Address Book"),

     'type' => 'sql',

..

     'export' => true,

     'browse' => true,

     'use_shares' => true,

     'list_name_field' => 'lastname',

);



$cfgSources['localldap'] = array(

     'title' => 'Annuaire U2',

     'type' => 'ldap',

..

     'strict' => array('dn','mail'),

     'browse' => true,

     'export' => false

);



My localsql data should have been cleaned, no?



I've seen strange behaviour that can explain something, if I make ldap 
not browsable (I would), I can't browse localsql. Seems there is a 
single api for both sources



Just trying to debug:



in horde-webmail-1.2.1/turba/lib/api.php (line 234)

     /* Only attempt share removal if we have shares configured */

     if ($_SESSION['turba']['has_share']) {

         $shares = &$GLOBALS['turba_shares']->listShares(

             $user, PERMS_EDIT, $user);



         /* Look for the deleted user's default share and remove it */

         foreach ($shares as $share) {

                     Horde::logMessage('tracedom3 
'.$share->get('params'), __FILE__, __LINE__, PEAR_LOG_ERR);

             $params = @unserialize($share->get('params'));

             /* Only attempt to delete the user's default share */

             if (!empty($params['default'])) {

                 $config = Turba::getSourceFromShare($share);

                 $driver = &Turba_Driver::singleton($config);

                 $result = $driver->removeUserData($user);

                 if (is_a($result, 'PEAR_Error')) {

                     Horde::logMessage($result, __FILE__, __LINE__, 
PEAR_LOG_ERR);

                     $hasError = true;

                 }

             }

         }



  $share->get('params') returns nothing, so localsql is not cleaned



Data was in turba_shares

share_id         share_name         share_owner         share_flags         perm_creator 
        perm_default         perm_guest         attribute_name         attribute_desc 
        attribute_params

103          r9906146          r9906146          0          0          0          0          Carnet d'adresses de 
Emmanuel XX          NULL          NULL



Hope this helps


01/21/2009 03:19:24 PM Chuck Hagenbuch Comment #2
State ⇒ Feedback
Reply to this comment
removeUserData isn't supported by the LDAP driver.
01/21/2009 02:06:22 PM dom (dot) lalot (at) gmail (dot) com Comment #1
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ removing user data
Queue ⇒ Turba
Milestone ⇒
Patch ⇒ No
State ⇒ New
Reply to this comment
Jan 21 14:20:22 HORDE [error] [turba] Removing user data is not 
supported in the current address book storage driver. [pid 17683 on 
line 221 of "/var/www/perso/horde-webmail-1.2.1/turba/lib/api.php"]



I followed Jan instruction for using the api to remove users, but in 
turba I got that error. That should be nice to get it working!



I have one localsql source in share mode and one in ldap mode.



And in SQL, I kept all the data from invalid users



Is it enhancement or bug?



Thanks



Dom

Saved Queries