1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 21:02:41 +01:00

Calendar - make calendar publicly accessible

Summary: yay public policy. Ref T4830.

Test Plan: browsed about calendar from a logged out browser

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T4830

Differential Revision: https://secure.phabricator.com/D9120
This commit is contained in:
Bob Trahan 2014-05-14 10:00:46 -07:00
parent d111536ae2
commit 53e95d37cf
4 changed files with 29 additions and 0 deletions

View file

@ -3,6 +3,10 @@
final class PhabricatorCalendarBrowseController
extends PhabricatorCalendarController {
public function shouldAllowPublic() {
return true;
}
public function processRequest() {
$now = time();
$request = $this->getRequest();

View file

@ -5,6 +5,10 @@ final class PhabricatorCalendarEventListController
private $queryKey;
public function shouldAllowPublic() {
return true;
}
public function willProcessRequest(array $data) {
$this->queryKey = idx($data, 'queryKey');
}

View file

@ -5,6 +5,10 @@ final class PhabricatorCalendarEventViewController
private $id;
public function shouldAllowPublic() {
return true;
}
public function willProcessRequest(array $data) {
$this->id = $data['id'];
}

View file

@ -3,6 +3,10 @@
final class PhabricatorCalendarViewController
extends PhabricatorCalendarController {
public function shouldAllowPublic() {
return true;
}
public function processRequest() {
$user = $this->getRequest()->getUser();
@ -89,6 +93,19 @@ final class PhabricatorCalendarViewController
$view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
->setTitle(pht('Successfully deleted your status.'));
} else if (!$request->getUser()->isLoggedIn()) {
$login_uri = id(new PhutilURI('/auth/start/'))
->setQueryParam('next', '/calendar/');
$view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
->setTitle(
pht(
'You are not logged in. %s to see your calendar events.',
phutil_tag(
'a',
array(
'href' => $login_uri),
pht('Log in'))));
}
return $view;