Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter jschinker

    (@jschinker)

    Sorry for the late reply here. I actually cheated. In my case, all of my blogs are http://hostname.org/username, so it was as simple as:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    This is not done anywhere in WordPress itself. This is part of a much larger script that deletes the user system-wide.

    Note that the default behavior does change in 3.2.1.

    When a user logs in to the main site, they now get this message:
    http://www.flickr.com/photos/63873121@N00/5997264349/in/photostream

    The code that David posted above does work to redirect them to their dashboards, though. I just put it in a file in the mu-plugins folder and everything seems to be working like it used to now.

    Thanks, everyone, for documenting this and making it so easy to fix.

    I’m seeing the same thing after upgrading to 1.7.0, also on multisite 3.0.4. Permissions are fine. Apache can definitely write to the directory, and it makes the directory for the gallery fine. Inside the gallery folder, I get an empty thumbs folder, but no images.

    Thread Starter jschinker

    (@jschinker)

    Just to follow up on this, I was in dependency hell when I was trying to call wpmu_delete_blog from a non-wordpress script. I ended up just setting the deleted flag in the wp_blogs table. That should prohibit access to the blog’s content, which was the main point anyway.

    For users, I just looked up the id from wp_users based on username, and then deleted that userid from the wp_users and wp_usermeta tables.

    So far, everything seems to be working all right.

    Thanks again for your help.

    Thread Starter jschinker

    (@jschinker)

    Yep. I would definitely not rely on the $blog_id and $user_id being the same. In most cases on my server, they’re not.

    Would it be a better idea to just delete the user, and then use a separate cleanup script to delete all of the blogs that don’t have owners? I’m not entirely sure I like that, either. And, admittedly, I haven’t really looked at what happens to the blog when you delete its owner, so it may not even be feasible (if, for example, it reverts to the admin account).

    In my case, the users log in, and I use wpdirauth to authenticate them against ldap. If they don’t have a blog, it creates one of the form http://mydomain/username. So when deleting, I could be able to just look up that user’s blog by the address, and get the correct id to remove. I don’t have any cases where they have multiple blogs, so it should be pretty straightforward.

    Thanks for your help. I think I’m on the right track. I was mostly worried about it not working because I was calling it from outside the WP admin interface.

Viewing 5 replies - 1 through 5 (of 5 total)