commit
4b244633da
BIN
sources/.controller.php.swp
Normal file
BIN
sources/.controller.php.swp
Normal file
Binary file not shown.
@ -1,15 +1,21 @@
|
||||
<?php
|
||||
|
||||
|
||||
dispatch('/', 'hello_world');
|
||||
function hello_world() {
|
||||
flash('success', T_('This is a notification'));
|
||||
set('title', T_('Hello World !'));
|
||||
return render('homepage.html.php');
|
||||
}
|
||||
dispatch('/', function() {
|
||||
set('title', T_('Configure your VPN client'));
|
||||
return render('settings.html.php');
|
||||
});
|
||||
|
||||
dispatch('/lang/:locale', 'changeLocale');
|
||||
function changeLocale ($locale = 'en') {
|
||||
dispatch_put('/settings', function() {
|
||||
$success_message = "";
|
||||
foreach ($_POST as $key => $value) {
|
||||
$success_message = $success_message.T_("Parameter ").$key.": ".$value."<br>";
|
||||
}
|
||||
flash('success', $success_message);
|
||||
redirect_to('/');
|
||||
});
|
||||
|
||||
dispatch('/lang/:locale', function($locale = 'en') {
|
||||
switch ($locale) {
|
||||
case 'fr':
|
||||
$_SESSION['locale'] = 'fr';
|
||||
@ -22,5 +28,5 @@ function changeLocale ($locale = 'en') {
|
||||
redirect_to($_GET['redirect_to']);
|
||||
else
|
||||
redirect_to('/');
|
||||
}
|
||||
});
|
||||
|
||||
|
BIN
sources/views/.layout.html.php.swp
Normal file
BIN
sources/views/.layout.html.php.swp
Normal file
Binary file not shown.
BIN
sources/views/.settings.html.php.swp
Normal file
BIN
sources/views/.settings.html.php.swp
Normal file
Binary file not shown.
@ -1,3 +0,0 @@
|
||||
<div class="hero">
|
||||
<h1>Hello world !</h1>
|
||||
</div>
|
@ -6,7 +6,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>YunoHost <? echo (isset($title)) ? "| ".$title : "" ?></title>
|
||||
<title>VPN Client <? echo (isset($title)) ? "| ".$title : "" ?></title>
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<link media="all" type="text/css" href="<?= PUBLIC_DIR ?>/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link media="all" type="text/css" href="<?= PUBLIC_DIR ?>/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet">
|
||||
|
44
sources/views/settings.html.php
Normal file
44
sources/views/settings.html.php
Normal file
@ -0,0 +1,44 @@
|
||||
<h2><?= T_("Configure your VPN client") ?></h2>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-offset-2 col-sm-8">
|
||||
<form method="post" action="settings" class="form-horizontal" role="form">
|
||||
<input type="hidden" name="_method" value="put" />
|
||||
<div class="form-group">
|
||||
<label for="host" class="col-sm-3 control-label"><?= T_('Host') ?></label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="host" id="host" placeholder="vpn.neutrinet.be">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="col-sm-3 control-label"><?= T_('Password') ?></label>
|
||||
<div class="col-sm-9">
|
||||
<input type="password" class="form-control" name="password" id="password" placeholder="Password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="privatekey" class="col-sm-3 control-label"><?= T_('Private key') ?></label>
|
||||
<div class="col-sm-9">
|
||||
<textarea rows="7" class="form-control" name="privatekey" id="privatekey">
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
-----END PRIVATE KEY-----
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-xs-offset-3 col-sm-10">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="usetcp" value="yes"> <?= T_('Use TCP') ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-xs-offset-3 col-sm-9">
|
||||
<button type="submit" class="btn btn-default"><?= T_('Save settings') ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
Loading…
x
Reference in New Issue
Block a user