Added options 'php-censor.ssh.strength' and 'php-censor.ssh.comment'

for SSH keys generation. Issue #154.
This commit is contained in:
Dmitry Khomutov 2018-02-23 11:27:33 +07:00
commit d28d496264
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
5 changed files with 30 additions and 12 deletions

View file

@ -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 {