Example #1
0
    if (!Session::isAdmin() && !$project->isCreator(Session::getUserID())) {
        if (!$project->isInvited(Session::getUserID()) && !$project->isMember(Session::getUserID()) && !$project->isTrusted(Session::getUserID()) || ProjectUser::isBanned(Session::getUserID(), $project->getID())) {
            header('Location: ' . Url::error());
            exit;
        }
    }
}
// // validate username
// $username = Filter::text($_GET['u']);
// $user = User::loadByUsername($username);
// // check if user has accepted task
//$accepted = Accepted::getByUserID(Session::getUserID(), $taskID);
// if($accepted == null) {
// header('Location: '.Url::error());
// exit();
// }
//$updates = Update::getByAcceptedID($accepted->getID());
// get existing updates
$accepted = Accepted::getByUserID(Session::getUserID(), $taskID);
if ($accepted == null) {
    header('Location: ' . Url::error());
    exit;
}
$updates = Update::getByAcceptedID($accepted->getID());
$soup = new Soup();
$soup->set('project', $project);
$soup->set('task', $task);
$soup->set('updates', $updates);
//$soup->set('user', $user);
//$soup->set('accepted', $accepted);
$soup->render('project/page/updateNew');
Example #2
0
 public function getUpdates()
 {
     return Update::getByAcceptedID($this->id);
 }