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:
parent
d111536ae2
commit
53e95d37cf
4 changed files with 29 additions and 0 deletions
|
@ -3,6 +3,10 @@
|
|||
final class PhabricatorCalendarBrowseController
|
||||
extends PhabricatorCalendarController {
|
||||
|
||||
public function shouldAllowPublic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function processRequest() {
|
||||
$now = time();
|
||||
$request = $this->getRequest();
|
||||
|
|
|
@ -5,6 +5,10 @@ final class PhabricatorCalendarEventListController
|
|||
|
||||
private $queryKey;
|
||||
|
||||
public function shouldAllowPublic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function willProcessRequest(array $data) {
|
||||
$this->queryKey = idx($data, 'queryKey');
|
||||
}
|
||||
|
|
|
@ -5,6 +5,10 @@ final class PhabricatorCalendarEventViewController
|
|||
|
||||
private $id;
|
||||
|
||||
public function shouldAllowPublic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function willProcessRequest(array $data) {
|
||||
$this->id = $data['id'];
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue