Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
glpi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
GLPI
glpi
Commits
c4b28837
Commit
c4b28837
authored
May 06, 2019
by
Cédric Anne
Committed by
Johan Cwiklinski
May 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide DB password input on install command
parent
9a9d76a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
inc/console/database/installcommand.class.php
inc/console/database/installcommand.class.php
+8
-10
No files found.
inc/console/database/installcommand.class.php
View file @
c4b28837
...
...
@@ -156,20 +156,18 @@ class InstallCommand extends Command implements ForceNoPluginsOptionCommandInter
protected
function
interact
(
InputInterface
$input
,
OutputInterface
$output
)
{
$
op
tions
=
[
'db-name'
=>
__
(
'Database name:
'
),
// Required
'db-user'
=>
__
(
'Database user:
'
),
// Required
'db-password'
=>
__
(
'Database password:
'
),
// Prompt if null (passed without value)
$
ques
tions
=
[
'db-name'
=>
new
Question
(
__
(
'Database name:'
),
'
'
),
// Required
'db-user'
=>
new
Question
(
__
(
'Database user:'
),
'
'
),
// Required
'db-password'
=>
new
Question
(
__
(
'Database password:'
),
'
'
),
// Prompt if null (passed without value)
];
foreach
(
$options
as
$name
=>
$label
)
{
$questions
[
'db-password'
]
->
setHidden
(
true
);
// Make password input hidden
foreach
(
$questions
as
$name
=>
$question
)
{
if
(
null
===
$input
->
getOption
(
$name
))
{
/** @var QuestionHelper $question_helper */
$question_helper
=
$this
->
getHelper
(
'question'
);
$value
=
$question_helper
->
ask
(
$input
,
$output
,
new
Question
(
$label
,
''
)
);
$value
=
$question_helper
->
ask
(
$input
,
$output
,
$question
);
$input
->
setOption
(
$name
,
$value
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment