Parcourir la source

[enh] Remove unused sources

ljf il y a 3 ans
Parent
commit
71b52e0129
40 fichiers modifiés avec 0 ajouts et 14883 suppressions
  1. 0 73
      sources/config.php
  2. 0 366
      sources/controller.php
  3. 0 45
      sources/i18n/README.md
  4. BIN
      sources/i18n/fr_FR/LC_MESSAGES/localization.mo
  5. 0 336
      sources/i18n/fr_FR/LC_MESSAGES/localization.po
  6. 0 301
      sources/i18n/localization.pot
  7. 0 27
      sources/index.php
  8. 0 2707
      sources/lib/limonade.php
  9. 0 193
      sources/lib/limonade/abstract.php
  10. 0 173
      sources/lib/limonade/assertions.php
  11. 0 220
      sources/lib/limonade/public/css/screen.css
  12. BIN
      sources/lib/limonade/public/img/bg_header.png
  13. 0 350
      sources/lib/limonade/tests.php
  14. 0 37
      sources/lib/limonade/views/_debug.html.php
  15. 0 15
      sources/lib/limonade/views/_notices.html.php
  16. 0 22
      sources/lib/limonade/views/default_layout.php
  17. 0 6
      sources/lib/limonade/views/error.html.php
  18. 0 49
      sources/lib/unix_func.php
  19. 0 457
      sources/public/bootstrap/css/bootstrap-theme.css
  20. 0 1
      sources/public/bootstrap/css/bootstrap-theme.css.map
  21. 0 5
      sources/public/bootstrap/css/bootstrap-theme.min.css
  22. 0 6358
      sources/public/bootstrap/css/bootstrap.css
  23. 0 1
      sources/public/bootstrap/css/bootstrap.css.map
  24. 0 5
      sources/public/bootstrap/css/bootstrap.min.css
  25. BIN
      sources/public/bootstrap/fonts/glyphicons-halflings-regular.eot
  26. 0 229
      sources/public/bootstrap/fonts/glyphicons-halflings-regular.svg
  27. BIN
      sources/public/bootstrap/fonts/glyphicons-halflings-regular.ttf
  28. BIN
      sources/public/bootstrap/fonts/glyphicons-halflings-regular.woff
  29. 0 2276
      sources/public/bootstrap/js/bootstrap.js
  30. 0 7
      sources/public/bootstrap/js/bootstrap.min.js
  31. 0 13
      sources/public/bootstrap/js/npm.js
  32. 0 28
      sources/public/css/bootstrap-toggle.min.css
  33. 0 107
      sources/public/css/style.css
  34. BIN
      sources/public/img/github.png
  35. BIN
      sources/public/img/loading.gif
  36. 0 4
      sources/public/jquery/jquery-2.1.1.min.js
  37. 0 9
      sources/public/js/bootstrap-toggle.min.js
  38. 0 133
      sources/public/js/custom.js
  39. 0 70
      sources/views/layout.html.php
  40. 0 260
      sources/views/settings.html.php

+ 0 - 73
sources/config.php

@@ -1,73 +0,0 @@
-<?php
-
-/* VPN Client app for YunoHost
- * Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
- * Contribute at https://github.com/labriqueinternet/vpnclient_ynh
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-// Framework configuration
-function configure() {
-  option('env', ENV_PRODUCTION);
-  option('debug', false);
-  option('base_uri', '__PATH__/');
-
-  layout('layout.html.php');
-
-  define('PUBLIC_DIR', '__PATH__/public');
-}
-
-// Before routing
-function before($route) {
-  $lang_mapping = array(
-    'fr' => 'fr_FR'
-  );
-
-  if(!isset($_SESSION['locale'])) {
-    $locale = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
-    $_SESSION['locale'] = strtolower(substr(chop($locale[0]), 0, 2));
-  }
-
-  $lang = $_SESSION['locale'];
-
-  // Convert simple language code into full language code
-  if(array_key_exists($lang, $lang_mapping)) {
-    $lang = $lang_mapping[$lang];
-  }
-
-  $lang = "$lang.utf8";
-  $textdomain = "localization";
-
-  putenv("LANGUAGE=$lang");
-  putenv("LANG=$lang");
-  putenv("LC_ALL=$lang");
-  putenv("LC_MESSAGES=$lang");
-
-  setlocale(LC_ALL, $lang);
-  setlocale(LC_CTYPE, $lang);
-
-  $locales_dir = dirname(__FILE__).'/i18n';
-
-  bindtextdomain($textdomain, $locales_dir);
-  bind_textdomain_codeset($textdomain, 'UTF-8');
-  textdomain($textdomain);
-
-  set('locale', $lang);
-}
-
-// After routing
-function after($output, $route) {
-  return $output;
-}

+ 0 - 366
sources/controller.php

@@ -1,366 +0,0 @@
-<?php
-
-/* VPN Client app for YunoHost 
- * Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
- * Contribute at https://github.com/labriqueinternet/vpnclient_ynh
- * 
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- * 
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-function ynh_setting_get($setting) {
-  $value = exec("sudo grep \"^$setting:\" /etc/yunohost/apps/vpnclient/settings.yml");
-  $value = preg_replace('/^[^:]+:\s*["\']?/', '', $value);
-  $value = preg_replace('/\s*["\']$/', '', $value);
-
-  return htmlspecialchars($value);
-}
-
-function ynh_setting_set($setting, $value) {
-  return exec('sudo yunohost app setting vpnclient '.escapeshellarg($setting).' -v '.escapeshellarg($value));
-}
-
-function stop_service() {
-  touch('/tmp/.ynh-vpnclient-stopped');
-  exec('sudo systemctl stop ynh-vpnclient');
-}
-
-function start_service() {
-  exec('sudo systemctl start ynh-vpnclient', $output, $retcode);
-  unlink('/tmp/.ynh-vpnclient-stopped');
-
-  return $retcode;
-}
-
-function service_status() {
-  exec('sudo ynh-vpnclient status', $output);
-
-  return $output;
-}
-
-function service_faststatus() {
-  exec('ip link show tun0', $output, $retcode);
-
-  return $retcode;
-}
-
-function ipv6_expanded($ip) {
-  exec('ipv6_expanded '.escapeshellarg($ip), $output);
-
-  return $output[0];
-}
-
-function ipv6_compressed($ip) {
-  exec('ipv6_compressed '.escapeshellarg($ip), $output);
-
-  return $output[0];
-}
-
-function noneValue($str) {
-  return ($str == 'none') ? '' : $str;
-}
-
-function readAutoConf($file) {
-  $json = file_get_contents($file);
-  $config = json_decode($json, true);
-
-  if(!empty($config['crt_server_ca'])) {
-    $config['crt_server_ca'] = str_replace('|', "\n", $config['crt_server_ca']);
-  }
-
-  if(!empty($config['crt_client'])) {
-    $config['crt_client'] = str_replace('|', "\n", $config['crt_client']);
-  }
-
-  if(!empty($config['crt_client_key'])) {
-    $config['crt_client_key'] = str_replace('|', "\n", $config['crt_client_key']);
-  }
-
-  if(!empty($config['crt_client_ta'])) {
-    $config['crt_client_ta'] = str_replace('|', "\n", $config['crt_client_ta']);
-  }
-
-  return $config;
-}
-
-dispatch('/', function() {
-  $ip6_net = noneValue(ynh_setting_get('ip6_net'));
-  $raw_openvpn = file_get_contents('/etc/openvpn/client.conf.tpl');
-
-  set('service_enabled', ynh_setting_get('service_enabled'));
-  set('server_name', noneValue(ynh_setting_get('server_name')));
-  set('server_port', ynh_setting_get('server_port'));
-  set('server_proto', ynh_setting_get('server_proto'));
-  set('login_user', ynh_setting_get('login_user'));
-  set('login_passphrase', ynh_setting_get('login_passphrase'));
-  set('ip6_net', $ip6_net);
-  set('crt_client_exists', file_exists('/etc/openvpn/keys/user.crt'));
-  set('crt_client_key_exists', file_exists('/etc/openvpn/keys/user.key'));
-  set('crt_client_ta_exists', file_exists('/etc/openvpn/keys/user_ta.key'));
-  set('crt_server_ca_exists', file_exists('/etc/openvpn/keys/ca-server.crt'));
-  set('faststatus', service_faststatus() == 0);
-  set('raw_openvpn', $raw_openvpn);
-  set('dns0', ynh_setting_get('dns0'));
-  set('dns1', ynh_setting_get('dns1'));
-
-  return render('settings.html.php');
-});
-
-dispatch_put('/settings', function() {
-
-  if(!isset($_SERVER['HTTP_X_REQUESTED_WITH'])) {
-    throw new Exception('CSRF protection');
-  }
-
-  $service_enabled = isset($_POST['service_enabled']) ? 1 : 0;
-
-  if($service_enabled == 1) {
-    $crt_client_exists = file_exists('/etc/openvpn/keys/user.crt');
-    $crt_client_key_exists = file_exists('/etc/openvpn/keys/user.key');
-    $crt_server_ca_exists = file_exists('/etc/openvpn/keys/ca-server.crt');
-
-    $config = $_POST;
-    $autoconf = false;
-
-    try {
-      if($_FILES['cubefile']['error'] == UPLOAD_ERR_OK) {
-        $config = readAutoConf($_FILES['cubefile']['tmp_name']);
-
-        if(is_null($config)) {
-          throw new Exception(_('Json Syntax Error, please check your dot cube file'));
-        }
-
-        $autoconf = true;
-      }
-  
-      $ip6_net = empty($config['ip6_net']) ? 'none' : $config['ip6_net'];
-      $ip6_addr = 'none';
-
-      if(empty($config['server_name']) || empty($config['server_port']) || empty($config['server_proto'])) {
-        throw new Exception(_('The Server Address, the Server Port and the Protocol cannot be empty'));
-      }
-    
-      if(!preg_match('/^\d+$/', $config['server_port'])) {
-        throw new Exception(_('The Server Port must be only composed of digits'));
-      }
-    
-      if($config['server_proto'] != 'udp' && $config['server_proto'] != 'tcp') {
-        throw new Exception(_('The Protocol must be "udp" or "tcp"'));
-      }
-
-      if(empty($config['dns0']) || empty($config['dns1'])) {
-        throw new Exception(_('You need to define two DNS resolver addresses'));
-      }
-
-      if(empty($config['login_user']) xor empty($config['login_passphrase'])) {
-        throw new Exception(_('A Password is needed when you suggest a Username, or vice versa'));
-      }
-
-      if((!$autoconf && (($_FILES['crt_client']['error'] == UPLOAD_ERR_OK && $_FILES['crt_client_key']['error'] != UPLOAD_ERR_OK && (!$crt_client_key_exists || $_POST['crt_client_key_delete'] == 1))
-        || ($_FILES['crt_client_key']['error'] == UPLOAD_ERR_OK && $_FILES['crt_client']['error'] != UPLOAD_ERR_OK && (!$crt_client_exists || $_POST['crt_client_delete'] == 1))))
-        || ($autoconf && (empty($config['crt_client']) xor empty($config['crt_client_key'])))) {
-      
-        throw new Exception(_('A Client Certificate is needed when you suggest a Key, or vice versa'));
-      } 
- 
-      if((!$autoconf && $_FILES['crt_server_ca']['error'] != UPLOAD_ERR_OK && !$crt_server_ca_exists) || ($autoconf && empty($config['crt_server_ca']))) {
-        throw new Exception(_('You need a Server CA.'));
-      }
-      
-      if(((!$autoconf && $_FILES['crt_client_key']['error'] != UPLOAD_ERR_OK && (!$crt_client_key_exists || $_POST['crt_client_key_delete'] == 1)) || ($autoconf && empty($config['crt_client_key']))) && empty($config['login_user'])) {
-        throw new Exception(_('You need either a Client Certificate, either a Username, or both'));
-      }
-    
-      if($ip6_net != 'none') {
-        $ip6_net = ipv6_expanded($ip6_net);
-    
-        if(empty($ip6_net)) {
-          throw new Exception(_('The IPv6 Delegated Prefix format looks bad'));
-        }
-    
-        $ip6_blocs = explode(':', $ip6_net);
-        $ip6_addr = "${ip6_blocs[0]}:${ip6_blocs[1]}:${ip6_blocs[2]}:${ip6_blocs[3]}:${ip6_blocs[4]}:${ip6_blocs[5]}:${ip6_blocs[6]}:42";
-    
-        $ip6_net = ipv6_compressed($ip6_net);
-        $ip6_addr = ipv6_compressed($ip6_addr);
-      }
-
-    } catch(Exception $e) {
-      flash('error', $e->getMessage().' ('._('configuration not updated').').');
-      goto redirect;
-    }
-  }
-  
-  stop_service();
-  
-  ynh_setting_set('service_enabled', $service_enabled);
-
-  if($service_enabled == 1) {
-    ynh_setting_set('server_name', $config['server_name']);
-    ynh_setting_set('server_port', $config['server_port']);
-    ynh_setting_set('server_proto', $config['server_proto']);
-    ynh_setting_set('dns0', $config['dns0']);
-    ynh_setting_set('dns1', $config['dns1']);
-    ynh_setting_set('login_user', $config['login_user']);
-    ynh_setting_set('login_passphrase', $config['login_passphrase']);
-    ynh_setting_set('ip6_net', $ip6_net);
-    ynh_setting_set('ip6_addr', $ip6_addr);
-
-    if($autoconf) {
-      copy('/etc/openvpn/client.conf.tpl.restore', '/etc/openvpn/client.conf.tpl');
-
-      if(!empty($config['openvpn_rm'])) {
-        $raw_openvpn = explode("\n", file_get_contents('/etc/openvpn/client.conf.tpl'));
-        $fopenvpn = fopen('/etc/openvpn/client.conf.tpl', 'w');
-
-        foreach($raw_openvpn AS $opt) {
-          $filtered = false;
-
-          if(!preg_match('/^#/', $opt) && !preg_match('/<TPL:/', $opt)) {
-            foreach($config['openvpn_rm'] AS $filter) {
-              if(!empty($filter) && preg_match("/$filter/i", $opt)) {
-                $filtered = true;
-              }
-            }
-          }
-
-          if(!$filtered) {
-            fwrite($fopenvpn, "$opt\n");
-          }
-        }
-
-        fclose($fopenvpn);
-      }
-
-      if(!empty($config['openvpn_add'])) {
-        $raw_openvpn = file_get_contents('/etc/openvpn/client.conf.tpl');
-        $raw_openvpn .= "\n# Custom\n".implode("\n", $config['openvpn_add']);
-
-        file_put_contents('/etc/openvpn/client.conf.tpl', $raw_openvpn);
-      }
-
-      if(empty($config['crt_client'])) {
-        if(file_exists('/etc/openvpn/keys/user.crt')) {
-          unlink('/etc/openvpn/keys/user.crt');
-        }
-      } else {
-        file_put_contents('/etc/openvpn/keys/user.crt', $config['crt_client']);
-      }
-
-      if(empty($config['crt_client_key'])) {
-        if(file_exists('/etc/openvpn/keys/user.key')) {
-          unlink('/etc/openvpn/keys/user.key');
-        }
-      } else {
-        file_put_contents('/etc/openvpn/keys/user.key', $config['crt_client_key']);
-      }
-
-      if(empty($config['crt_client_ta'])) {
-        if(file_exists('/etc/openvpn/keys/user_ta.key')) {
-          unlink('/etc/openvpn/keys/user_ta.key');
-        }
-      } else {
-        file_put_contents('/etc/openvpn/keys/user_ta.key', $config['crt_client_ta']);
-      }
-
-      if(empty($config['crt_server_ca'])) {
-        if(file_exists('/etc/openvpn/keys/ca-server.crt')) {
-          unlink('/etc/openvpn/keys/ca-server.crt');
-        }
-      } else {
-        file_put_contents('/etc/openvpn/keys/ca-server.crt', $config['crt_server_ca']);
-      }
-
-    } else {
-
-      file_put_contents('/etc/openvpn/client.conf.tpl', $_POST['raw_openvpn']);
-
-      if($_FILES['crt_client']['error'] == UPLOAD_ERR_OK) {
-        move_uploaded_file($_FILES['crt_client']['tmp_name'], '/etc/openvpn/keys/user.crt');
-      } elseif($_POST['crt_client_delete'] == 1) {
-        unlink('/etc/openvpn/keys/user.crt');
-      }
-      
-      if($_FILES['crt_client_key']['error'] == UPLOAD_ERR_OK) {
-        move_uploaded_file($_FILES['crt_client_key']['tmp_name'], '/etc/openvpn/keys/user.key');
-      } elseif($_POST['crt_client_key_delete'] == 1) {
-        unlink('/etc/openvpn/keys/user.key');
-      }
-  
-      if($_FILES['crt_client_ta']['error'] == UPLOAD_ERR_OK) {
-        move_uploaded_file($_FILES['crt_client_ta']['tmp_name'], '/etc/openvpn/keys/user_ta.key');
-      } elseif($_POST['crt_client_ta_delete'] == 1) {
-        unlink('/etc/openvpn/keys/user_ta.key');
-      }
-      
-      if($_FILES['crt_server_ca']['error'] == UPLOAD_ERR_OK) {
-        move_uploaded_file($_FILES['crt_server_ca']['tmp_name'], '/etc/openvpn/keys/ca-server.crt');
-      }
-    }
-    
-    if(!empty($config['login_user'])) {
-      file_put_contents('/etc/openvpn/keys/credentials', "${config['login_user']}\n${config['login_passphrase']}");
-    } else {
-      file_put_contents('/etc/openvpn/keys/credentials', '');
-    }
-
-    $retcode = start_service();
-
-    if($retcode == 0) {
-      flash('success', _('Configuration updated and service successfully reloaded'));
-    } else {
-      flash('error', _('Configuration updated but service reload failed'));
-    }
-
-  } else {
-      flash('success', _('Service successfully disabled'));
-  }
-
-  redirect:
-  redirect_to('/');
-});
-
-dispatch('/status', function() {
-  $status_lines = service_status();
-  $status_list = '';
-
-  foreach($status_lines AS $status_line) {
-    if(preg_match('/^\[INFO\]/', $status_line)) {
-      $status_list .= '<li class="status-info">'.htmlspecialchars($status_line).'</li>';
-    }
-    elseif(preg_match('/^\[OK\]/', $status_line)) {
-      $status_list .= '<li class="status-success">'.htmlspecialchars($status_line).'</li>';
-    }
-    elseif(preg_match('/^\[WARN\]/', $status_line)) {
-      $status_list .= '<li class="status-warning">'.htmlspecialchars($status_line).'</li>';
-    }
-    elseif(preg_match('/^\[ERR\]/', $status_line)) {
-      $status_list .= '<li class="status-danger">'.htmlspecialchars($status_line).'</li>';
-    }
-  }
-
-  echo $status_list;
-});
-
-dispatch('/lang/:locale', function($locale = 'en') {
-  switch($locale) {
-    case 'fr':
-      $_SESSION['locale'] = 'fr';
-    break;
-
-    default:
-      $_SESSION['locale'] = 'en';
-  }
-
-  redirect_to('/');
-});

+ 0 - 45
sources/i18n/README.md

@@ -1,45 +0,0 @@
-## Force language
-
-The default language of the web admin depends on your browser language.
-
-You can force a language by using (e.g. for French):
-```
-/vpnadmin/?/lang/fr
-```
-
-English is the default language when the browser language is not available.
-
-## Update the default string list
-
-Updating the pot file from template files:
-```
-xgettext sources/*.php sources/views/*.php -o sources/i18n/localization.pot
-```
-
-## Add a new language
-
-Create a new directory path (e.g. for French):
-```
-mkdir -p sources/i18n/fr_FR/LC_MESSAGES/
-```
-
-Generate the po file:
-```
-msginit --locale=fr_FR.UTF-8 --no-translator -i sources/i18n/localization.pot -o sources/i18n/fr_FR/LC_MESSAGES/localization.po
-```
-
-You can use poedit for translating the po:
-```
-poedit sources/i18n/fr_FR/LC_MESSAGES/localization.po
-```
-
-With poedit, just save your modifications with the button and the *localization.mo* (compiled version of the po) file will automatically be created or updated.
-
-If you edited the po by hand, you have to compile the mo file:
-```
-msgfmt sources/i18n/fr_FR/localization.po -o sources/i18n/fr_FR/LC_MESSAGES/localization.mo
-```
-
-Change the default language of your browser, and test this new translation.
-
-You should add the locale to the list at the end of *sources/controller.php*.

BIN
sources/i18n/fr_FR/LC_MESSAGES/localization.mo


+ 0 - 336
sources/i18n/fr_FR/LC_MESSAGES/localization.po

@@ -1,336 +0,0 @@
-# French translations for data package
-# Traductions françaises du paquet data.
-# Copyright (C) 2015 THE data'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the data package.
-# Automatically generated, 2015.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: data 2\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-09-29 14:09+0200\n"
-"PO-Revision-Date: 2015-09-29 14:10+0200\n"
-"Last-Translator: samy boutayeb <samy@langues-etcetera.fr>\n"
-"Language-Team: none\n"
-"Language: fr\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-"X-Generator: Poedit 1.8.4\n"
-
-#: sources/controller.php:130
-msgid "Json Syntax Error, please check your dot cube file"
-msgstr "Error de syntaxe Json, merci de vérifier votre fichier .cube"
-
-#: sources/controller.php:140
-msgid "The Server Address, the Server Port and the Protocol cannot be empty"
-msgstr ""
-"L'adresse du serveur, le port du serveur et le protocole ne peuvent pas être "
-"vides"
-
-#: sources/controller.php:144
-msgid "The Server Port must be only composed of digits"
-msgstr "Le port du serveur ne peut correspondre qu'à des chiffres"
-
-#: sources/controller.php:148
-msgid "The Protocol must be \"udp\" or \"tcp\""
-msgstr "Le protocole ne peut correspondre qu'à \"udp\" ou \"tcp\""
-
-#: sources/controller.php:152
-msgid "You need to define two DNS resolver addresses"
-msgstr "Vous devez définir deux adresses de résolveur DNS"
-
-#: sources/controller.php:156
-msgid "A Password is needed when you suggest a Username, or vice versa"
-msgstr ""
-"Un mot de passe est nécessaire si vous proposez un nom d'utilisateur, et "
-"inversement"
-
-#: sources/controller.php:163
-msgid "A Client Certificate is needed when you suggest a Key, or vice versa"
-msgstr ""
-"Un certificat client est nécessaire si vous proposez une clé, et inversement"
-
-#: sources/controller.php:167
-msgid "You need a Server CA."
-msgstr "Vous ne pouvez pas ne pas avoir de CA de serveur"
-
-#: sources/controller.php:171
-msgid "You need either a Client Certificate, either a Username, or both"
-msgstr ""
-"Vous devez avoir soit un certificat client, soit un nom d'utilisateur, soit "
-"les deux"
-
-#: sources/controller.php:178
-msgid "The IPv6 Delegated Prefix format looks bad"
-msgstr "Le format du préfixe IPv6 délégué semble incorrect"
-
-#: sources/controller.php:189
-msgid "configuration not updated"
-msgstr "configuration non-mise à jour"
-
-#: sources/controller.php:310
-msgid "Configuration updated and service successfully reloaded"
-msgstr "Configuration mise à jour et service correctement rechargé"
-
-#: sources/controller.php:312
-msgid "Configuration updated but service reload failed"
-msgstr "Configuration mise à jour mais le rechargement du service a échoué"
-
-#: sources/controller.php:316
-msgid "Service successfully disabled"
-msgstr "Service désactivé avec succès"
-
-#: sources/views/layout.html.php:27
-msgid "VPN Client"
-msgstr "Client VPN"
-
-#: sources/views/layout.html.php:49
-msgid "Error"
-msgstr "Erreur"
-
-#: sources/views/layout.html.php:54 sources/views/settings.html.php:124
-#: sources/views/settings.html.php:138
-msgid "Notice"
-msgstr "Notice"
-
-#: sources/views/layout.html.php:66
-msgid "Any problem? Contribute!"
-msgstr "Un problème ? Contribuez !"
-
-#: sources/views/settings.html.php:20
-msgid "VPN Client Configuration"
-msgstr "Configuration du client VPN"
-
-#: sources/views/settings.html.php:22 sources/views/settings.html.php:24
-msgid ""
-"This is a fast status. Click on More details to show the complete status."
-msgstr ""
-"Ceci est un résumé du statut. Cliquez sur « Plus de détails » pour consulter "
-"l'intégralité du statut."
-
-#: sources/views/settings.html.php:22
-msgid "Running"
-msgstr "En cours d'exécution"
-
-#: sources/views/settings.html.php:24
-msgid "Not Running"
-msgstr "Éteint"
-
-#: sources/views/settings.html.php:27
-msgid "Loading complete status may take a few minutes. Be patient."
-msgstr "Le chargement du statut peut prendre quelques minutes. Soyez patient."
-
-#: sources/views/settings.html.php:27
-msgid "More details"
-msgstr "Plus de détails"
-
-#: sources/views/settings.html.php:43
-msgid "Service"
-msgstr "Service"
-
-#: sources/views/settings.html.php:48
-msgid "VPN Enabled"
-msgstr "VPN activé"
-
-#: sources/views/settings.html.php:60
-msgid "Manual"
-msgstr "Manuel"
-
-#: sources/views/settings.html.php:61
-msgid "Automatic"
-msgstr "Automatique"
-
-#: sources/views/settings.html.php:67
-msgid "VPN"
-msgstr "VPN"
-
-#: sources/views/settings.html.php:72
-msgid "Server Address"
-msgstr "Adresse du serveur"
-
-#: sources/views/settings.html.php:79
-msgid "Server Port"
-msgstr "Port du serveur"
-
-#: sources/views/settings.html.php:81
-msgid "With restricted access, you should use 443 (TCP) or 53 (UDP)"
-msgstr "En cas d'accès restreint, utiliser 443 (TCP) ou 53 (UDP)"
-
-#: sources/views/settings.html.php:86
-msgid "Protocol"
-msgstr "Protocole"
-
-#: sources/views/settings.html.php:89
-msgid "UDP"
-msgstr "UDP"
-
-#: sources/views/settings.html.php:92
-msgid ""
-"UDP is more efficient than TCP (but more filtered in case of restrictive "
-"access)"
-msgstr ""
-"UDP est plus performant que TCP (mais plus filtré en cas d'accès restreint)"
-
-#: sources/views/settings.html.php:93
-msgid "TCP"
-msgstr "TCP"
-
-#: sources/views/settings.html.php:99
-msgid "Delegated prefix (IPv6)"
-msgstr "Préfixe délégué (IPv6)"
-
-#: sources/views/settings.html.php:101
-msgid ""
-"Leave empty if your Internet Service Provider does not give you a delegated "
-"prefix"
-msgstr ""
-"Laissez vide si votre Fournisseur d'Accès à Internet ne vous fournit pas de "
-"préfixe délégué."
-
-#: sources/views/settings.html.php:108
-msgid "Edit the raw configuration only if you know what you do!"
-msgstr "N'éditez la configuration brute que si vous savez ce que vous faites !"
-
-#: sources/views/settings.html.php:108 sources/views/settings.html.php:113
-msgid "Advanced"
-msgstr "Avancé"
-
-#: sources/views/settings.html.php:124
-msgid ""
-"You need to upload a Client Certificate, or define a Username (or both) for "
-"starting your VPN Client."
-msgstr ""
-"Vous devez téléverser le certificat du client, ou définir un nom "
-"d'utilisateur (ou les deux) pour démarrer votre client VPN."
-
-#: sources/views/settings.html.php:130
-msgid "Authentication"
-msgstr "Authentification"
-
-#: sources/views/settings.html.php:138
-msgid "You need to upload a Server CA for starting your VPN Client."
-msgstr "Vous devez transférer un CA de serveur pour démarrer votre client VPN."
-
-#: sources/views/settings.html.php:142
-msgid "Update Server CA"
-msgstr "Actualiser le CA du serveur"
-
-#: sources/views/settings.html.php:142
-msgid "Upload Server CA"
-msgstr "Transférer le CA du serveur"
-
-#: sources/views/settings.html.php:145
-msgid "You cannot have no server CA"
-msgstr "Vous ne pouvez pas ne pas avoir de CA de serveur"
-
-#: sources/views/settings.html.php:150 sources/views/settings.html.php:163
-#: sources/views/settings.html.php:176 sources/views/settings.html.php:189
-#: sources/views/settings.html.php:244
-msgid "Browse"
-msgstr "Parcourir"
-
-#: sources/views/settings.html.php:155
-msgid "Update Client Cert."
-msgstr "Actualiser le certificat client"
-
-#: sources/views/settings.html.php:155
-msgid "Upload Client Cert."
-msgstr "Téléverser un certificat client"
-
-#: sources/views/settings.html.php:158 sources/views/settings.html.php:171
-#: sources/views/settings.html.php:184
-msgid "Delete this certificate"
-msgstr "Supprimer ce certificat"
-
-#: sources/views/settings.html.php:168
-msgid "Update Client Key"
-msgstr "Actualiser la clé client"
-
-#: sources/views/settings.html.php:168
-msgid "Upload Client Key"
-msgstr "Téléverser un clé client"
-
-#: sources/views/settings.html.php:174 sources/views/settings.html.php:187
-msgid "Make sure your browser is able to read the key file before uploading"
-msgstr ""
-"Assurez-vous que votre navigateur peut lire le fichier contenant la clé "
-"avant de le téléverser"
-
-#: sources/views/settings.html.php:176 sources/views/settings.html.php:189
-msgid "make sure your browser is able to read the key file before uploading"
-msgstr ""
-"assurez-vous que votre navigateur peut lire le fichier contenant la clé "
-"avant de le téléverser"
-
-#: sources/views/settings.html.php:181
-msgid "Update Shared-Secret"
-msgstr "Actualiser le secret partagé"
-
-#: sources/views/settings.html.php:181
-msgid "Upload Shared-Secret"
-msgstr "Téléverser un secret partagé"
-
-#: sources/views/settings.html.php:194
-msgid "Username"
-msgstr "Nom d'utilisateur"
-
-#: sources/views/settings.html.php:196 sources/views/settings.html.php:203
-msgid "Leave empty if not necessary"
-msgstr "Laisser vide si non nécessaire"
-
-#: sources/views/settings.html.php:201
-msgid "Password"
-msgstr "Mot de passe"
-
-#: sources/views/settings.html.php:211
-msgid "DNS"
-msgstr "DNS"
-
-#: sources/views/settings.html.php:216
-msgid "First resolver"
-msgstr "Premier résolveur"
-
-#: sources/views/settings.html.php:218 sources/views/settings.html.php:225
-msgid "IPv6 or IPv4"
-msgstr "IPv6 ou IPv4"
-
-#: sources/views/settings.html.php:223
-msgid "Second resolver"
-msgstr "Second résolveur"
-
-#: sources/views/settings.html.php:235
-msgid "Auto Configuration"
-msgstr "Configuration automatique"
-
-#: sources/views/settings.html.php:240
-msgid "Upload Config"
-msgstr "Téléverser une configuration"
-
-#: sources/views/settings.html.php:247
-msgid "What is a dot cube file?"
-msgstr "Qu'est-ce qu'un fichier .cube ?"
-
-#: sources/views/settings.html.php:255
-msgid "Reloading may take a few minutes. Be patient."
-msgstr "Le rechargement peut prendre quelques minutes. Soyez patient."
-
-#: sources/views/settings.html.php:255
-msgid "Save and reload"
-msgstr "Sauvegarder et recharger"
-
-#~ msgid "ta.key"
-#~ msgstr "ta.key"
-
-#~ msgid "IPv6"
-#~ msgstr "IPv6"
-
-#~ msgid "Delegated prefix"
-#~ msgstr "Préfixe délégué"
-
-#~ msgid "Certificates"
-#~ msgstr "Certificats"
-
-#~ msgid "Login"
-#~ msgstr "Identifiant"

+ 0 - 301
sources/i18n/localization.pot

@@ -1,301 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-09-29 14:09+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: sources/controller.php:130
-msgid "Json Syntax Error, please check your dot cube file"
-msgstr ""
-
-#: sources/controller.php:140
-msgid "The Server Address, the Server Port and the Protocol cannot be empty"
-msgstr ""
-
-#: sources/controller.php:144
-msgid "The Server Port must be only composed of digits"
-msgstr ""
-
-#: sources/controller.php:148
-msgid "The Protocol must be \"udp\" or \"tcp\""
-msgstr ""
-
-#: sources/controller.php:152
-msgid "You need to define two DNS resolver addresses"
-msgstr ""
-
-#: sources/controller.php:156
-msgid "A Password is needed when you suggest a Username, or vice versa"
-msgstr ""
-
-#: sources/controller.php:163
-msgid "A Client Certificate is needed when you suggest a Key, or vice versa"
-msgstr ""
-
-#: sources/controller.php:167
-msgid "You need a Server CA."
-msgstr ""
-
-#: sources/controller.php:171
-msgid "You need either a Client Certificate, either a Username, or both"
-msgstr ""
-
-#: sources/controller.php:178
-msgid "The IPv6 Delegated Prefix format looks bad"
-msgstr ""
-
-#: sources/controller.php:189
-msgid "configuration not updated"
-msgstr ""
-
-#: sources/controller.php:310
-msgid "Configuration updated and service successfully reloaded"
-msgstr ""
-
-#: sources/controller.php:312
-msgid "Configuration updated but service reload failed"
-msgstr ""
-
-#: sources/controller.php:316
-msgid "Service successfully disabled"
-msgstr ""
-
-#: sources/views/layout.html.php:27
-msgid "VPN Client"
-msgstr ""
-
-#: sources/views/layout.html.php:49
-msgid "Error"
-msgstr ""
-
-#: sources/views/layout.html.php:54 sources/views/settings.html.php:124
-#: sources/views/settings.html.php:138
-msgid "Notice"
-msgstr ""
-
-#: sources/views/layout.html.php:66
-msgid "Any problem? Contribute!"
-msgstr ""
-
-#: sources/views/settings.html.php:20
-msgid "VPN Client Configuration"
-msgstr ""
-
-#: sources/views/settings.html.php:22 sources/views/settings.html.php:24
-msgid ""
-"This is a fast status. Click on More details to show the complete status."
-msgstr ""
-
-#: sources/views/settings.html.php:22
-msgid "Running"
-msgstr ""
-
-#: sources/views/settings.html.php:24
-msgid "Not Running"
-msgstr ""
-
-#: sources/views/settings.html.php:27
-msgid "Loading complete status may take a few minutes. Be patient."
-msgstr ""
-
-#: sources/views/settings.html.php:27
-msgid "More details"
-msgstr ""
-
-#: sources/views/settings.html.php:43
-msgid "Service"
-msgstr ""
-
-#: sources/views/settings.html.php:48
-msgid "VPN Enabled"
-msgstr ""
-
-#: sources/views/settings.html.php:60
-msgid "Manual"
-msgstr ""
-
-#: sources/views/settings.html.php:61
-msgid "Automatic"
-msgstr ""
-
-#: sources/views/settings.html.php:67
-msgid "VPN"
-msgstr ""
-
-#: sources/views/settings.html.php:72
-msgid "Server Address"
-msgstr ""
-
-#: sources/views/settings.html.php:79
-msgid "Server Port"
-msgstr ""
-
-#: sources/views/settings.html.php:81
-msgid "With restricted access, you should use 443 (TCP) or 53 (UDP)"
-msgstr ""
-
-#: sources/views/settings.html.php:86
-msgid "Protocol"
-msgstr ""
-
-#: sources/views/settings.html.php:89
-msgid "UDP"
-msgstr ""
-
-#: sources/views/settings.html.php:92
-msgid ""
-"UDP is more efficient than TCP (but more filtered in case of restrictive "
-"access)"
-msgstr ""
-
-#: sources/views/settings.html.php:93
-msgid "TCP"
-msgstr ""
-
-#: sources/views/settings.html.php:99
-msgid "Delegated prefix (IPv6)"
-msgstr ""
-
-#: sources/views/settings.html.php:101
-msgid ""
-"Leave empty if your Internet Service Provider does not give you a delegated "
-"prefix"
-msgstr ""
-
-#: sources/views/settings.html.php:108
-msgid "Edit the raw configuration only if you know what you do!"
-msgstr ""
-
-#: sources/views/settings.html.php:108 sources/views/settings.html.php:113
-msgid "Advanced"
-msgstr ""
-
-#: sources/views/settings.html.php:124
-msgid ""
-"You need to upload a Client Certificate, or define a Username (or both) for "
-"starting your VPN Client."
-msgstr ""
-
-#: sources/views/settings.html.php:130
-msgid "Authentication"
-msgstr ""
-
-#: sources/views/settings.html.php:138
-msgid "You need to upload a Server CA for starting your VPN Client."
-msgstr ""
-
-#: sources/views/settings.html.php:142
-msgid "Update Server CA"
-msgstr ""
-
-#: sources/views/settings.html.php:142
-msgid "Upload Server CA"
-msgstr ""
-
-#: sources/views/settings.html.php:145
-msgid "You cannot have no server CA"
-msgstr ""
-
-#: sources/views/settings.html.php:150 sources/views/settings.html.php:163
-#: sources/views/settings.html.php:176 sources/views/settings.html.php:189
-#: sources/views/settings.html.php:244
-msgid "Browse"
-msgstr ""
-
-#: sources/views/settings.html.php:155
-msgid "Update Client Cert."
-msgstr ""
-
-#: sources/views/settings.html.php:155
-msgid "Upload Client Cert."
-msgstr ""
-
-#: sources/views/settings.html.php:158 sources/views/settings.html.php:171
-#: sources/views/settings.html.php:184
-msgid "Delete this certificate"
-msgstr ""
-
-#: sources/views/settings.html.php:168
-msgid "Update Client Key"
-msgstr ""
-
-#: sources/views/settings.html.php:168
-msgid "Upload Client Key"
-msgstr ""
-
-#: sources/views/settings.html.php:174 sources/views/settings.html.php:187
-msgid "Make sure your browser is able to read the key file before uploading"
-msgstr ""
-
-#: sources/views/settings.html.php:176 sources/views/settings.html.php:189
-msgid "make sure your browser is able to read the key file before uploading"
-msgstr ""
-
-#: sources/views/settings.html.php:181
-msgid "Update Shared-Secret"
-msgstr ""
-
-#: sources/views/settings.html.php:181
-msgid "Upload Shared-Secret"
-msgstr ""
-
-#: sources/views/settings.html.php:194
-msgid "Username"
-msgstr ""
-
-#: sources/views/settings.html.php:196 sources/views/settings.html.php:203
-msgid "Leave empty if not necessary"
-msgstr ""
-
-#: sources/views/settings.html.php:201
-msgid "Password"
-msgstr ""
-
-#: sources/views/settings.html.php:211
-msgid "DNS"
-msgstr ""
-
-#: sources/views/settings.html.php:216
-msgid "First resolver"
-msgstr ""
-
-#: sources/views/settings.html.php:218 sources/views/settings.html.php:225
-msgid "IPv6 or IPv4"
-msgstr ""
-
-#: sources/views/settings.html.php:223
-msgid "Second resolver"
-msgstr ""
-
-#: sources/views/settings.html.php:235
-msgid "Auto Configuration"
-msgstr ""
-
-#: sources/views/settings.html.php:240
-msgid "Upload Config"
-msgstr ""
-
-#: sources/views/settings.html.php:247
-msgid "What is a dot cube file?"
-msgstr ""
-
-#: sources/views/settings.html.php:255
-msgid "Reloading may take a few minutes. Be patient."
-msgstr ""
-
-#: sources/views/settings.html.php:255
-msgid "Save and reload"
-msgstr ""

+ 0 - 27
sources/index.php

@@ -1,27 +0,0 @@
-<?php
-
-/* VPN Client app for YunoHost 
- * Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
- * Contribute at https://github.com/labriqueinternet/vpnclient_ynh
- * 
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- * 
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-require dirname(__FILE__).'/lib/limonade.php';
-require dirname(__FILE__).'/controller.php';
-require dirname(__FILE__).'/lib/unix_func.php';
-//require '/usr/share/php/php-gettext/gettext.inc';
-require dirname(__FILE__).'/config.php';
-
-run();

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 2707
sources/lib/limonade.php


+ 0 - 193
sources/lib/limonade/abstract.php

@@ -1,193 +0,0 @@
-<?php
-/**
- * Abstract methods that might be redefined by user
- * Do not include this file in your app: it only aims to provide documentation
- * about those functions.
- * 
- * @package limonade
- * @subpackage abstract
- */
- 
-/**
- * It will be called when app is launched (at the begining of the run function).
- * You can define options inside it, a connection to a database ...
- *
- * @abstract this function might be redefined by user
- * @return void 
- */
-function configure()
-{
-  return;
-}
-
-/**
- * Called in run() just after session start, and before checking request method
- * and output buffer start.  
- *
- * @abstract this function might be redefined by user
- * @return void 
- */
-function initialize()
-{
-  return;
-}
-
-/**
- * Called in run() just after the route matching, in order to load controllers. 
- * If not specfied, the default function is called:
- * 
- * <code>
- * function autoload_controller($callback)
- * {
- *   require_once_dir(option('controllers_dir'));
- * }
- * </code>
- * 
- *
- * @param string $callback the callback defined in matching route
- * @return void
- */
-function autoload_controller($callback)
-{
-  return;
-}
- 
-/**
- * Called before each request.
- * This is very useful to define a default layout or passing common variables
- * to the templates.
- *
- * @abstract this function might be redefined by user
- * @param array() $route array (like returned by {@link route_build()},
- *   with keys "method", "pattern", "names", "callback", "options")
- * @return void 
- */
-function before($route)
-{
-  
-}
- 
-/**
- * An `after` output filter
- * 
- * Called after each request and can apply a transformation to the output
- * (except for `render_file` outputs  which are sent directly to the output buffer).
- *
- * @abstract this function might be redefined by user
- * @param string $output 
- * @param array() $route array (like returned by {@link route_find()},
- *   with keys "method", "pattern", "names", "callback", "params", "options")
- * @return string 
- */
-function after($output, $route)
-{
-  # Call functions...
-  # .. modifies $output...
-  return $output;
-}
- 
-/**
- * Not found error output
- *
- * @abstract this function might be redefined by user
- * @param string $errno 
- * @param string $errstr 
- * @param string $errfile 
- * @param string $errline 
- * @return string "not found" output string
- */
-function not_found($errno, $errstr, $errfile=null, $errline=null)
-{
- 
-}
- 
-/**
- * Server error output
- *
- * @abstract this function might be redefined by user
- * @param string $errno 
- * @param string $errstr 
- * @param string $errfile 
- * @param string $errline 
- * @return string "server error" output string
- */
-function server_error($errno, $errstr, $errfile=null, $errline=null)
-{
-  
-}
- 
-/**
- * Called when a route is not found.
- * 
- * 
- * @abstract this function might be redefined by user
- * @param string $request_method 
- * @param string $request_uri 
- * @return void 
- */
-function route_missing($request_method, $request_uri)
-{
-  halt(NOT_FOUND, "($request_method) $request_uri"); # by default
-}
-
-/**
- * Called before stoppping and exiting application.
- *
- * @abstract this function might be redefined by user
- * @param boolean exit or not
- * @return void 
- */
-function before_exit($exit)
-{
-  
-}
-
-/**
- * Rendering prefilter.
- * Useful if you want to transform your views before rendering.
- * The first three parameters are the same as those provided 
- * to the `render` function.
- *
- * @abstract this function might be redefined by user
- * @param string $content_or_func a function, a file in current views dir or a string
- * @param string $layout 
- * @param array $locals 
- * @param array $view_path (by default <code>file_path(option('views_dir'),$content_or_func);</code>)
- * @return array with, in order, $content_or_func, $layout, $locals vars
- *  and the calculated $view_path
- */
-function before_render($content_or_func, $layout, $locals, $view_path)
-{
-  # transform $content_or_func, $layout, $locals or $view_path…
-  return array($content_or_func, $layout, $locals, $view_path);
-}
-
-
-/**
- * Called only if rendering $output is_null,
- * like in a controller with no return statement.
- *
- * @abstract this function might be defined by user
- * @param array() $route array (like returned by {@link route_build()},
- *   with keys "method", "pattern", "names", "callback", "options")
- * @return string
- */
-function autorender($route)
-{
-  # process output depending on $route
-  return $output;
-}
-
-/**
- * Called if a header is about to be sent
- *
- * @abstract this function might be defined by user
- * @param string the headers that limonade will send
- * @return void
- */
-function before_sending_header($header)
-{
-
-}
-
-

+ 0 - 173
sources/lib/limonade/assertions.php

@@ -1,173 +0,0 @@
-<?php
-/**
- * @package tests
- * @subpackage assertions
- */
-# ============================================================================ #
-#    ASSERTIONS                                                                #
-# ============================================================================ #
-
-/**
- * assert_true
- *
- * @param string $value 
- * @param string $message 
- * @return boolean
- */
-function assert_true($value, $message = '<1> should be TRUE')
-{
-   test_run_assertion();
-   return assert('$value === TRUE; //'.$message);
-}
-
-function assert_false($value, $message = '<1> should be FALSE')
-{
-   test_run_assertion();
-   return assert('$value === FALSE; //'.$message);
-}
-
-function assert_null($value, $message = '<1> should be NULL')
-{
-   test_run_assertion();
-   return assert('$value === NULL; //'.$message);
-}
-
-function assert_not_null($value, $message = '<1> should not be NULL')
-{
-   test_run_assertion();
-   return assert('$value !== NULL; //'.$message);
-}
-
-function assert_empty($value, $message = '<1> should be empty')
-{
-   test_run_assertion();
-   return assert('empty($value); //'.$message);
-}
-
-function assert_not_empty($value, $message = '<1> should not be empty')
-{
-   test_run_assertion();
-   return assert('!empty($value); //'.$message);
-}
-
-function assert_equal($expected, $value, $message = '<1> should be equal to <2>')
-{
-   test_run_assertion();
-   return assert('$expected == $value; //'.$message);
-}
-
-function assert_not_equal($expected, $value, $message = '<1> should not equal to <2>')
-{
-   test_run_assertion();
-   return assert('$expected != $value; //'.$message);
-}
-
-function assert_identical($expected, $value, $message = '<1> should be identical to <2>')
-{
-   test_run_assertion();
-   return assert('$expected === $value; //'.$message);
-}
-
-function assert_not_identical($expected, $value, $message = '<1> should not be identical to <2>')
-{
-   test_run_assertion();
-   return assert('$expected !== $value; //'.$message);
-}
-
-function assert_match($pattern, $string, $message = '<2> expected to match regular expression <1>') {
-   test_run_assertion();
-   return assert('preg_match($pattern, $string); //'.$message);
-}
- 
-function assert_no_match($pattern, $string, $message = '<2> expected to not match regular expression <1>') {
-   test_run_assertion();
-   return assert('!preg_match($pattern, $string); //'.$message);
-}
-
-function assert_type($type, $value, $message = '<1> is not of type <2>') {
-  test_run_assertion();
-  $predicate = 'is_' . strtolower(is_string($type) ? $type : gettype($type));
-  return assert('$predicate($value); //'.$message);
-}
- 
-function assert_instance_of($class, $object, $message = '<2> is not an instance of class <1>') {
-   test_run_assertion();
-   return assert('$object instanceof $class; //'.$message);
-}
- 
-function assert_length_of($value, $length, $message = '<1> expected to be of length <2>') {
-   test_run_assertion();
-   $count = is_string($value) ? 'strlen' : 'count';
-   return assert('$count($value) == $length; //'.$message);
-}
-
-function assert_trigger_error($callable, $args = array(), $message = '<1> should trigger an error') {
-  test_run_assertion();
-  $trigger_errors = count($GLOBALS["limonade"]["test_errors"]);
-  set_error_handler("test_error_handler");
-  $result = call_user_func_array($callable, $args);
-  restore_error_handler();
-  return assert('$trigger_errors < count($GLOBALS["limonade"]["test_errors"]); //'.$message);
-}
-
-# TODO add web browser assertions assert_http_get, assert_http_response... as in SimpleTest (http://www.simpletest.org/en/web_tester_documentation.html)
-
-function assert_header($response, $expected_name, $expected_value = null, $message = "expected header '%s' to be equal to '%s' but received '%s: %s'")
-{
-  test_run_assertion();
-  # see assert_header in http://github.com/fnando/voodoo-test/blob/f3b0994ef138a6ba94d5e7cef6c1fb1720797a86/lib/assertions.php
-  $headers = preg_split("/^\s*$/ms", $response);
-  //var_dump($headers);    
-  $headers = preg_replace("/\s*$/sm", "", $headers[0]);
-  //var_dump($headers);   
-  
-  $regex_header = str_replace("/", "\\/", $expected_name);
-  $regex_header = str_replace(".", "\\.", $regex_header);
-  
-  $header = $expected_name;
-  
-  # from http://www.faqs.org/rfcs/rfc2616
-  # Field names are case-insensitive
-  if ($expected_value) {
-      $regex = "/^{$regex_header}:(.*?)$/ism";
-      $header .= ": {$expected_value}";
-  } else {
-      $regex = "/^{$regex_header}(:.*?)?$/ism";
-  }
-  
-  $has_header = preg_match($regex, $headers, $matches);    
-  $sent_header = trim((string)$matches[1]);
-
-  
-  if(empty($sent_header))
-  {
-    if(is_null($expected_value))
-    {
-      $message = "expected header '%s' but header has not been sent";
-    }
-    else
-    {
-      $message = "expected header '%s' to be equal to '%s' but header has not been sent";
-    }
-    
-    $message = sprintf($message, $expected_name, $expected_value);
-    return assert("false; //".$message);
-  }
-  else if($expected_value)
-  {
-    $message = sprintf($message, $expected_name, $expected_value, $expected_name, $sent_header);
-    return assert('$expected_value && $sent_header == $expected_value; //'.$message);
-  }
-  return assert("true; //");
-}
-
-function assert_status($response, $expected_status, $message = "expected status code to be equal to '%s' but received '%s'")
-{
-  $lines = explode('\n', trim($response));
-  if (preg_match('/HTTP\/(\d+\.\d+)\s+(\d+)/i', $lines[0], $matches))
-  {
-      $status = $matches[2];
-      return assert('$expected_status == $status; //'.sprintf($message, $expected_status, $status));
-  }
-  return assert("false; //no status code returned in this response string");
-}

