Fix T38210: phabricator file downloads not working for non-logged in users.

This commit is contained in:
2014-01-15 15:53:50 +01:00
parent 5278e94566
commit 30f0de9427
3 changed files with 9 additions and 1 deletions

View File

@@ -10,6 +10,10 @@ final class PhabricatorFileDataController extends PhabricatorFileController {
$this->key = $data['key'];
}
public function shouldAllowPublic() {
return true;
}
public function shouldRequireLogin() {
return false;
}

View File

@@ -4,6 +4,10 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
private $phid;
public function shouldAllowPublic() {
return true;
}
public function willProcessRequest(array $data) {
$this->phid = $data['phid'];
}

View File

@@ -40,7 +40,7 @@ final class PhabricatorActionView extends AphrontView {
* viewing.
*/
public function getHref() {
if ($this->workflow || $this->renderAsForm) {
if (($this->workflow || $this->renderAsForm) && !$this->download) {
if (!$this->user || !$this->user->isLoggedIn()) {
return id(new PhutilURI('/auth/start/'))
->setQueryParam('next', (string)$this->getObjectURI());