#2 Allow deletion of the blog owner if blog gets deleted


If a blog gets deleted, the plugin could ask to also delete the user for whom the blog had been created.

Or the other way around: if a user gets deleted, ask to also delete the blog which the autoblog_plugin has created for him/her.

The plugin would have to use a DB table to maintain a mapping between users and blogs and hook into the delete process.

I'm not sure if there are hooks already in b2evo, but those can get added, of course.


  • Francesco

    Francesco - 2007-03-08

    Logged In: YES
    Originator: NO

    Current situation:
    I already implemented a mapping between "autoblogs" and users in usersettings table:
    for each userID -> autoblog_created = blog_ID.

    Also, if a user gets deleted, corresponding autoblog is deleted, as it is supposed to be created especially for that user, not the way back as, I thought we could delete a user blog, without necessarily deleting the user.
    This is the current raw structure which could be adapted to your needs, adding confirmation in both cases.

    Hooks right BEFORE deleting user or blog, would be needed, as currently it is integrated in the hack (same as for old requested hook in form input creation).

    Once you confirm me this is what you want and that mapping in usersettings is ok, I could work on it. (keep in mind that if we change/move the mapping table, if somebody upgrades autoblog plugin, it will not be backwards compatible, loosing the mapping of the already created autoblogs )

  • daniel hahler

    daniel hahler - 2007-03-08

    Logged In: YES
    Originator: YES

    It's not my feature wish, I've just filed it based on http://forums.b2evolution.net/viewtopic.php?p=52271.

    It seems like the current behavious is quite decent already. Maybe the original poster of the feature request should clarify it's wish.

    Apart from that, here are some thoughts about it:
    The mapping in UserSettings seems OK, but it's hard to find a user for a given blog then.
    Therefor it's better to have an own table for it (through GetDbLayout()). The UserSettings could get transferred in the PluginVersionChanged hook, which gets called if the installed plugin version has changed.

    I suppose the following hooks in b2evo would be needed:
    AdminDisplayUserDeleteForm (display a checkbox there)
    AdminDisplayBlogDeleteForm (display a checkbox there)

    AfterBlogDelete (Delete the user there, if the checkbox had been checked)
    AfterUserDelete already exists.

    Not required, but complements the others (may cancel the action):

    (Note that it's not guaranteed to arrive in AfterBlogDelete/AfterUserDelete after AdminDisplayBlogDeleteForm had been called. So there should be also a hidden checkbox that we've been there.)

    Does this sound reasonable?

  • Orator

    Orator - 2007-03-08

    Logged In: YES
    Originator: NO

    IMHO, I believe that there should be an extra check to see whether the user has more than one blog. Ergo:

    1 Event: Delete blog
    2 Check who is the user
    3 Check if there are other blogs linked to that name
    4 Ask Admin is he wants to delete the current blog only or the user linked to it and the following other blogs (list
    5 Delete blogs, delete user.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks