From 6a39d6fc8bdbf70ba9f0859d1d5b81fc423ad4e2 Mon Sep 17 00:00:00 2001 From: Julien VAUBOURG Date: Thu, 20 Nov 2014 20:03:24 +0100 Subject: [PATCH] Add security on More details action --- TODO | 2 -- conf/init_ynh-hotspot | 5 ++++- scripts/install | 2 +- sources/controller.php | 10 +++++----- sources/public/js/custom.js | 19 +++++++++++-------- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/TODO b/TODO index dafb0c1..1c5d23a 100644 --- a/TODO +++ b/TODO @@ -1,3 +1 @@ * Translate PHP interface in French -* Add "More details" security (just one click) -* Add more [INFO] in status with autodetected variables diff --git a/conf/init_ynh-hotspot b/conf/init_ynh-hotspot index a3988dd..b4debba 100644 --- a/conf/init_ynh-hotspot +++ b/conf/init_ynh-hotspot @@ -383,9 +383,12 @@ case "$1" in ;; status) exitcode=0 - + + echo "[INFO] Autodetected internet interface: ${new_internet_device} (last start: ${old_internet_device})" + if has_ip6delegatedprefix; then echo "[INFO] IPv6 delegated prefix found" + echo "[INFO] IPv6 address computed from the delegated prefix: ${ynh_ip6_addr}" if is_ndproxy_set; then echo "[OK] NDP proxy set" diff --git a/scripts/install b/scripts/install index 470d332..b638c43 100644 --- a/scripts/install +++ b/scripts/install @@ -127,7 +127,7 @@ sudo sed 's|^;\?\s*max_execution_time.\+|max_execution_time = 600|' -i /etc/php5 sudo sed "s||${url_path}|g" -i /var/www/wifiadmin/config.php # Copy init script -sudo install -b -o root -g root -m 0755 ../conf/init_ynh-hotspot /etc/init.d/ynh-hotspot +sudo install -o root -g root -m 0755 ../conf/init_ynh-hotspot /etc/init.d/ynh-hotspot # Set default inits # The boot order of these services are important, so they are disabled by default diff --git a/sources/controller.php b/sources/controller.php index bf1afe7..f6b130b 100644 --- a/sources/controller.php +++ b/sources/controller.php @@ -147,7 +147,7 @@ dispatch_put('/settings', function() { } } catch(Exception $e) { - flash('error', $e->getMessage().T_(' (configuration not updated).')); + flash('error', $e->getMessage().' ('.T_('configuration not updated').').'); goto redirect; } @@ -184,16 +184,16 @@ dispatch('/status', function() { foreach($status_lines AS $status_line) { if(preg_match('/^\[INFO\]/', $status_line)) { - $status_list .= "
  • ${status_line}
  • "; + $status_list .= '
  • '.htmlspecialchars($status_line).'
  • '; } elseif(preg_match('/^\[OK\]/', $status_line)) { - $status_list .= "
  • ${status_line}
  • "; + $status_list .= '
  • '.htmlspecialchars($status_line).'
  • '; } elseif(preg_match('/^\[WARN\]/', $status_line)) { - $status_list .= "
  • ${status_line}
  • "; + $status_list .= '
  • '.htmlspecialchars($status_line).'
  • '; } elseif(preg_match('/^\[ERR\]/', $status_line)) { - $status_list .= "
  • ${status_line}
  • "; + $status_list .= '
  • '.htmlspecialchars($status_line).'
  • '; } } diff --git a/sources/public/js/custom.js b/sources/public/js/custom.js index 29242cf..6b220eb 100644 --- a/sources/public/js/custom.js +++ b/sources/public/js/custom.js @@ -39,14 +39,17 @@ $(document).ready(function() { }); $('#statusbtn').click(function() { - $('#status-loading').show(); + if($('#status-loading').is(':hidden')) { + $('#status').hide(); + $('#status-loading').show(); - $.ajax({ - url: '?/status', - }).done(function(data) { - $('#status-loading').hide(); - $('#status-text').html(''); - $('#status').show('slow'); - }); + $.ajax({ + url: '?/status', + }).done(function(data) { + $('#status-loading').hide(); + $('#status-text').html(''); + $('#status').show('slow'); + }); + } }); });