* Add input checks

* Add connections without certificate
* Fix bug with credentials update
This commit is contained in:
Julien VAUBOURG
2014-11-14 00:12:43 +01:00
parent 965bcb8ec6
commit aac96974c6
13 changed files with 296 additions and 57 deletions

View File

@@ -42,9 +42,9 @@
</div>
</div>
<div class="panel panel-success">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title" data-toggle="tooltip" data-title="<?= T_('Real Internet') ?>"><?= T_("IPv6") ?></h3>
<h3 class="panel-title"><?= T_("IPv6") ?></h3>
</div>
<div style="padding: 14px 14px 0 10px">
@@ -57,6 +57,13 @@
</div>
</div>
<?php if(!$crt_client_key_exists && empty($login_user)): ?>
<div class="alert alert-dismissible alert-warning fade in" style="margin: 2px 0px 17px" role="alert">
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<strong><?= T_('Notice') ?>:</strong> <?= T_("You need to upload a Client Certificate, or define a Username (or both) for starting your VPN Client.") ?>
</div>
<?php endif; ?>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><?= T_("Certificates") ?></h3>
@@ -64,29 +71,48 @@
<div style="padding: 14px 14px 0 10px">
<div class="form-group">
<label for="crt_client" class="col-sm-3 control-label"><?= T_('Update Client Cert.') ?></label>
<label for="crt_client" class="col-sm-3 control-label"><?= $crt_client_exists ? T_('Update Client Cert.') : T_('Upload Client Cert.') ?></label>
<div class="input-group col-sm-9" style="padding: 0 15px">
<input id="crt_client" name="crt_client" type="file" style="display: none" />
<?php if($crt_client_exists): ?>
<a class="btn btn-danger input-group-addon deletefile" id="crt_client_deletebtn" data-toggle="tooltip" data-title="<?= T_('Delete this certificate') ?>"><span class="glyphicon glyphicon-remove"></span></a>
<input id="crt_client_delete" name="crt_client_delete" type="checkbox" value="1" style="display: none" />
<?php endif; ?>
<input type="text" class="form-control fileinput" id="crt_client_choosertxt" placeholder="-----BEGIN CERTIFICATE-----" readonly="readonly" />
<a class="btn input-group-addon fileinput" id="crt_client_chooserbtn"><?= T_('Browse') ?></a>
<input id="crt_client" name="crt_client" type="file" style="display: none" />
<a class="btn input-group-addon fileinput" id="crt_client_chooserbtn" data-toggle="tooltip" data-title="<?= T_('Browse') ?>"><span class="glyphicon glyphicon-search"></span></a>
</div>
</div>
<div class="form-group">
<label for="crt_client_key" class="col-sm-3 control-label"><?= T_('Update Client Key') ?></label>
<label for="crt_client_key" class="col-sm-3 control-label"><?= $crt_client_key_exists ? T_('Update Client Key') : T_('Upload Client Key') ?></label>
<div class="input-group col-sm-9" style="padding: 0 15px">
<input id="crt_client_key" name="crt_client_key" type="file" style="display: none" />
<?php if($crt_client_key_exists): ?>
<a class="btn btn-danger input-group-addon deletefile" id="crt_client_key_deletebtn" data-toggle="tooltip" data-title="<?= T_('Delete this certificate') ?>"><span class="glyphicon glyphicon-remove"></span></a>
<input id="crt_client_key_delete" name="crt_client_key_delete" type="checkbox" value="1" style="display: none" />
<?php endif; ?>
<input type="text" class="form-control fileinput" id="crt_client_key_choosertxt" placeholder="-----BEGIN PRIVATE KEY-----" readonly="readonly" />
<a class="btn input-group-addon fileinput" id="crt_client_key_chooserbtn"><?= T_('Browse') ?></a>
<input id="crt_client_key" name="crt_client_key" type="file" style="display: none" />
<a class="btn input-group-addon fileinput" id="crt_client_key_chooserbtn" data-toggle="tooltip" data-title="<?= T_('Browse') ?>"><span class="glyphicon glyphicon-search"></span></a>
</div>
</div>
<div class="form-group">
<label for="crt_server_ca" class="col-sm-3 control-label"><?= T_('Update Server CA') ?></label>
<?php if(!$crt_server_ca_exists): ?>
<div class="alert alert-dismissible alert-warning fade in" style="margin: 2px 16px 17px" role="alert">
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<strong><?= T_('Notice') ?>:</strong> <?= T_("You need to upload a Server CA for starting your VPN Client.") ?>
</div>
<?php endif; ?>
<label for="crt_server_ca" class="col-sm-3 control-label"><?= $crt_server_ca_exists ? T_('Update Server CA') : T_('Upload Server CA') ?></label>
<div class="input-group col-sm-9" style="padding: 0 15px">
<input id="crt_server_ca" name="crt_server_ca" type="file" style="display: none" />
<?php if($crt_server_ca_exists): ?>
<a class="btn btn-danger not-allowed btn-disabled input-group-addon" id="crt_server_ca_deletebtn" data-toggle="tooltip" data-title="<?= T_('You cannot have no server CA') ?>"><span class="glyphicon glyphicon-remove"></span></a>
<input id="crt_server_ca_delete" name="crt_server_ca_delete" type="checkbox" value="1" style="display: none" />
<?php endif; ?>
<input type="text" class="form-control fileinput" id="crt_server_ca_choosertxt" placeholder="-----BEGIN CERTIFICATE-----" readonly="readonly" />
<a class="btn input-group-addon fileinput" id="crt_server_ca_chooserbtn"><?= T_('Browse') ?></a>
<input id="crt_server_ca" name="crt_server_ca" type="file" style="display: none" />
<a class="btn input-group-addon fileinput" id="crt_server_ca_chooserbtn" data-toggle="tooltip" data-title="<?= T_('Browse') ?>"><span class="glyphicon glyphicon-search"></span></a>
</div>
</div>
</div>