* * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. * * You should have received a copy of the GNU Affero General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ \OCP\User::checkLoggedIn(); \OCP\App::checkAppEnabled('collaboration'); OCP\App::setActiveNavigationEntry('collaboration'); OCP\Util::addScript('collaboration', 'projects'); OCP\Util::addStyle('collaboration', 'tabs'); OCP\Util::addStyle('collaboration', 'content_header'); OCP\Util::addStyle('collaboration', 'projects'); $tpl = new OCP\Template("collaboration", "projects", "user"); if (isset($_GET['project']) && $_GET['project'] != 'ALL') { if (!OC_Collaboration_Project::isMemberWorkingOnProjectByTitle(OC_User::getUser(), $_GET['project'])) { header('Location: ' . \OCP\Util::linkToRoute('collaboration_route', array('rel_path' => 'dashboard'))); throw new Exception(OC_User::getUser() . ' is trying to access project ' . $_GET['project']); exit; } else { $tpl->assign('project', $_GET['project']); $tpl->assign('projects', OC_Collaboration_Project::getProjectDetails(OC_User::getUser(), $_GET['project'])); } } else { $tpl->assign('projects', OC_Collaboration_Project::getProjectDetails(OC_User::getUser())); } $tpl->printPage();
* * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ OCP\JSON::checkLoggedIn(); OCP\JSON::callCheck(); OCP\JSON::checkAppEnabled('collaboration'); $l = OC_L10N::get('collaboration'); if (isset($_POST['member']) && isset($_POST['start']) && isset($_POST['count']) && isset($_POST['project'])) { if (strcasecmp($_POST['member'], OC_User::getUser()) != 0) { \OCP\Util::writeLog('collaboration', OC_User::getUser() . ' is trying to access posts of ' . $_POST['member'], \OCP\Util::WARN); OC_JSON::error(); exit; } if ($_POST['project'] != '' && !OC_Collaboration_Project::isMemberWorkingOnProjectByTitle(OC_User::getUser(), $_POST['project'])) { \OCP\Util::writeLog('collaboration', OC_User::getUser() . ' is trying to access project ' . $_POST['project'], \OCP\Util::WARN); OC_JSON::error(); exit; } $posts = OC_Collaboration_Post::readPosts($_POST['member'], $_POST['project'], $_POST['start'], $_POST['count']); $text = ''; foreach ($posts as $each) { if (!isset($each['title']) || $each['title'] == '') { break; } $datetime = explode(' ', $each['time']); $text .= '<div class="unit"> <div class="post_title">' . $each['title'] . '</div> <div class="contents">' . $each['content'] . '<br />