+ 0 - 220
sources/lib/limonade/public/css/screen.css

@@ -1,220 +0,0 @@
-/* -----------------------------------------------------------------------
-
-
- Blueprint CSS Framework 0.8
- http://blueprintcss.org
-
-   * Copyright (c) 2007-Present. See LICENSE for more info.
-   * See README for instructions on how to use Blueprint.
-   * For credits and origins, see AUTHORS.
-   * This is a compressed file. See the sources in the 'src' directory.
-
------------------------------------------------------------------------ */
-
-/* reset.css */
-html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;}
-body {line-height:1.5;}
-table {border-collapse:separate;border-spacing:0;}
-caption, th, td {text-align:left;font-weight:normal;}
-table, td, th {vertical-align:middle;}
-blockquote:before, blockquote:after, q:before, q:after {content:"";}
-blockquote, q {quotes:"" "";}
-a img {border:none;}
-
-/* typography.css */
-body {font-size:75%;color:#222;background:#fff;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;}
-h1, h2, h3, h4, h5, h6 {font-weight:normal;color:#111;}
-h1 {font-size:3em;line-height:1;margin-bottom:0.5em;}
-h2 {font-size:2em;margin-bottom:0.75em;}
-h3 {font-size:1.5em;line-height:1;margin-bottom:1em;}
-h4 {font-size:1.2em;line-height:1.25;margin-bottom:1.25em;}
-h5 {font-size:1em;font-weight:bold;margin-bottom:1.5em;}
-h6 {font-size:1em;font-weight:bold;}
-h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {margin:0;}
-p {margin:0 0 1.5em;}
-p img.left {float:left;margin:1.5em 1.5em 1.5em 0;padding:0;}
-p img.right {float:right;margin:1.5em 0 1.5em 1.5em;}
-a:focus, a:hover {color:#000;}
-a {color:#009;text-decoration:underline;}
-blockquote {margin:1.5em;color:#666;font-style:italic;}
-strong {font-weight:bold;}
-em, dfn {font-style:italic;}
-dfn {font-weight:bold;}
-sup, sub {line-height:0;}
-abbr, acronym {border-bottom:1px dotted #666;}
-address {margin:0 0 1.5em;font-style:italic;}
-del {color:#666;}
-pre {margin:1.5em 0;white-space:pre;}
-pre, code, tt {font:1em 'andale mono', 'lucida console', monospace;line-height:1.5;}
-li ul, li ol {margin:0 1.5em;}
-ul, ol {margin:0 1.5em 1.5em 1.5em;}
-ul {list-style-type:disc;}
-ol {list-style-type:decimal;}
-dl {margin:0 0 1.5em 0;}
-dl dt {font-weight:bold;}
-dd {margin-left:1.5em;}
-table {margin-bottom:1.4em;width:100%;}
-th {font-weight:bold;}
-thead th {background:#c3d9ff;}
-th, td, caption {padding:4px 10px 4px 5px;}
-tr.even td {background:#e5ecf9;}
-tfoot {font-style:italic;}
-caption {background:#eee;}
-.small {font-size:.8em;margin-bottom:1.875em;line-height:1.875em;}
-.large {font-size:1.2em;line-height:2.5em;margin-bottom:1.25em;}
-.hide {display:none;}
-.quiet {color:#666;}
-.loud {color:#000;}
-.highlight {background:#ff0;}
-.added {background:#060;color:#fff;}
-.removed {background:#900;color:#fff;}
-.first {margin-left:0;padding-left:0;}
-.last {margin-right:0;padding-right:0;}
-.top {margin-top:0;padding-top:0;}
-.bottom {margin-bottom:0;padding-bottom:0;}
-
-/* forms.css */
-label {font-weight:bold;}
-fieldset {padding:1.4em;margin:0 0 1.5em 0;border:1px solid #ccc;}
-legend {font-weight:bold;font-size:1.2em;}
-input.text, input.title, textarea, select {margin:0.5em 0;border:1px solid #bbb;}
-input.text:focus, input.title:focus, textarea:focus, select:focus {border:1px solid #666;}
-input.text, input.title {width:300px;padding:5px;}
-input.title {font-size:1.5em;}
-textarea {width:390px;height:250px;padding:5px;}
-.error, .notice, .success {padding:.8em;margin-bottom:1em;border:2px solid #ddd;}
-.error {background:#FBE3E4;color:#8a1f11;border-color:#FBC2C4;}
-.notice {background:#FFF6BF;color:#514721;border-color:#FFD324;}
-.success {background:#E6EFC2;color:#264409;border-color:#C6D880;}
-.error a {color:#8a1f11;}
-.notice a {color:#514721;}
-.success a {color:#264409;}
-
-.box {padding:1.5em;margin-bottom:1.5em;background:#E5ECF9;}
-hr {background:#ddd;color:#ddd;clear:both;float:none;width:100%;height:.1em;margin:0 0 1.45em;border:none;}
-hr.space {background:#fff;color:#fff;}
-.clearfix:after, .container:after {content:"\0020";display:block;height:0;clear:both;visibility:hidden;overflow:hidden;}
-.clearfix, .container {display:block;}
-.clear {clear:both;}
-
-/* -----------------------------------------------------------------------
-
- LIMONADE
- 
- Design and logo by <a href="http://www.minimau.com">Minimau</a>
-
------------------------------------------------------------------------ */
-
-html {
- 	background-color: #b4a689;
- 	text-align: center;
- 	}
- 	body {
- 		width: auto; /* 16 col */
- 		margin: 0 20px;
- 		text-align: left;
- 		/*background: #fff url(blueprint/src/grid.png);*/
- 		font-family: Verdana, Geneva, sans-serif;
- 		color: #303030;
- 		}
- 		a, a:hover, a:visited {
- 			color: #4596cd;
- 			}
- 		a:hover {
- 			text-decoration: none;
- 			}
- 		#header, h1, h2, h3, h4 {
- 			font-family: "Arial Black", Gadget, sans-serif;
- 			}
- 		h1 {
- 			color: #b4a689;
- 			font-size: 2em;
- 			line-height: 2;
- 			border-bottom: 7px solid #000;
- 			margin-bottom: 0.75em;
- 			margin-top:0;
- 			}
- 		h2 {
- 			font-size: 1.5em;
- 			color: #cddb12;
- 			margin-top: 2em;
- 			line-height: 0.8;
- 			margin-bottom: 1.2em;
- 			}
- 		h3 {
- 			font-size: 1.33em;
- 			line-height: 0.89;
- 			margin-top: 2.66em;
- 			margin-bottom: 1.33em;
- 			color:#95b383;
- 			}
- 		pre {
- 			background-color: #cddb12;
- 			font-size: 12px;
- 			padding: 1.5em;
- 			margin-bottom: 1.5em;
- 			overflow: auto;
- 			}
- 		code {
- 			font: 10px Monaco, "Courier New", Courier, monospace;
- 			color: #0d562a;
- 			}
- 		#header {
- 			/*position:relative;*/
- 			height: 187px; /* 12 lines */
- 			background: #fff url(<?=url_for('/_lim_public/img/bg_header.png')?>) no-repeat 0 0;
- 			margin-top: 10px;
-      padding:0;
- 			}
- 			#header h1 {
- 				position: absolute;
- 				left:-9999px;
- 				   			margin:0;
- 				}
- 		#footer {
- 			padding: 0 55px;
- 			background-color: #1a1818;
- 			color: #999;
- 			height: 2em;
- 			line-height: 2em;
- 			text-align: right;
- 			}
- 			#footer a {
- 				color: #a3d8de;
- 				text-decoration: none;
- 				}
- 			#footer a:hover {
- 				color: #fff;
- 				}
- 		#content {
- 		  background-color: #fff;
- 			padding: 0 55px;
- 			min-height: 400px;
- 			}
-    		p.bt {
-    		   text-align:right;
-    		   }
-       		p.bt a {
-       		   text-decoration:none;
-       		   padding: 2px 4px;
-       		   }
-       		p.bt a:hover {
-      	      background-color: #4596cd;
-      	      color: #fff;
-      	      }
-      	#debug-menu {
-      	   position: fixed;
-      	   top: 0px;
-      	   right:20px;
-      	   background-color: rgba(100,100,100, 0.7);
-      	   padding:5px;
-      	}
-      	#debug-menu a {
-      	   color: #fff;
-      	   font-size: 90%;
-      	   text-decoration:none;
-   	   }
-   	   #debug-menu a:hover {
-   	      text-decoration: underline;
-	      }
-   	

BIN
sources/lib/limonade/public/img/bg_header.png


+ 0 - 350
sources/lib/limonade/tests.php

@@ -1,350 +0,0 @@
-<?php
-/**
- * @package tests
- */
- 
-# ============================================================================ #
-#    TESTS                                                                     #
-# ============================================================================ #
-
-/**
- * load assertions
- */
-require_once dirname(__FILE__)."/assertions.php";
-
-
- 
-/**
- * Constants and globals
- */
-if(!defined('DS')) define("DS", DIRECTORY_SEPARATOR);
-
-if(!array_key_exists("limonade", $GLOBALS))
-   $GLOBALS["limonade"] = array();
-if(!array_key_exists("test_cases", $GLOBALS["limonade"]))
-   $GLOBALS["limonade"]["test_cases"] = array();
-if(!array_key_exists("test_errors", $GLOBALS["limonade"]))
-   $GLOBALS["limonade"]["test_errors"] = array();
-if(!array_key_exists("test_case_current", $GLOBALS["limonade"]))
-   $GLOBALS["limonade"]["test_case_current"] = NULL;
-if(!array_key_exists("test_suites", $GLOBALS["limonade"]))
-   $GLOBALS["limonade"]["test_suites"] = NULL;
-
-ini_set("display_errors", true);
-error_reporting(E_ALL ^ (E_USER_WARNING | E_NOTICE | E_USER_NOTICE));
-// error_reporting(E_ALL | E_STRICT);
-assert_options(ASSERT_ACTIVE, 1);
-assert_options(ASSERT_WARNING, 0);
-assert_options(ASSERT_BAIL, 0);
-assert_options(ASSERT_QUIET_EVAL, 0);
-assert_options(ASSERT_CALLBACK, 'test_assert_failure');
-
-# TODO: separate display from logic
-# TODO: clean results output
-# TODO: add all tests results
-
-/**
- * Starts a test suite
- *
- * @param string $name 
- * @return void
- */
-function test_suite($name)
-{
-  $GLOBALS["limonade"]["test_suites"] = $name;
-  echo test_cli_format("===========================================================\n", 'white');
-  echo test_cli_format(">>>> START $name tests suites\n", 'white');
-  echo test_cli_format("-----------------------------------------------------------\n", 'white');
-}
-
-/**
- * Ends the last group of test suites
- *
- * @return void
- */
-function end_test_suite()
-{
-  $name         = $GLOBALS["limonade"]["test_suites"];
-  $failures     = 0;
-  $tests        = 0;
-  $passed_tests = 0;
-  $assertions   = 0;
-
-  foreach($GLOBALS["limonade"]["test_cases"] as $test)
-  {
-    $failures += $test['failures'];
-    $assertions += $test['assertions'];
-    if(empty($test['failures'])) $passed_tests++;
-    $tests++;
-  }
-  echo ">> ENDING $name tests suites\n  ";
-  echo $failures > 0 ? test_cli_format("|FAILED!|", "red") : test_cli_format("|PASSED|", "green");;
-  echo " Passes ".$passed_tests."/".$tests.", ";
-  echo " {$failures} failures for {$assertions} assertions.\n";
-  echo test_cli_format("===========================================================\n", 'white');
-}
-
-/**
- * Starting a new test case
- *
- * @param string $name 
- * @return void
- */
-function test_case($name)
-{
-   $name = strtolower($name); // TODO: normalize name
-   
-   if(!array_key_exists($name, $GLOBALS["limonade"]["test_cases"]))
-   {
-      $GLOBALS["limonade"]["test_cases"][$name] = array( 
-                                                      "name" => $name,
-                                                      "assertions" => 0, 
-                                                      "failures" => 0,
-                                                      "description" => NULL
-                                                   );      
-      $GLOBALS["limonade"]["test_case_current"] = $name;
-   }
-   else
-   {
-      
-   }
-}
-
-/**
- * Displays and ending the current tests suite
- * 
- * @return void
- */
-function end_test_case()
-{
-   $name = $GLOBALS["limonade"]["test_case_current"];
-   echo "## ".strtoupper($name)."\n";
-      
-   $desc = test_case_describe();
-   if(!is_null($desc)) echo $desc."\n";
-
-   echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";
-   
-   test_case_execute_current();
-   
-   
-   if(!is_null($name))
-   {
-      $test = $GLOBALS["limonade"]["test_cases"][$name];
-      // closing previous test
-      echo "\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";
-      echo $test['failures'] > 0 ? test_cli_format("|FAILED!|", "red") : test_cli_format("|PASSED|", "green");
-      echo " Test case '$name' finished: ";
-      echo count(test_case_all_func())." tests, ";
-      echo " {$test['failures']} failures for {$test['assertions']} assertions.\n";
-      
-      echo "-----------------------------------------------------------\n";
-   }
-   $GLOBALS["limonade"]["test_case_current"] = null;
-}
-
-/**
- * Describes the current tests suite
- *
- * @param string $msg 
- * @return string tests description
- */
-function test_case_describe($msg = NULL)
-{
-   $test =& test_case_current();
-   if(!is_null($msg))
-   {
-      $test["description"] = $msg;
-   }
-   //var_dump($test["description"]);
-   return $test["description"];
-}
-
-/**
- * Returns all user test case functions
- *
- * @access private
- * @return void
- */
-function test_case_all_func()
-{
-   $functions = get_defined_functions();
-   $functions = $functions['user'];
-   $tests = array();
-   $name = $GLOBALS["limonade"]["test_case_current"];
-   while ($func = array_shift($functions)) {
-      $regexp = "/^test_{$name}_(.*)$/";
-      if(!preg_match($regexp, $func)) continue;
-      if($func == test_before_func_name()) continue;
-      // TODO: adding break for all test api methods
-      
-      $tests[] = $func;
-   }
-   return $tests;
-}
-
-/**
- * Execute current test case
- *
- * @access private
- * @return void
- */
-function test_case_execute_current()
-{
-   $tests = test_case_all_func();
-   while($func = array_shift($tests))
-   {
-      test_call_func(test_before_func_name());
-      call_user_func($func);
-   }
-}
-
-
-function &test_case_current()
-{
-   $name = $GLOBALS["limonade"]["test_case_current"];
-   return $GLOBALS["limonade"]["test_cases"][$name];
-}
-
-
-
-function test_before_func_name()
-{
-   $test = test_case_current();
-   $func = "before_each_test_in_".$test["name"];
-   return $func;
-}
-
-function test_before_assert_func_name()
-{
-   $test = test_case_current();
-   $func = "before_each_assert_in_$name".$test["name"];
-   return $func;
-}
-
-function test_run_assertion()
-{
-   $name = $GLOBALS["limonade"]["test_case_current"];
-   $GLOBALS["limonade"]["test_cases"][$name]['assertions']++;
-   test_call_func(test_before_assert_func_name());
-}
-
-/**
- * Calls a function if exists
- *
- * @param string $func the function name
- * @param mixed $arg,.. (optional)
- * @return mixed
- */
-function test_call_func($func)
-{
-  if(empty($func)) return;
-  $args = func_get_args();
-  $func = array_shift($args);
-  if(function_exists($func)) return call_user_func_array($func, $args);
-  return;
-}
-
-/**
- * Error handler 
- * 
- * @access private
- * @return boolean true
- */
-function test_error_handler($errno, $errstr, $errfile, $errline)
-{
-	if($errno < E_USER_ERROR || $errno > E_USER_NOTICE) 
-	   echo test_cli_format("!!! ERROR", "red") . " [$errno], $errstr in $errfile at line $errline\n";
-	$GLOBALS["limonade"]["test_errors"][] = array($errno, $errstr, $errfile, $errline);
-   return true;
-}
-
-/**
- * Assert callback
- * 
- * @access private
- * @param string $script 
- * @param string $line 
- * @param string $message 
- * @return void
- */
-function test_assert_failure($script, $line, $message)
-{
-   // Using the stack trace, find the outermost assert*() call
-   $stacktrace = array_slice(debug_backtrace(), 1); // skip self
-   $assertion = reset($stacktrace);
-   while ($stackframe = array_shift($stacktrace)) {
-    if (!preg_match('/^assert/', $stackframe['function']))
-      break;
-    $assertion = $stackframe;
-   }
-
-   extract($assertion, EXTR_PREFIX_ALL, 'assert');
-   $code = explode("\n", file_get_contents($assert_file));
-   $code = trim($code[$assert_line - 1]);
-   
-   list($assert_code, $message) = explode("//", $message);
-   echo test_cli_format("Assertion failed", "yellow");
-   echo " in script *{$assert_file}* (line {$assert_line}):\n";
-   echo "   * assertion: $code\n";
-   echo "   * message:   $message\n";
-   $name = $GLOBALS["limonade"]["test_case_current"];
-   $GLOBALS["limonade"]["test_cases"][$name]['failures']++;
-}
-
-function test_cli_format($text, $format) {
-    $formats = array(
-        "blue"       => 34,
-        "bold"       => 1,
-        "green"      => 32,
-        "highlight"  => 7,
-        "light_blue" => 36,
-        "purple"     => 35,
-        "red"        => 31,
-        "underline"  => 4,
-        "white"      => 37,
-        "yellow"     => 33
-    );
-
-    if (array_key_exists($format, $formats)) $format = $formats[$format];
-    return chr(27) . "[01;{$format} m{$text}" . chr(27) . "[00m";
-}
-
-/**
- * Do HTTP request and return the response content.
- * 
- * @param string $url
- * @param string $method
- * @param bool $include_header
- * @return string
- * @author Nando Vieira
- */
-function test_request($url, $method="GET", $include_header=false, $post_data=array(), $http_header=array()) {
-    $method = strtoupper($method);
-    $allowed_methods = array("GET", "PUT", "POST", "DELETE", "HEAD");
-    if(!in_array($method, $allowed_methods))
-    {
-      $message = "The requested method '$method' is not allowed";
-      return assert('false; //'.$message);
-    }
-    
-    $curl = curl_init($url);
-    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
-    curl_setopt($curl, CURLOPT_HEADER, $include_header);
-    curl_setopt($curl, CURLOPT_HTTPHEADER, $http_header);
-    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
-    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); 
-    if($method == 'POST' || $method == 'PUT')
-    {
-      curl_setopt($curl, CURLOPT_POST, 1);
-      curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
-    }
-    if($method == 'HEAD')
-    {
-      curl_setopt($curl, CURLOPT_NOBODY, true);
-    }
-    $response = curl_exec($curl);
-    curl_close($curl);
-
-    return $response;
-}

+ 0 - 37
sources/lib/limonade/views/_debug.html.php

@@ -1,37 +0,0 @@
-<?php if(option('env') > ENV_PRODUCTION && option('debug')): ?>
-  <?php if(!$is_http_error): ?>
-  <p>[<?php echo error_type($errno)?>]
-  	<?php echo $errstr?> (in <strong><?php echo $errfile?></strong> line <strong><?php echo $errline?></strong>)
-  	</p>
-  	<?php endif; ?>
-
-
-  <?php if($debug_args = set('_lim_err_debug_args')): ?>
-  <h2 id="debug-arguments">Debug arguments</h2>
-  	<pre><code><?php echo h(print_r($debug_args, true))?></code></pre>
-  <?php endif; ?>
-  
-  <h2 id="limonade-options">Options</strong></h2>
-  <pre><code><?php echo h(print_r(option(), true))?></code></pre>
-  <p class="bt top"><a href="#header">[ &#x2191; ]</a></p>
-  
-  <h2 id="environment">Environment</h2>
-  <pre><code><?php echo h(print_r(env(), true))?></code></pre>
-  <p class="bt top"><a href="#header">[ &#x2191; ]</a></p>
-  
-  <h2 id="debug-backtrace">Backtrace</h2>
-  <pre><code><?php echo h(print_r(debug_backtrace(), true))?></code></pre>
-  <p class="bt top"><a href="#header">[ &#x2191; ]</a></p>
-
-  <div id="debug-menu">
-    
-    <?php if($debug_args = set('_lim_err_debug_args')): ?>
-    <a href="#debug-arguments">Debug arguments</a> |
-    <?php endif; ?>
-    <a href="#limonade-options">Options</a> |
-    <a href="#environment">Environment</a> |
-    <a href="#debug-backtrace">Backtrace</a> |
-    <a href="#header">[ &#x2191; ]</a>
-  </div>
-  
-<?php endif; ?>

+ 0 - 15
sources/lib/limonade/views/_notices.html.php

@@ -1,15 +0,0 @@
-<?php if(!empty($notices)): ?>
-<div class="lim-debug lim-notices">
-  <h4> &#x2192; Notices and warnings</h4>
-  <dl>
-  <?php $cpt = 1; foreach($notices as $notice): ?>
-    <dt>[<?php echo $cpt.'. '.error_type($notice['errno'])?>]</dt>
-    <dd>
-    <?php echo $notice['errstr']?> in <strong><code><?php echo $notice['errfile']?></code></strong> 
-    line <strong><code><?php echo $notice['errline']?></code></strong>
-    </dd>
-  <?php $cpt++; endforeach; ?>
-  </dl>
-  <hr>
-</div>
-<?php endif; ?>

+ 0 - 22
sources/lib/limonade/views/default_layout.php

@@ -1,22 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-	<title>Limonade, the fizzy PHP micro-framework</title>
-	<link rel="stylesheet" href="<?php echo url_for('/_lim_css/screen.css');?>" type="text/css" media="screen">
-</head>
-<body>
-  <div id="header">
-    <h1>Limonade</h1>
-  </div>
-  
-  <div id="content">
-    <?php echo error_notices_render(); ?>
-    <div id="main">
-      <?php echo $content;?>
-      <hr class="space">
-    </div>
-  </div>
-
-</body>
-</html>

+ 0 - 6
sources/lib/limonade/views/error.html.php

@@ -1,6 +0,0 @@
-  <h1><?php echo h(error_http_status($errno));?></h1>
-  <?php if($is_http_error): ?>
-  <p><?php echo h($errstr)?></p>
-  <?php endif; ?>
-  
-  <?php echo  render('_debug.html.php', null, $vars); ?>

+ 0 - 49
sources/lib/unix_func.php

@@ -1,49 +0,0 @@
-<?php 
-
- /**
-  *  YunoHost - Self-hosting for all
-  *  Copyright (C) 2012  Kload <kload@kload.fr>
-  *
-  *  This program is free software: you can redistribute it and/or modify
-  *  it under the terms of the GNU Affero General Public License as
-  *  published by the Free Software Foundation, either version 3 of the
-  *  License, or (at your option) any later version.
-  *
-  *  This program is distributed in the hope that it will be useful,
-  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  *  GNU Affero General Public License for more details.
-  *
-  *  You should have received a copy of the GNU Affero General Public License
-  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-  */
-  
-function read_file($file, $lines = 20) {
-
-    if (!$handle = fopen($file, "r"))
-        return false;
-    $linecounter = $lines;
-    $pos = -2;
-    $beginning = false;
-    $text = array();
-    while ($linecounter > 0) {
-        $t = " ";
-        while ($t != "\n") {
-            if(fseek($handle, $pos, SEEK_END) == -1) {
-                $beginning = true;
-                break;
-            }
-            $t = fgetc($handle);
-            $pos --;
-        }
-        $linecounter --;
-        if ($beginning) {
-            rewind($handle);
-        }
-        $text[$lines-$linecounter-1] = fgets($handle);
-        if ($beginning) break;
-    }
-    fclose ($handle);
-    return array_reverse($text);
-}
-

+ 0 - 457
sources/public/bootstrap/css/bootstrap-theme.css

@@ -1,457 +0,0 @@
-/*!
- * Bootstrap v3.3.0 (http://getbootstrap.com)
- * Copyright 2011-2014 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- */
-
-.btn-default,
-.btn-primary,
-.btn-success,
-.btn-info,
-.btn-warning,
-.btn-danger {
-  text-shadow: 0 -1px 0 rgba(0, 0, 0, .2);
-  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
-          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
-}
-.btn-default:active,
-.btn-primary:active,
-.btn-success:active,
-.btn-info:active,
-.btn-warning:active,
-.btn-danger:active,
-.btn-default.active,
-.btn-primary.active,
-.btn-success.active,
-.btn-info.active,
-.btn-warning.active,
-.btn-danger.active {
-  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
-          box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
-}
-.btn-default .badge,
-.btn-primary .badge,
-.btn-success .badge,
-.btn-info .badge,
-.btn-warning .badge,
-.btn-danger .badge {
-  text-shadow: none;
-}
-.btn:active,
-.btn.active {
-  background-image: none;
-}
-.btn-default {
-  text-shadow: 0 1px 0 #fff;
-  background-image: -webkit-linear-gradient(top, #fff 0%, #e0e0e0 100%);
-  background-image:      -o-linear-gradient(top, #fff 0%, #e0e0e0 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#e0e0e0));
-  background-image:         linear-gradient(to bottom, #fff 0%, #e0e0e0 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  background-repeat: repeat-x;
-  border-color: #dbdbdb;
-  border-color: #ccc;
-}
-.btn-default:hover,
-.btn-default:focus {
-  background-color: #e0e0e0;
-  background-position: 0 -15px;
-}
-.btn-default:active,
-.btn-default.active {
-  background-color: #e0e0e0;
-  border-color: #dbdbdb;
-}
-.btn-default:disabled,
-.btn-default[disabled] {
-  background-color: #e0e0e0;
-  background-image: none;
-}
-.btn-primary {
-  background-image: -webkit-linear-gradient(top, #428bca 0%, #2d6ca2 100%);
-  background-image:      -o-linear-gradient(top, #428bca 0%, #2d6ca2 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#2d6ca2));
-  background-image:         linear-gradient(to bottom, #428bca 0%, #2d6ca2 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0);
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  background-repeat: repeat-x;
-  border-color: #2b669a;
-}
-.btn-primary:hover,
-.btn-primary:focus {
-  background-color: #2d6ca2;
-  background-position: 0 -15px;
-}
-.btn-primary:active,
-.btn-primary.active {
-  background-color: #2d6ca2;
-  border-color: #2b669a;
-}
-.btn-primary:disabled,
-.btn-primary[disabled] {
-  background-color: #2d6ca2;
-  background-image: none;
-}
-.btn-success {
-  background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%);
-  background-image:      -o-linear-gradient(top, #5cb85c 0%, #419641 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#419641));
-  background-image:         linear-gradient(to bottom, #5cb85c 0%, #419641 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  background-repeat: repeat-x;
-  border-color: #3e8f3e;
-}
-.btn-success:hover,
-.btn-success:focus {
-  background-color: #419641;
-  background-position: 0 -15px;
-}
-.btn-success:active,
-.btn-success.active {
-  background-color: #419641;
-  border-color: #3e8f3e;
-}
-.btn-success:disabled,
-.btn-success[disabled] {
-  background-color: #419641;
-  background-image: none;
-}
-.btn-info {
-  background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
-  background-image:      -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#2aabd2));
-  background-image:         linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  background-repeat: repeat-x;
-  border-color: #28a4c9;
-}
-.btn-info:hover,
-.btn-info:focus {
-  background-color: #2aabd2;
-  background-position: 0 -15px;
-}
-.btn-info:active,
-.btn-info.active {
-  background-color: #2aabd2;
-  border-color: #28a4c9;
-}
-.btn-info:disabled,
-.btn-info[disabled] {
-  background-color: #2aabd2;
-  background-image: none;
-}
-.btn-warning {
-  background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
-  background-image:      -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#eb9316));
-  background-image:         linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  background-repeat: repeat-x;
-  border-color: #e38d13;
-}
-.btn-warning:hover,
-.btn-warning:focus {
-  background-color: #eb9316;
-  background-position: 0 -15px;
-}
-.btn-warning:active,
-.btn-warning.active {
-  background-color: #eb9316;
-  border-color: #e38d13;
-}
-.btn-warning:disabled,
-.btn-warning[disabled] {
-  background-color: #eb9316;
-  background-image: none;
-}
-.btn-danger {
-  background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
-  background-image:      -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c12e2a));
-  background-image:         linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  background-repeat: repeat-x;
-  border-color: #b92c28;
-}
-.btn-danger:hover,
-.btn-danger:focus {
-  background-color: #c12e2a;
-  background-position: 0 -15px;
-}
-.btn-danger:active,
-.btn-danger.active {
-  background-color: #c12e2a;
-  border-color: #b92c28;
-}
-.btn-danger:disabled,
-.btn-danger[disabled] {
-  background-color: #c12e2a;
-  background-image: none;
-}
-.thumbnail,
-.img-thumbnail {
-  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
-          box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
-}
-.dropdown-menu > li > a:hover,
-.dropdown-menu > li > a:focus {
-  background-color: #e8e8e8;
-  background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
-  background-image:      -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8));
-  background-image:         linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
-  background-repeat: repeat-x;
-}
-.dropdown-menu > .active > a,
-.dropdown-menu > .active > a:hover,
-.dropdown-menu > .active > a:focus {
-  background-color: #357ebd;
-  background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%);
-  background-image:      -o-linear-gradient(top, #428bca 0%, #357ebd 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#357ebd));
-  background-image:         linear-gradient(to bottom, #428bca 0%, #357ebd 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);
-  background-repeat: repeat-x;
-}
-.navbar-default {
-  background-image: -webkit-linear-gradient(top, #fff 0%, #f8f8f8 100%);
-  background-image:      -o-linear-gradient(top, #fff 0%, #f8f8f8 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f8f8f8));
-  background-image:         linear-gradient(to bottom, #fff 0%, #f8f8f8 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  background-repeat: repeat-x;
-  border-radius: 4px;
-  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
-          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
-}
-.navbar-default .navbar-nav > .open > a,
-.navbar-default .navbar-nav > .active > a {
-  background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);
-  background-image:      -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#dbdbdb), to(#e2e2e2));
-  background-image:         linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);
-  background-repeat: repeat-x;
-  -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
-          box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
-}
-.navbar-brand,
-.navbar-nav > li > a {
-  text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
-}
-.navbar-inverse {
-  background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222 100%);
-  background-image:      -o-linear-gradient(top, #3c3c3c 0%, #222 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#3c3c3c), to(#222));
-  background-image:         linear-gradient(to bottom, #3c3c3c 0%, #222 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  background-repeat: repeat-x;
-}
-.navbar-inverse .navbar-nav > .open > a,
-.navbar-inverse .navbar-nav > .active > a {
-  background-image: -webkit-linear-gradient(top, #080808 0%, #0f0f0f 100%);
-  background-image:      -o-linear-gradient(top, #080808 0%, #0f0f0f 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#080808), to(#0f0f0f));
-  background-image:         linear-gradient(to bottom, #080808 0%, #0f0f0f 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);
-  background-repeat: repeat-x;
-  -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25);
-          box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25);
-}
-.navbar-inverse .navbar-brand,
-.navbar-inverse .navbar-nav > li > a {
-  text-shadow: 0 -1px 0 rgba(0, 0, 0, .25);
-}
-.navbar-static-top,
-.navbar-fixed-top,
-.navbar-fixed-bottom {
-  border-radius: 0;
-}
-.alert {
-  text-shadow: 0 1px 0 rgba(255, 255, 255, .2);
-  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05);
-          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05);
-}
-.alert-success {
-  background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
-  background-image:      -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#c8e5bc));
-  background-image:         linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);
-  background-repeat: repeat-x;
-  border-color: #b2dba1;
-}
-.alert-info {
-  background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
-  background-image:      -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#b9def0));
-  background-image:         linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);
-  background-repeat: repeat-x;
-  border-color: #9acfea;
-}
-.alert-warning {
-  background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
-  background-image:      -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#f8efc0));
-  background-image:         linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);
-  background-repeat: repeat-x;
-  border-color: #f5e79e;
-}
-.alert-danger {
-  background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
-  background-image:      -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#e7c3c3));
-  background-image:         linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);
-  background-repeat: repeat-x;
-  border-color: #dca7a7;
-}
-.progress {
-  background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
-  background-image:      -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#f5f5f5));
-  background-image:         linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);
-  background-repeat: repeat-x;
-}
-.progress-bar {
-  background-image: -webkit-linear-gradient(top, #428bca 0%, #3071a9 100%);
-  background-image:      -o-linear-gradient(top, #428bca 0%, #3071a9 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#3071a9));
-  background-image:         linear-gradient(to bottom, #428bca 0%, #3071a9 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0);
-  background-repeat: repeat-x;
-}
-.progress-bar-success {
-  background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%);
-  background-image:      -o-linear-gradient(top, #5cb85c 0%, #449d44 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#449d44));
-  background-image:         linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);
-  background-repeat: repeat-x;
-}
-.progress-bar-info {
-  background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
-  background-image:      -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#31b0d5));
-  background-image:         linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);
-  background-repeat: repeat-x;
-}
-.progress-bar-warning {
-  background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
-  background-image:      -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#ec971f));
-  background-image:         linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);
-  background-repeat: repeat-x;
-}
-.progress-bar-danger {
-  background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%);
-  background-image:      -o-linear-gradient(top, #d9534f 0%, #c9302c 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c9302c));
-  background-image:         linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);
-  background-repeat: repeat-x;
-}
-.progress-bar-striped {
-  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:      -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:         linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-}
-.list-group {
-  border-radius: 4px;
-  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
-          box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
-}
-.list-group-item.active,
-.list-group-item.active:hover,
-.list-group-item.active:focus {
-  text-shadow: 0 -1px 0 #3071a9;
-  background-image: -webkit-linear-gradient(top, #428bca 0%, #3278b3 100%);
-  background-image:      -o-linear-gradient(top, #428bca 0%, #3278b3 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#3278b3));
-  background-image:         linear-gradient(to bottom, #428bca 0%, #3278b3 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0);
-  background-repeat: repeat-x;
-  border-color: #3278b3;
-}
-.list-group-item.active .badge,
-.list-group-item.active:hover .badge,
-.list-group-item.active:focus .badge {
-  text-shadow: none;
-}
-.panel {
-  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
-          box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
-}
-.panel-default > .panel-heading {
-  background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
-  background-image:      -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8));
-  background-image:         linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
-  background-repeat: repeat-x;
-}
-.panel-primary > .panel-heading {
-  background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%);
-  background-image:      -o-linear-gradient(top, #428bca 0%, #357ebd 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#357ebd));
-  background-image:         linear-gradient(to bottom, #428bca 0%, #357ebd 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);
-  background-repeat: repeat-x;
-}
-.panel-success > .panel-heading {
-  background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
-  background-image:      -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#d0e9c6));
-  background-image:         linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);
-  background-repeat: repeat-x;
-}
-.panel-info > .panel-heading {
-  background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
-  background-image:      -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#c4e3f3));
-  background-image:         linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);
-  background-repeat: repeat-x;
-}
-.panel-warning > .panel-heading {
-  background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
-  background-image:      -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#faf2cc));
-  background-image:         linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);
-  background-repeat: repeat-x;
-}
-.panel-danger > .panel-heading {
-  background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
-  background-image:      -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#ebcccc));
-  background-image:         linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);
-  background-repeat: repeat-x;
-}
-.well {
-  background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
-  background-image:      -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#f5f5f5));
-  background-image:         linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);
-  background-repeat: repeat-x;
-  border-color: #dcdcdc;
-  -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1);
-          box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1);
-}
-/*# sourceMappingURL=bootstrap-theme.css.map */

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 1
sources/public/bootstrap/css/bootstrap-theme.css.map


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 5
sources/public/bootstrap/css/bootstrap-theme.min.css


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 6358
sources/public/bootstrap/css/bootstrap.css


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 1
sources/public/bootstrap/css/bootstrap.css.map


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 5
sources/public/bootstrap/css/bootstrap.min.css


BIN
sources/public/bootstrap/fonts/glyphicons-halflings-regular.eot


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 229
sources/public/bootstrap/fonts/glyphicons-halflings-regular.svg


BIN
sources/public/bootstrap/fonts/glyphicons-halflings-regular.ttf


BIN
sources/public/bootstrap/fonts/glyphicons-halflings-regular.woff


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 2276
sources/public/bootstrap/js/bootstrap.js


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 7
sources/public/bootstrap/js/bootstrap.min.js


+ 0 - 13
sources/public/bootstrap/js/npm.js

@@ -1,13 +0,0 @@
-// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
-require('../../js/transition.js')
-require('../../js/alert.js')
-require('../../js/button.js')
-require('../../js/carousel.js')
-require('../../js/collapse.js')
-require('../../js/dropdown.js')
-require('../../js/modal.js')
-require('../../js/tooltip.js')
-require('../../js/popover.js')
-require('../../js/scrollspy.js')
-require('../../js/tab.js')
-require('../../js/affix.js')

+ 0 - 28
sources/public/css/bootstrap-toggle.min.css

@@ -1,28 +0,0 @@
-/*! ========================================================================
- * Bootstrap Toggle: bootstrap-toggle.css v2.0.0
- * http://www.bootstraptoggle.com
- * ========================================================================
- * Copyright 2014 Min Hur, The New York Times Company
- * Licensed under MIT
- * ======================================================================== */
-.checkbox label .toggle,.checkbox-inline .toggle{margin-left:-20px;margin-right:5px}
-.toggle{position:relative;overflow:hidden}
-.toggle input[type=checkbox]{display:none}
-.toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none}
-.toggle.off .toggle-group{left:-100%}
-.toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0}
-.toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0}
-.toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px}
-.toggle.btn{min-width:59px;min-height:34px}
-.toggle-on.btn{padding-right:24px}
-.toggle-off.btn{padding-left:24px}
-.toggle.btn-lg{min-width:79px;min-height:45px}
-.toggle-on.btn-lg{padding-right:31px}
-.toggle-off.btn-lg{padding-left:31px}
-.toggle-handle.btn-lg{width:40px}
-.toggle.btn-sm{min-width:50px;min-height:30px}
-.toggle-on.btn-sm{padding-right:20px}
-.toggle-off.btn-sm{padding-left:20px}
-.toggle.btn-xs{min-width:35px;min-height:22px}
-.toggle-on.btn-xs{padding-right:12px}
-.toggle-off.btn-xs{padding-left:12px}

+ 0 - 107
sources/public/css/style.css

@@ -1,107 +0,0 @@
-/* VPN Client app for YunoHost 
- * Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
- * Contribute at https://github.com/labriqueinternet/vpnclient_ynh
- * 
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- * 
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-li.status-info {
-  color: #5BC0DE;
-}
-
-li.status-warning {
-  color: #D9534F;
-}
-
-li.status-danger, div#raw_openvpn_panel {
-  color: #D9534F;
-}
-
-li.status-success {
-  color: #5CB85C;
-}
-
-img#status-loading {
-  display: none;
-  margin-right: 5px;
-}
-
-img#save-loading {
-  display: none;
-  margin-left: 5px;
-}
-
-div#status {
-  display: none;
-  margin-top: 10px;
-}
-
-div#status ul {
-  list-style-type: none;
-  padding: 0;
-  margin: 0;
-}
-
-a.btn-danger span {
-  color: #eee;
-}
-
-a.btn-danger:hover span {
-  color: #fff;
-}
-
-a.not-allowed {
-  cursor: not-allowed;
-}
-
-input.allowed {
-  cursor: default;
-}
-
-a.btn-disabled, a.btn-disabled:hover, a.btn-disabled:active {
-  background-color: #999;
-  background-image: none;
-  border-color: #888;
-}
-
-a.btn-disabled:hover span {
-  color: #eee;
-}
-
-div#github {
-  margin: -10px 0 20px 20px;
-  background: url(../img/github.png) no-repeat 0 4px;
-}
-
-div#github a {
-  margin-left: 17px;
-}
-
-div#raw_openvpn_panel {
-  display: none;
-}
-
-textarea#raw_openvpn {
-  height: 300px;
-  border: 1px solid #D9534F;
-}
-
-ul.nav {
-  margin-top: 30px;
-  margin-bottom: 20px;
-}
-
-ul.nav a {
-  outline: none;
-}

BIN
sources/public/img/github.png


BIN
sources/public/img/loading.gif


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 4
sources/public/jquery/jquery-2.1.1.min.js


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 9
sources/public/js/bootstrap-toggle.min.js


+ 0 - 133
sources/public/js/custom.js

@@ -1,133 +0,0 @@
-/* VPN Client app for YunoHost 
- * Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
- * Contribute at https://github.com/labriqueinternet/vpnclient_ynh
- * 
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- * 
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-function tabsClick() {
-  var tab = $(this).parent().attr('data-tab');
-
-  $('.nav').find('li.active').removeClass('active');
-  $(this).parent().addClass('active');
-
-  $('.tabs').hide();
-  $('.tab' + tab).show();
-
-  return false;
-}
-
-function ready() {
-  $('.btn-group').button();
-  $('[data-toggle="tooltip"]').tooltip();
-
-  $('.switch').bootstrapToggle();
-  $('.nav-tabs a').click(tabsClick);
-
-  $('.fileinput').click(function() {
-    if(!$(this).hasClass('btn-danger')) {
-      var realinputid = '#' + $(this).attr('id').replace(/_chooser.*/, '');
-
-      $(realinputid).click();
-    }
-  });
-
-  $('.deletefile').click(function() {
-    var chooserbtnid = '#' + $(this).attr('id').replace(/_deletebtn$/, '_chooserbtn');
-    var choosertxtid = '#' + $(this).attr('id').replace(/_deletebtn$/, '_choosertxt');
-    var fileinputid = '#' + $(this).attr('id').replace(/_deletebtn$/, '');
-    var deleteinputid = '#' + $(this).attr('id').replace(/btn$/, '');
-
-    $(deleteinputid).click();
-    $(chooserbtnid).toggleClass('btn-danger');
-    $(chooserbtnid).toggleClass('not-allowed');
-    $(choosertxtid).toggleClass('btn-danger');
-    $(choosertxtid).val($(choosertxtid).hasClass('btn-danger') ? 'Removal requested' : '');
-    $(fileinputid).val('');
-
-    if($(this).attr('id').search('_key') >= 0) {
-      if($(choosertxtid).hasClass('btn-danger') != $('#crt_client_choosertxt').hasClass('btn-danger')) {
-        $('#crt_client_deletebtn').click();
-      }
-    } else if($(this).attr('id').search('_ta') < 0) {
-      if($(choosertxtid).hasClass('btn-danger') != $('#crt_client_key_choosertxt').hasClass('btn-danger')) {
-        $('#crt_client_key_deletebtn').click();
-      }
-    }
-  });
-
-  $('input[type="file"]').change(function() {
-    var choosertxtid = '#' + $(this).attr('id') + '_choosertxt';
-
-    $(choosertxtid).val($(this).val().replace(/^.*[\/\\]/, ''));
-  });
-
-  $('#form').on("submit", function(event) {
-    event.preventDefault()
-    $('#save').prop('disabled', true);
-    $('#save-loading').show();
-    $.ajax({
-        url: this.action,
-        type: this.method,
-        contentType: false,
-        processData: false,
-        cache: false,
-        data: new FormData(this),
-        headers: {
-          'X-Requested-With': 'jQuery',
-        },
-        timeout: 5000,
-        dataType: "html",
-        // success: function() {}, // XXX will never happen because the VPN connection will be restarted after the form is posted.
-        complete: function() {
-          console.log("Forcing page reload after a few seconds...");
-          setTimeout(function() {document.location.reload();}, 45000)
-        },
-    });
-  })
-
-  $('#status .close').click(function() {
-    $(this).parent().hide();
-  });
-
-  $('#statusbtn').click(function() {
-    if($('#status-loading').is(':hidden')) {
-      $('#status').hide();
-      $('#status-loading').show();
-
-      $.ajax({
-        url: '?/status',
-      }).done(function(data) {
-        $('#status-loading').hide();
-        $('#status-text').html('<ul>' + data + '</ul>');
-        $('#status').show('slow');
-      });
-    }
-  });
-
-  $('#raw_openvpn_btn').click(function() {
-    $('#raw_openvpn_btnpanel').hide();
-    $('#raw_openvpn_panel').show('low');
-  });
-
-  $('#service_enabled').change(function() {
-    if($('#service_enabled').parent().hasClass('off')) {
-      $('.enabled').hide('slow');
-    } else {
-      $('.enabled').show('slow');
-    }
-  });
-}
-
-$(document).ready(ready)

+ 0 - 70
sources/views/layout.html.php

@@ -1,70 +0,0 @@
-<!doctype html>
-
-<!--
-  VPN Client app for YunoHost 
-  Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
-  Contribute at https://github.com/labriqueinternet/vpnclient_ynh
-  
-  This program is free software: you can redistribute it and/or modify
-  it under the terms of the GNU Affero General Public License as published by
-  the Free Software Foundation, either version 3 of the License, or
-  (at your option) any later version.
-  
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU Affero General Public License for more details.
-  
-  You should have received a copy of the GNU Affero General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
--->
-
-<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
-<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
-<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
-<!--[if gt IE 8]><!--> <html class="no-js" lang="<?= $locale ?>"> <!--<![endif]-->
-<head>
-  <title><?= _("VPN Client") ?><?= isset($title) ? " | $title" : '' ?></title>
-
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width">
-  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-
-  <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">
-  <link media="all" type="text/css" href="<?= PUBLIC_DIR ?>/css/bootstrap-toggle.min.css" rel="stylesheet">
-  <link media="all" type="text/css" href="<?= PUBLIC_DIR ?>/css/style.css" rel="stylesheet">
-
-  <script src="<?= PUBLIC_DIR ?>/jquery/jquery-2.1.1.min.js"></script>
-  <script src="<?= PUBLIC_DIR ?>/bootstrap/js/bootstrap.min.js"></script>
-  <script src="<?= PUBLIC_DIR ?>/js/bootstrap-toggle.min.js"></script>
-  <script src="<?= PUBLIC_DIR ?>/js/custom.js"></script>
-</head>
-
-<body>
-  <div class="container">
-    <?php if(isset($flash['error'])): ?>
-      <div class="alert alert-dismissible alert-danger fade in" style="margin-top: 20px" role="alert">
-        <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-        <strong><?= _('Error') ?>:</strong> <?= $flash['error'] ?><!-- RETURN_MSG -->
-      </div>
-    <?php elseif(isset($flash['notice'])): ?>
-      <div class="alert alert-dismissible alert-info fade in" style="margin-top: 20px" role="alert">
-        <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-        <strong><?= _('Notice') ?>:</strong> <?= $flash['notice'] ?><!-- RETURN_MSG -->
-      </div>
-    <?php elseif(isset($flash['success'])): ?>
-      <div class="alert alert-dismissible alert-success fade in" style="margin-top: 20px" role="alert">
-        <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-        <?= $flash['success'] ?><!-- RETURN_MSG -->
-      </div>
-    <?php endif; ?>
-
-    <?= $content ?>
-
-    <hr />
-    <div id="github"><a href="https://github.com/labriqueinternet/vpnclient_ynh"><?= _('Any problem? Contribute!') ?></a> - AGPL 3.0</div>
-  </div>
-</body>
-
-</html>

+ 0 - 260
sources/views/settings.html.php

@@ -1,260 +0,0 @@
-<!--
-  VPN Client app for YunoHost 
-  Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
-  Contribute at https://github.com/labriqueinternet/vpnclient_ynh
-  
-  This program is free software: you can redistribute it and/or modify
-  it under the terms of the GNU Affero General Public License as published by
-  the Free Software Foundation, either version 3 of the License, or
-  (at your option) any later version.
-  
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU Affero General Public License for more details.
-  
-  You should have received a copy of the GNU Affero General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
--->
-
-<h2><?= _("VPN Client Configuration") ?></h2>
-<?php if($faststatus): ?>
-  <span class="label label-success" data-toggle="tooltip" data-title="<?= _('This is a fast status. Click on More details to show the complete status.') ?>"><?= _('Running') ?></span>
-<?php else: ?>
-  <span class="label label-danger" data-toggle="tooltip" data-title="<?= _('This is a fast status. Click on More details to show the complete status.') ?>"><?= _('Not Running') ?></span>
-<?php endif; ?>
-
- &nbsp; <img src="public/img/loading.gif" id="status-loading" alt="Loading..." /><a href="#" id="statusbtn" data-toggle="tooltip" data-title="<?= _('Loading complete status may take a few minutes. Be patient.') ?>"><?= _('More details') ?></a>
-
-<div id="status" class="alert alert-dismissible alert-info fade in" style="margin-top: 10px" role="alert">
-  <button type="button" class="close"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-  <div id="status-text"></div>
-</div>
-
-<hr />
-
-<div class="row">
-  <div class="col-sm-offset-2 col-sm-8">
-    <form method="post" enctype="multipart/form-data" action="?/settings" class="form-horizontal" role="form" id="form">
-      <input type="hidden" name="_method" value="put" />
-
-      <div class="panel panel-default">
-        <div class="panel-heading">
-          <h3 class="panel-title"><?= _("Service") ?></h3>
-        </div>
-
-        <div style="padding: 14px 14px 0 10px">
-          <div class="form-group">
-            <label for="service_enabled" class="col-sm-3 control-label"><?= _('VPN Enabled') ?></label>
-            <div class="col-sm-9 input-group-btn">
-              <div class="input-group">
-                <input type="checkbox" class="form-control switch" name="service_enabled" id="service_enabled" value="1" <?= $service_enabled == 1 ? 'checked="checked"' : '' ?> />
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
-
-      <div class="enabled" <?= $service_enabled == 0 ? 'style="display: none"' : '' ?>>
-        <ul class="nav nav-tabs nav-justified">
-          <li role="presentation" data-tab="manualconfig" class="active"><a href="#"><?= _("Manual") ?></a></li>
-          <li role="presentation" data-tab="autoconfig"><a href="#"><?= _("Automatic") ?></a></li>
-        </ul>
-
-        <div class="tabs tabmanualconfig">
-          <div class="panel panel-default">
-            <div class="panel-heading">
-              <h3 class="panel-title"><?= _("VPN") ?></h3>
-            </div>
-
-            <div style="padding: 14px 14px 0 10px">
-              <div class="form-group">
-                <label for="server_name" class="col-sm-3 control-label"><?= _('Server Address') ?></label>
-                <div class="col-sm-9">
-                  <input type="text" class="form-control" name="server_name" id="server_name" placeholder="vpn.example.net" value="<?= $server_name ?>" />
-                </div>
-              </div>
-    
-              <div class="form-group">
-                <label for="server_port" class="col-sm-3 control-label"><?= _('Server Port') ?></label>
-                <div class="col-sm-9">
-                  <input type="text" data-toggle="tooltip" data-title="<?= _('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 ?>" />
-                </div>
-              </div>
-    
-              <div class="form-group">
-                <label for="server_proto" class="col-sm-3 control-label"><?= _('Protocol') ?></label>
-                <div class="btn-group col-sm-9" data-toggle="buttons">
-                  <label class="btn btn-default <?= $server_proto == 'udp' ? 'active' : '' ?>">
-                    <input type="radio" name="server_proto" value="udp" <?= $server_proto == 'udp' ? 'checked="cheked"' : '' ?> /> <?= _('UDP') ?>
-                  </label>
-    
-                  <label class="btn btn-default <?= $server_proto == 'tcp' ? 'active' : '' ?>" data-toggle="tooltip" data-title="<?= _('UDP is more efficient than TCP (but more filtered in case of restrictive access)') ?>">
-                    <input type="radio" name="server_proto" value="tcp" <?= $server_proto == 'tcp' ? 'checked="cheked"' : '' ?> /> <?= _('TCP') ?>
-                  </label>
-                </div>
-              </div>
-
-              <div class="form-group">
-                <label for="ip6_net" class="col-sm-3 control-label"><?= _('Delegated prefix (IPv6)') ?></label>
-                <div class="col-sm-9">
-                  <input type="text" data-toggle="tooltip" data-title="<?= _('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 ?>" />
-                </div>
-              </div>
-
-              <div class="form-group" id="raw_openvpn_btnpanel">
-                <label class="col-sm-3 control-label"></label>
-                <div class="col-sm-9">
-                  <span class="glyphicon glyphicon-cog"></span> <a href="javascript:" id="raw_openvpn_btn" data-toggle="tooltip" data-title="<?= _('Edit the raw configuration only if you know what you do!') ?>"><?= _('Advanced') ?></a>
-                </div>
-              </div>
-
-              <div class="form-group" id="raw_openvpn_panel">
-                <label for="raw_openvpn" class="col-sm-3 control-label"><?= _('Advanced') ?></label>
-                <div class="col-sm-9">
-                  <pre><textarea class="form-control" name="raw_openvpn" id="raw_openvpn"><?= $raw_openvpn ?></textarea></pre>
-                </div>
-              </div>
-            </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><?= _('Notice') ?>:</strong> <?= _("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"><?= _("Authentication") ?></h3>
-            </div>
-
-            <div style="padding: 14px 14px 0 10px">
-              <div class="form-group">
-                <?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><?= _('Notice') ?>:</strong> <?= _("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 ? _('Update Server CA') : _('Upload Server CA') ?></label>
-                <div class="input-group col-sm-9" style="padding: 0 15px">
-                  <?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="<?= _('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" />
-                  <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="<?= _('Browse') ?>"><span class="glyphicon glyphicon-search"></span></a>
-                </div>
-              </div>
-
-              <div class="form-group">
-                <label for="crt_client" class="col-sm-3 control-label"><?= $crt_client_exists ? _('Update Client Cert.') : _('Upload Client Cert.') ?></label>
-                <div class="input-group col-sm-9" style="padding: 0 15px">
-                  <?php if($crt_client_exists): ?>
-                    <a class="btn btn-danger input-group-addon deletefile" id="crt_client_deletebtn" data-toggle="tooltip" data-title="<?= _('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" />
-                  <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="<?= _('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"><?= $crt_client_key_exists ? _('Update Client Key') : _('Upload Client Key') ?></label>
-                <div class="input-group col-sm-9" style="padding: 0 15px">
-                  <?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="<?= _('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" data-toggle="tooltip" data-title="<?= _('Make sure your browser is able to read the key file before uploading') ?>" placeholder="-----BEGIN PRIVATE KEY-----" readonly="readonly" />
-                  <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="<?= _('Browse') ?> (<?= _('make sure your browser is able to read the key file before uploading') ?>)"><span class="glyphicon glyphicon-search"></span></a>
-                </div>
-              </div>
-
-              <div class="form-group">
-                <label for="crt_client_ta" class="col-sm-3 control-label"><?= $crt_client_ta_exists ? _('Update Shared-Secret') : _('Upload Shared-Secret') ?></label>
-                <div class="input-group col-sm-9" style="padding: 0 15px">
-                  <?php if($crt_client_ta_exists): ?>
-                    <a class="btn btn-danger input-group-addon deletefile" id="crt_client_ta_deletebtn" data-toggle="tooltip" data-title="<?= _('Delete this certificate') ?>"><span class="glyphicon glyphicon-remove"></span></a>
-                    <input id="crt_client_ta_delete" name="crt_client_ta_delete" type="checkbox" value="1" style="display: none" />
-                  <?php endif; ?>
-                  <input type="text" class="form-control fileinput" id="crt_client_ta_choosertxt" data-toggle="tooltip" data-title="<?= _('Make sure your browser is able to read the key file before uploading') ?>" placeholder="ta.key" readonly="readonly" />
-                  <input id="crt_client_ta" name="crt_client_ta" type="file" style="display: none" />
-                  <a class="btn input-group-addon fileinput" id="crt_client_ta_chooserbtn" data-toggle="tooltip" data-title="<?= _('Browse') ?> (<?= _('make sure your browser is able to read the key file before uploading') ?>)"><span class="glyphicon glyphicon-search"></span></a>
-                </div>
-              </div>
-
-              <div class="form-group">
-                <label for="login_user" class="col-sm-3 control-label"><?= _('Username') ?></label>
-                <div class="col-sm-9">
-                  <input type="text" data-toggle="tooltip" data-title="<?= _('Leave empty if not necessary') ?>" class="form-control" name="login_user" id="login_user" placeholder="michu" value="<?= $login_user ?>" />
-                </div>
-              </div>
-
-              <div class="form-group">
-                <label for="login_passphrase" class="col-sm-3 control-label"><?= _('Password') ?></label>
-                <div class="col-sm-9">
-                  <input type="password" data-toggle="tooltip" data-title="<?= _('Leave empty if not necessary') ?>" class="form-control" name="login_passphrase" id="login_passphrase" placeholder="XVCwSbDkxnqQ" value="<?= $login_passphrase ?>" />
-                </div>
-              </div>
-            </div>
-          </div>
-
-          <div class="panel panel-default">
-            <div class="panel-heading">
-              <h3 class="panel-title"><?= _("DNS") ?></h3>
-            </div>
-
-            <div style="padding: 14px 14px 0 10px">
-              <div class="form-group">
-                <label for="dns0" class="col-sm-3 control-label"><?= _('First resolver') ?></label>
-                <div class="col-sm-9">
-                  <input type="text" data-toggle="tooltip" data-title="<?= _('IPv6 or IPv4') ?>" class="form-control" name="dns0" id="dns0" placeholder="89.234.141.66" value="<?= $dns0 ?>" />
-                </div>
-              </div>
-
-              <div class="form-group">
-                <label for="dns1" class="col-sm-3 control-label"><?= _('Second resolver') ?></label>
-                <div class="col-sm-9">
-                  <input type="text" data-toggle="tooltip" data-title="<?= _('IPv6 or IPv4') ?>" class="form-control" name="dns1" id="dns1" placeholder="2001:913::8" value="<?= $dns1 ?>" />
-                </div>
-              </div>
-            </div>
-          </div>
-        </div>
-
-        <div class="tabs tabautoconfig" style="display: none">
-          <div class="panel panel-default">
-            <div class="panel-heading">
-              <h3 class="panel-title"><?= _("Auto Configuration") ?></h3>
-            </div>
-
-            <div style="padding: 14px 14px 0 10px">
-              <div class="form-group">
-                <label for="cubefile" class="col-sm-3 control-label"><?= _('Upload Config') ?></label>
-                <div class="input-group col-sm-9" style="padding: 0 15px">
-                  <input type="text" class="form-control fileinput" id="cubefile_choosertxt" placeholder="config.cube" readonly="readonly" />
-                  <input id="cubefile" name="cubefile" type="file" style="display: none" />
-                  <a class="btn input-group-addon fileinput" id="cubefile_chooserbtn" data-toggle="tooltip" data-title="<?= _('Browse') ?>"><span class="glyphicon glyphicon-search"></span></a>
-                </div>
-              </div>
-              <p style="text-align: center"><a href="http://internetcu.be/dotcubefiles.html"><?= _('What is a dot cube file?') ?></a></p>
-            </div>
-          </div>
-        </div>
-      </div>
-
-      <div class="form-group">
-        <div style="text-align: center">
-          <button type="submit" class="btn btn-default" data-toggle="tooltip" id="save" data-title="<?= _('Reloading may take a few minutes. Be patient.') ?>"><?= _('Save and reload') ?></button> <img src="public/img/loading.gif" id="save-loading" alt="Loading..." />
-        </div>
-      </div>
-    </form>
-  </div>
-</div>