[horde] Kronolith : How can I get rid of shared diary ?

Gerard Breiner gerard.breiner at ias.u-psud.fr
Thu Feb 26 16:33:37 UTC 2009


Michael Rubinsky a écrit :
>
> Quoting Gerard Breiner <gerard.breiner at ias.u-psud.fr>:
>
>> Jan Schneider a écrit :
>>> Zitat von Gerard Breiner <gerard.breiner at ias.u-psud.fr>:
>>>
>>>> Jan Schneider a écrit :
>>>>> Zitat von Gerard Breiner <gerard.breiner at ias.u-psud.fr>:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> Agendas of people who do not longer work with us still appear in 
>>>>>> the list "Shared Diary" in kronolith.
>>>>>> How can I get rid of  those shared diary .?
>>>>>
>>>>> Remove (or clean) the user through Horde's user administration.
>>>>>
>>>>> Jan.
>>>>>
>>>> Thanks for your answer Jan. Nevertheless,  my users are on a LDAP 
>>>> serveur and there is a user that is no longer on LDAP but appears 
>>>> on the list "Shared Diary".
>>>> It seems that the only way for deleting him is a request sql sur 
>>>> horde_prefs, isn't it ?
>>>
>>> You can (and should) still use the internal removeUserData API. This 
>>> has been discussed on this already.
>>>
>>> Jan.
>>>
>> Thanks indeed !
>>
>> I wrote a script and execute it through Horde's PHP interpreter.
>> The method removeUserData  works for clearing horde_prefs but not for 
>> horde_datatree.
>> I get the users ldap and put them in an array $valides. I get all 
>> pref_uid from horde_pref and put them in an array $uid. I get all 
>> user_uid from horde_datatree and put them in $datatree.
>> Here is a the piece of code where removeUserData is doing his job.
>>
>> Data in horde_prefs has been removed  after this code has been executed.
>> [CODE]
>> foreach ($uid as $val) {
>>   if (!in_array($val,$valides)){
>>       echo "Not Found $val in horde_prefs table\n";
>>       $registry->call('horde/removeUserData', $val);      }
>> }
>> [/CODE]
>>
>> Altough the list of all $val2 is displayed by the "echo" command ,  
>> Data in horde_datatree has not been removed  after this code has been 
>> executed.
>> [CODE]
>> foreach ($datatree as $val2) {
>>   if (!in_array($val2,$valides)){
>>      echo "Not Found $val2 in horde_datatree\n";           
>> $registry->call('horde/removeUserData', $val2);
>>   }
>> }
>> [/CODE]
>>
>> An idea please ?
>
>
> Which specific data in the datatree is not being removed? The datatree 
> stores data for multiple systems/modules/whatever. In the code above 
> your only calling horde/removeUserData but you would need to call, for 
> example, contacts/removeUserData to remove the data from Turba's 
> shares. ...
>
> Also, be aware that with some of the applications (like Turba) only 
> shares that are considered "default" shares will be removed.  
> Additional shares that the user may have added will *not* be removed 
> by removeUserData.
>
>
>
> Thanks,
> mike
>
> -- 
> The Horde Project (www.horde.org)
> mrubinsk at horde.org
>
> "Time just hates me. That's why it made me an adult." - Josh Joplin
> -- 
> Horde mailing list - Join the hunt: http://horde.org/bounties/#horde
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
Thanks Mike for your answer and thanks too for your very usefull 
explanations on your website about registry and api.
Yes I'm  currently using the datatree as the storage backend.
The specific data I want removed from horde_datatree is 
"horde.shares.kronolith"  for the user who do not longer belonged to the 
ldap list ($valides). It is this field ("horde.shares.kronolith") that 
make  visible "shared calendars" in kronolith..
Nevertheless the fact that "removeUserData" is limited  in its use is a 
very good information. In fact, it has absolutely no effect  on  
horde_datatree table.
So,  a way for clearing horde_datatree  is a SQL request :

[CODE]
foreach ($uid as $val) {
     if (!in_array($val,$valides)){
         echo "Not Found $val in horde_datatree table\n";
         $db->query("DELETE FROM horde_datatree where user_uid = 
'$val2'"); 
    }
}
[/CODE]

I can put all the code if anyone are interested.

Best regards

Gerard Breiner




-- 
Université Paris-Sud 11
Institut D'Astrophysique Spatiale
Gérard Breiner
Rue Georges Clémenceau
fr-91405 Orsay-ville 



More information about the horde mailing list