1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00:55 +01:00
phorge-phorge/src/applications/files/controller/PhabricatorFileShortcutController.php

25 lines
526 B
PHP
Raw Normal View History

<?php
final class PhabricatorFileShortcutController
extends PhabricatorFileController {
private $id;
public function willProcessRequest(array $data) {
$this->id = $data['id'];
}
public function processRequest() {
$file = id(new PhabricatorFileQuery())
->setViewer($this->getRequest()->getUser())
->withIDs(array($this->id))
->executeOne();
if (!$file) {
return new Aphront404Response();
}
return id(new AphrontRedirectResponse())->setURI($file->getInfoURI());
}
}