mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 07:12:41 +01:00
Implemented option to allow users to view username of repository URIs.
Test Plan: Enable the checkbox under the Tracking options for a repository. View the repository in Diffusion, the username should show. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2575 Differential Revision: https://secure.phabricator.com/D5269
This commit is contained in:
parent
b88743137b
commit
868e79b7a7
2 changed files with 16 additions and 2 deletions
|
@ -265,6 +265,8 @@ final class PhabricatorRepositoryEditController
|
|||
$repository->setDetail('http-login', $request->getStr('http-login'));
|
||||
$repository->setDetail('http-pass', $request->getStr('http-pass'));
|
||||
|
||||
$repository->setDetail('show-user', $request->getInt('show-user'));
|
||||
|
||||
if ($repository->getDetail('ssh-key') &&
|
||||
$repository->getDetail('ssh-keyfile')) {
|
||||
$errors[] =
|
||||
|
@ -437,6 +439,14 @@ final class PhabricatorRepositoryEditController
|
|||
->setValue($repository->getDetail('remote-uri'))
|
||||
->setError($e_uri));
|
||||
|
||||
$inset->appendChild(
|
||||
id(new AphrontFormCheckboxControl())
|
||||
->addCheckbox(
|
||||
'show-user',
|
||||
1,
|
||||
pht('Permit users to view the username of this connection.'),
|
||||
$repository->getDetail('show-user') == 1));
|
||||
|
||||
$inset->appendChild(hsprintf(
|
||||
'<div class="aphront-form-instructions">'.
|
||||
'If you want to connect to this repository over SSH, enter the '.
|
||||
|
|
|
@ -434,9 +434,13 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO
|
|||
// with the credentials in the URI or something zany like that.
|
||||
|
||||
if ($uri instanceof PhutilGitURI) {
|
||||
$uri->setUser(null);
|
||||
if (!$this->getDetail('show-user', false)) {
|
||||
$uri->setUser(null);
|
||||
}
|
||||
} else {
|
||||
$uri->setUser(null);
|
||||
if (!$this->getDetail('show-user', false)) {
|
||||
$uri->setUser(null);
|
||||
}
|
||||
$uri->setPass(null);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue