Changeset View
Changeset View
Standalone View
Standalone View
scripts/ssh/ssh-exec.php
Show First 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | try { | ||||
if (!$user->canEstablishSSHSessions()) { | if (!$user->canEstablishSSHSessions()) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Your account ("%s") does not have permission to establish SSH '. | 'Your account ("%s") does not have permission to establish SSH '. | ||||
'sessions. Visit the web interface for more information.', | 'sessions. Visit the web interface for more information.', | ||||
$user->getUsername())); | $user->getUsername())); | ||||
} | } | ||||
$workflows = id(new PhutilSymbolLoader()) | $workflows = id(new PhutilClassMapQuery()) | ||||
->setAncestorClass('PhabricatorSSHWorkflow') | ->setAncestorClass('PhabricatorSSHWorkflow') | ||||
->loadObjects(); | ->setUniqueMethod('getName') | ||||
->execute(); | |||||
$workflow_names = mpull($workflows, 'getName', 'getName'); | |||||
if (!$original_argv) { | if (!$original_argv) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
"Welcome to Phabricator.\n\n". | "Welcome to Phabricator.\n\n". | ||||
"You are logged in as %s.\n\n". | "You are logged in as %s.\n\n". | ||||
"You haven't specified a command to run. This means you're requesting ". | "You haven't specified a command to run. This means you're requesting ". | ||||
"an interactive shell, but Phabricator does not provide an ". | "an interactive shell, but Phabricator does not provide an ". | ||||
"interactive shell over SSH.\n\n". | "interactive shell over SSH.\n\n". | ||||
"Usually, you should run a command like `%s` or `%s` ". | "Usually, you should run a command like `%s` or `%s` ". | ||||
"rather than connecting directly with SSH.\n\n". | "rather than connecting directly with SSH.\n\n". | ||||
"Supported commands are: %s.", | "Supported commands are: %s.", | ||||
$user->getUsername(), | $user->getUsername(), | ||||
'git clone', | 'git clone', | ||||
'hg push', | 'hg push', | ||||
implode(', ', $workflow_names))); | implode(', ', array_keys($workflows)))); | ||||
epriestley: `$workflow_names` is used here, but no longer generated.
(This didn't trigger lint because… | |||||
} | } | ||||
$log_argv = implode(' ', $original_argv); | $log_argv = implode(' ', $original_argv); | ||||
$log_argv = id(new PhutilUTF8StringTruncator()) | $log_argv = id(new PhutilUTF8StringTruncator()) | ||||
->setMaximumCodepoints(128) | ->setMaximumCodepoints(128) | ||||
->truncateString($log_argv); | ->truncateString($log_argv); | ||||
$ssh_log->setData( | $ssh_log->setData( | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |
$workflow_names is used here, but no longer generated.
(This didn't trigger lint because this stuff is at top level.)