Index: og_forum.module
===================================================================
--- og_forum.module	(revision 149)
+++ og_forum.module	(working copy)
@@ -194,12 +481,36 @@
   switch ($op) {
     case 'prepare':
       if (arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'forum') {
-        if (!isset($_GET['edit']['og_groups'][0])) {
-          return FALSE;
-        }
+    //check if posting into your a group you are a member of, if you are not a member you can not post
+    $fid = arg(3);
+    $gid = og_forum_gid_from_tid($fid);
+    if ($gid){
+    global $user;
+    if (!array_key_exists($gid, $user->og_groups) && ($user->uid != 1)) {
+          form_set_error('title', t('You must !join before posting here.', array('!join' => l(t('join the group'), 'og/subscribe/'.$gid, array() ,'destination=node/add/forum/'. $fid . '?gids[]=' . $gid))));
+      drupal_goto('forum/'. $fid);
+    }  
       }
+    if (!isset($_GET['edit']['og_groups'][0])) {
+      return FALSE;
+        } 
+      }
       break;
-    case 'insert':
+    //add case validate
+    case 'validate':
+      $vid = _forum_get_vid();
+    $fid = $node->taxonomy[$vid];
+      $gid = og_forum_gid_from_tid($fid);
+    if ($gid){
+    global $user;
+    if (!array_key_exists($gid, $user->og_groups) && ($user->uid != 1)) {
+      form_set_error("taxonomy][2", t('You must !join before posting in this forum.', array('!join' => l(t('join the group'), 'og/subscribe/'.$gid, array('target' => '_blank') ,'destination=node/add/forum/'. $fid . '?gids[]=' . $gid ))));
+    }  
+      }
+    break;
+  case 'insert':
       if (og_is_group_type($node->type)) {
         $edit = array('name' => $node->title, 'vid' => _forum_get_vid());
         $status = taxonomy_save_term($edit);
