[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-users] Deleting addressbook contact of one user

From: Dave Hall
Subject: Re: [Phpgroupware-users] Deleting addressbook contact of one user
Date: Mon, 02 Aug 2004 20:10:23 +1000

Hi Massimiliano,

a php script which does something like the one below should do the
trick.  read the notes below.

        $GLOBALS['phpgw_info']['flags']['current_app'] = 'addressbook';

                echo 'All entries for ' . $GET['user_id'] .' deleted';
                echo 'You are not an admin user - go away!';

* This script is untested, and provided as an example only.

* If you use non cookie based sessions then you will need to copy the
session information into the url

* Save the script as

* Call the script using
after logging in as admin.

* if it breaks you get to keep both pieces ;)



On Mon, 2004-08-02 at 18:58, Massimiliano Mirra wrote:
> ...or "migration woes".
> Users are importing several contacts from Outlook CSV at once before
> realizing that the result is less than optimal.  So I had to put
> together some SQL for cleanup, that deletes all contact owned by a
> certain account_id (e.g. `100'):
>     create temporary table ids
>         select contact_id from phpgw_contact
>         where owner=100 and contact_type_id=1;
>     delete from phpgw_contact_person
>         using ids, phpgw_contact_person
>         where ids.contact_id = phpgw_contact_person.person_id;
>     [ the same for phpgw_contact_addr, phpgw_contact_comm,
>     phpgw_contact_note, phpgw_contact_others...]
>     delete from phpgw_contact
>         using ids, phpgw_contact
>         where ids.contact_id = phpgw_contact.contact_id;
>     drop table ids;
> I'm not very familiar with phpgw db schema, did I miss anything?
> Massimiliano (bard)
> _______________________________________________
> Phpgroupware-users mailing list
> address@hidden
Dave Hall (aka skwashd)
API Coordinator

reply via email to

[Prev in Thread] Current Thread [Next in Thread]