Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/ssh/PhabricatorSSHWorkflow.php
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | public function setOriginalArguments(array $original_arguments) { | ||||
$this->originalArguments = $original_arguments; | $this->originalArguments = $original_arguments; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getOriginalArguments() { | public function getOriginalArguments() { | ||||
return $this->originalArguments; | return $this->originalArguments; | ||||
} | } | ||||
public function getSSHRemoteAddress() { | |||||
$ssh_client = getenv('SSH_CLIENT'); | |||||
if (!strlen($ssh_client)) { | |||||
return null; | |||||
} | |||||
// TODO: When commands are proxied, the original remote address should | |||||
// also be proxied. | |||||
// This has the format "<ip> <remote-port> <local-port>". Grab the IP. | |||||
$remote_address = head(explode(' ', $ssh_client)); | |||||
return $remote_address; | |||||
} | |||||
} | } |