<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -386,6 +386,9 @@
             if ($post-&gt;status == &quot;draft&quot;)
                 Flash::message(__(&quot;This post is a draft.&quot;));
 
+            if ($post-&gt;groups() and !substr_count($post-&gt;status, &quot;{&quot;.Visitor::current()-&gt;group-&gt;id.&quot;}&quot;))
+                Flash::message(_f(&quot;This post is only visible by the following groups: %s.&quot;, $post-&gt;groups()));
+
             $this-&gt;display(array(&quot;pages/view&quot;, &quot;pages/index&quot;),
                            array(&quot;post&quot; =&gt; $post, &quot;posts&quot; =&gt; array($post)),
                            $post-&gt;title());</diff>
      <filename>includes/controller/Main.php</filename>
    </modified>
    <modified>
      <diff>@@ -721,7 +721,7 @@
             if ($visitor-&gt;group-&gt;can(&quot;view_private&quot;))
                 $statuses[] = &quot;private&quot;;
 
-            return &quot;posts.status IN ('&quot;.implode(&quot;', '&quot;, $statuses).&quot;') OR posts.status LIKE '%{&quot;.$visitor-&gt;group-&gt;id.&quot;}%'&quot;;
+            return &quot;posts.status IN ('&quot;.implode(&quot;', '&quot;, $statuses).&quot;') XOR (posts.status LIKE '%{&quot;.$visitor-&gt;group-&gt;id.&quot;}%' OR posts.user_id = &quot;.$visitor-&gt;id.&quot;)&quot;;
         }
 
         /**
@@ -744,4 +744,25 @@
 
             return new User($this-&gt;user_id);
         }
+
+        /**
+         * Function: groups
+         * Lists the groups who can view the post if the post's status is specific to certain groups.
+         */
+        public function groups() {
+            if ($this-&gt;no_results)
+                return false;
+
+            preg_match_all(&quot;/\{([0-9]+)\}/&quot;, $this-&gt;status, $groups, PREG_PATTERN_ORDER);
+            if (empty($groups[1]))
+                return false;
+
+            $names = array();
+            foreach ($groups[1] as $group_id) {
+                $group = new Group($group_id);
+                $names[] = $group-&gt;name;
+            }
+
+            return list_notate($names);
+        }
     }</diff>
      <filename>includes/model/Post.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3db2031326534389c121e17525740d0844a5a590</id>
    </parent>
  </parents>
  <author>
    <name>Alex Suraci</name>
    <email>i.am@toogeneric.com</email>
  </author>
  <url>http://github.com/vito/chyrp/commit/1f9bb11a28799baa28aeaddab88550c066da1918</url>
  <id>1f9bb11a28799baa28aeaddab88550c066da1918</id>
  <committed-date>2008-11-02T08:20:43-08:00</committed-date>
  <authored-date>2008-11-02T08:20:43-08:00</authored-date>
  <message>A post's creator can now view his post even if it's set to a group that
is not his own. A helpful message will be displayed when they view the
post to inform them.</message>
  <tree>7992e77704a1594977821fb2bd55dae61901159d</tree>
  <committer>
    <name>Alex Suraci</name>
    <email>i.am@toogeneric.com</email>
  </committer>
</commit>
