Added options 'php-censor.ssh.strength' and 'php-censor.ssh.comment'
for SSH keys generation. Issue #154.
This commit is contained in:
parent
61f512fd22
commit
d28d496264
5 changed files with 30 additions and 12 deletions
|
|
@ -297,17 +297,15 @@ class ProjectController extends PHPCensor\Controller
|
|||
$this->requireAdmin();
|
||||
|
||||
$method = $this->request->getMethod();
|
||||
$pub = null;
|
||||
$values = $this->getParams();
|
||||
$values['branch'] = '';
|
||||
|
||||
if ($method != 'POST') {
|
||||
if ($method !== 'POST') {
|
||||
$sshKey = new SshKey();
|
||||
$key = $sshKey->generate();
|
||||
|
||||
$values['key'] = $key['private_key'];
|
||||
$values['pubkey'] = $key['public_key'];
|
||||
$pub = $key['public_key'];
|
||||
}
|
||||
|
||||
$form = $this->projectForm($values);
|
||||
|
|
@ -317,7 +315,7 @@ class ProjectController extends PHPCensor\Controller
|
|||
$view->type = 'add';
|
||||
$view->project = null;
|
||||
$view->form = $form;
|
||||
$view->key = $pub;
|
||||
$view->key = $values['pubkey'];
|
||||
|
||||
return $view->render();
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue