function showAction()
 {
     $this->group = new Group($this->args[1]);
     $this->feeds = Feed::get_all('WHERE group_id=' . $this->group->id);
     $this->screens = Screen::get_all('WHERE group_id=' . $this->group->id);
     $this->setTitle($this->group->name);
     $this->setSubject($this->group->name);
     $this->canEdit = $_SESSION['user']->can_write('group', $this->args[1]);
 }
 function listAction()
 {
     $this->feeds['public_feeds'] = Feed::get_all("WHERE type = 0 ORDER BY name");
     $this->feeds['restricted_feeds'] = Feed::get_all("WHERE type = 2 OR type = 1 OR type = 4 ORDER BY name");
     if ($_SESSION['user']->admin_privileges) {
         $this->feeds['private_feeds'] = Feed::get_all("WHERE type = 3  ORDER BY name");
     } else {
         $group_str = implode(',', $_SESSION['user']->groups);
         $this->feeds['private_feeds'] = Feed::get_all("WHERE type = 3 AND group_id IN ({$group_str}) ORDER BY name");
     }
     if (!is_array($this->feeds['public_feeds'])) {
         $this->feeds['public_feeds'] = array();
     }
     if (!is_array($this->feeds['restricted_feeds'])) {
         $this->feeds['restricted_feeds'] = array();
     }
     if (!is_array($this->feeds['private_feeds'])) {
         $this->feeds['private_feeds'] = array();
     }
 }
 function subscriptionsAction()
 {
     $this->screen = new Screen($this->args[1]);
     if (!$this->screen->set) {
         $this->flash("Screen not found", "error");
         redirect_to("../");
     }
     $this->setTitle('Managing Subscriptions for ' . $this->screen->name);
     $this->setSubject($this->screen->name);
     $this->feeds = Feed::get_all();
     $this->templateobj = new Template($this->screen->template_id);
     //Template is a keyword for the controller, so I call it something else
 }
Esempio n. 4
0
function deny_expired()
{
    $notification = "The content was denied automatically.  A moderator did not review this item before the expiration date.";
    $feeds = Feed::get_all();
    foreach ($feeds as $feed) {
        $contents = $feed->content_get('NULL');
        //Content that hasn't been moderated
        if ($contents) {
            foreach ($contents as $content) {
                if (strtotime($content['content']->end_time) < strtotime('NOW')) {
                    $feed->content_mod($content['content']->id, 0, 0, $content['content']->get_duration($feed), $notification);
                    echo "Denied {$content['content']->name} on {$feed->name}\n";
                }
            }
        }
    }
}