Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/ssh/DiffusionSSHWorkflow.php
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | return csprintf( | ||||
$host, | $host, | ||||
'@'.$this->getUser()->getUsername(), | '@'.$this->getUser()->getUsername(), | ||||
$this->getOriginalArguments()); | $this->getOriginalArguments()); | ||||
} | } | ||||
final public function execute(PhutilArgumentParser $args) { | final public function execute(PhutilArgumentParser $args) { | ||||
$this->args = $args; | $this->args = $args; | ||||
$viewer = $this->getUser(); | |||||
$have_diffusion = PhabricatorApplication::isClassInstalledForViewer( | |||||
'PhabricatorDiffusionApplication', | |||||
$viewer); | |||||
if (!$have_diffusion) { | |||||
throw new Exception( | |||||
pht( | |||||
'You do not have permission to access the Diffusion application, '. | |||||
'so you can not interact with repositories over SSH.')); | |||||
} | |||||
$repository = $this->identifyRepository(); | $repository = $this->identifyRepository(); | ||||
$this->setRepository($repository); | $this->setRepository($repository); | ||||
$is_cluster_request = $this->getIsClusterRequest(); | $is_cluster_request = $this->getIsClusterRequest(); | ||||
$uri = $repository->getAlmanacServiceURI( | $uri = $repository->getAlmanacServiceURI( | ||||
$this->getUser(), | $viewer, | ||||
$is_cluster_request, | $is_cluster_request, | ||||
array( | array( | ||||
'ssh', | 'ssh', | ||||
)); | )); | ||||
if ($uri) { | if ($uri) { | ||||
$this->proxyURI = $uri; | $this->proxyURI = $uri; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines |