settings.html.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <h2><?= T_("VPN Client Configuration") ?></h2>
  2. <hr />
  3. <div class="row">
  4. <div class="col-sm-offset-2 col-sm-8">
  5. <form method="post" enctype="multipart/form-data" action="?/settings" class="form-horizontal" role="form">
  6. <input type="hidden" name="_method" value="put" />
  7. <div class="panel panel-default">
  8. <div class="panel-heading">
  9. <h3 class="panel-title"><?= T_("VPN") ?></h3>
  10. </div>
  11. <div style="padding: 14px 14px 0 10px">
  12. <div class="form-group">
  13. <label for="server_name" class="col-sm-3 control-label"><?= T_('Server Address') ?></label>
  14. <div class="col-sm-9">
  15. <input type="text" class="form-control" name="server_name" id="server_name" placeholder="access.ldn-fai.net" value="<?= $server_name ?>" />
  16. </div>
  17. </div>
  18. <div class="form-group">
  19. <label for="server_port" class="col-sm-3 control-label"><?= T_('Server Port') ?></label>
  20. <div class="col-sm-9">
  21. <input type="text" data-toggle="tooltip" data-title="<?= T_('With restricted access, you should use 443 (TCP) or 53 (UDP)') ?>" class="form-control" name="server_port" id="server_port" placeholder="1194" value="<?= $server_port ?>" />
  22. </div>
  23. </div>
  24. <div class="form-group">
  25. <label for="server_proto" class="col-sm-3 control-label"><?= T_('Protocol') ?></label>
  26. <div class="btn-group col-sm-9" data-toggle="buttons">
  27. <label class="btn btn-default <?= $server_proto == 'udp' ? 'active' : '' ?>">
  28. <input type="radio" name="server_proto" value="udp" <?= $server_proto == 'udp' ? 'checked="cheked"' : '' ?> /> <?= T_('UDP') ?>
  29. </label>
  30. <label class="btn btn-default <?= $server_proto == 'tcp' ? 'active' : '' ?>" data-toggle="tooltip" data-title="<?= T_('UDP is more efficient than TCP (but more filtered in case of restrictive access)') ?>">
  31. <input type="radio" name="server_proto" value="tcp" <?= $server_proto == 'tcp' ? 'checked="cheked"' : '' ?> /> <?= T_('TCP') ?>
  32. </label>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="panel panel-default">
  38. <div class="panel-heading">
  39. <h3 class="panel-title"><?= T_("IPv6") ?></h3>
  40. </div>
  41. <div style="padding: 14px 14px 0 10px">
  42. <div class="form-group">
  43. <label for="ip6_net" class="col-sm-3 control-label"><?= T_('Delegated prefix') ?></label>
  44. <div class="col-sm-9">
  45. <input type="text" data-toggle="tooltip" data-title="<?= T_('Leave empty if your Internet Service Provider does not give you a delegated prefix') ?>" class="form-control" name="ip6_net" id="ip6_net" placeholder="2001:db8:42::" value="<?= $ip6_net ?>" />
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <?php if(!$crt_client_key_exists && empty($login_user)): ?>
  51. <div class="alert alert-dismissible alert-warning fade in" style="margin: 2px 0px 17px" role="alert">
  52. <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  53. <strong><?= T_('Notice') ?>:</strong> <?= T_("You need to upload a Client Certificate, or define a Username (or both) for starting your VPN Client.") ?>
  54. </div>
  55. <?php endif; ?>
  56. <div class="panel panel-default">
  57. <div class="panel-heading">
  58. <h3 class="panel-title"><?= T_("Certificates") ?></h3>
  59. </div>
  60. <div style="padding: 14px 14px 0 10px">
  61. <div class="form-group">
  62. <label for="crt_client" class="col-sm-3 control-label"><?= $crt_client_exists ? T_('Update Client Cert.') : T_('Upload Client Cert.') ?></label>
  63. <div class="input-group col-sm-9" style="padding: 0 15px">
  64. <?php if($crt_client_exists): ?>
  65. <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>
  66. <input id="crt_client_delete" name="crt_client_delete" type="checkbox" value="1" style="display: none" />
  67. <?php endif; ?>
  68. <input type="text" class="form-control fileinput" id="crt_client_choosertxt" placeholder="-----BEGIN CERTIFICATE-----" readonly="readonly" />
  69. <input id="crt_client" name="crt_client" type="file" style="display: none" />
  70. <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>
  71. </div>
  72. </div>
  73. <div class="form-group">
  74. <label for="crt_client_key" class="col-sm-3 control-label"><?= $crt_client_key_exists ? T_('Update Client Key') : T_('Upload Client Key') ?></label>
  75. <div class="input-group col-sm-9" style="padding: 0 15px">
  76. <?php if($crt_client_key_exists): ?>
  77. <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>
  78. <input id="crt_client_key_delete" name="crt_client_key_delete" type="checkbox" value="1" style="display: none" />
  79. <?php endif; ?>
  80. <input type="text" class="form-control fileinput" id="crt_client_key_choosertxt" placeholder="-----BEGIN PRIVATE KEY-----" readonly="readonly" />
  81. <input id="crt_client_key" name="crt_client_key" type="file" style="display: none" />
  82. <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>
  83. </div>
  84. </div>
  85. <div class="form-group">
  86. <?php if(!$crt_server_ca_exists): ?>
  87. <div class="alert alert-dismissible alert-warning fade in" style="margin: 2px 16px 17px" role="alert">
  88. <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  89. <strong><?= T_('Notice') ?>:</strong> <?= T_("You need to upload a Server CA for starting your VPN Client.") ?>
  90. </div>
  91. <?php endif; ?>
  92. <label for="crt_server_ca" class="col-sm-3 control-label"><?= $crt_server_ca_exists ? T_('Update Server CA') : T_('Upload Server CA') ?></label>
  93. <div class="input-group col-sm-9" style="padding: 0 15px">
  94. <?php if($crt_server_ca_exists): ?>
  95. <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>
  96. <input id="crt_server_ca_delete" name="crt_server_ca_delete" type="checkbox" value="1" style="display: none" />
  97. <?php endif; ?>
  98. <input type="text" class="form-control fileinput" id="crt_server_ca_choosertxt" placeholder="-----BEGIN CERTIFICATE-----" readonly="readonly" />
  99. <input id="crt_server_ca" name="crt_server_ca" type="file" style="display: none" />
  100. <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>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="panel panel-default">
  106. <div class="panel-heading">
  107. <h3 class="panel-title"><?= T_("Login") ?></h3>
  108. </div>
  109. <div style="padding: 14px 14px 0 10px">
  110. <div class="form-group">
  111. <label for="login_user" class="col-sm-3 control-label"><?= T_('Username') ?></label>
  112. <div class="col-sm-9">
  113. <input type="text" data-toggle="tooltip" data-title="<?= T_('Leave empty if not necessary') ?>" class="form-control" name="login_user" id="login_user" placeholder="michu" value="<?= $login_user ?>" />
  114. </div>
  115. </div>
  116. <div class="form-group">
  117. <label for="login_passphrase" class="col-sm-3 control-label"><?= T_('Password') ?></label>
  118. <div class="col-sm-9">
  119. <input type="text" data-toggle="tooltip" data-title="<?= T_('Leave empty if not necessary') ?>" class="form-control" name="login_passphrase" id="login_passphrase" placeholder="XVCwSbDkxnqQ" value="<?= $login_passphrase ?>" />
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <div class="form-group">
  125. <div style="text-align: center">
  126. <button type="submit" class="btn btn-default" data-toggle="tooltip" data-title="<?= T_('Reloading may take a few minutes. Be patient.') ?>"><?= T_('Save and reload') ?></button>
  127. </div>
  128. </div>
  129. </form>
  130. </div>
  131. </div>