Add a wordpress blog to my website having users

I haven’t been working with WordPress too much, so there may be someone who can give you more details. But here’s what I’ve come to understand:

If you want to have multiple blogs (one for each group) then you need to EITHER:

  1. Filter the posts according to who is logged in
  2. Operate a multi-site WordPress install

The former could be done as part of the plugin that I will explain later, the latter can be done using WordPress core – although it will not be able to dynamically create these new blogs if a new user group were added.

As far as having users logged into your own website recognized as authenticated in WordPress, you would need a plugin that loads after WordPress’s own user authentication. If you load before WordPress’s user authentication then you would verify they were logged in and WordPress would immediately over-write this saying that they were not. The init hook would work best for this (http://codex.wordpress.org/Plugin_API/Action_Reference)

add_action('init', 'load_my_user');
function load_my_user(){
    /* Determine the user ID and name of who is logged in*/
    /* You should know how to do this for your website */
    wp_set_current_user($id, $name);
}

If the user does not exist then WordPress should create it, so if user registration is disabled in WordPress (done via the Dashboard) to prevent an ID collision then your users should be able to immediately take advantage of this and log in.

As for filtering the returned posts according to group, I’m not entirely sure how that would work, but I suspect it would involve the pre_get_posts or posts_selection hook. In fact, it may even be possible to do this using WordPress core features. I’m really not clear on this much. But the above should help you at least log in to WordPress with your current user database =)