From 656261727b9354fa9ecb46382888873e6eceb3a3 Mon Sep 17 00:00:00 2001 From: Guillaume Mazoyer Date: Mon, 17 Nov 2014 11:21:36 +0100 Subject: Code format. Always use () for functions. --- auth/authentication.php | 4 +- auth/ssh.php | 6 +- auth/telnet.php | 2 +- execute.php | 10 +- includes/utils.php | 2 +- index.php | 240 ++++++++++++++++++++++++------------------------ routers/bird.php | 4 +- routers/cisco.php | 4 +- routers/juniper.php | 4 +- routers/quagga.php | 4 +- routers/router.php | 18 ++-- 11 files changed, 148 insertions(+), 150 deletions(-) diff --git a/auth/authentication.php b/auth/authentication.php index 8ff8d97..6e03271 100644 --- a/auth/authentication.php +++ b/auth/authentication.php @@ -21,8 +21,8 @@ ini_set('include_path', ini_get('include_path').':./libs/phpseclib-0.3.7'); -require_once 'ssh.php'; -require_once 'telnet.php'; +require_once('ssh.php'); +require_once('telnet.php'); /** * This class needs to be extended by every class implementing an diff --git a/auth/ssh.php b/auth/ssh.php index 5fdd489..d8d56a1 100644 --- a/auth/ssh.php +++ b/auth/ssh.php @@ -19,9 +19,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -require_once 'Crypt/RSA.php'; -require_once 'Net/SSH2.php'; -require_once 'authentication.php'; +require_once('Crypt/RSA.php'); +require_once('Net/SSH2.php'); +require_once('authentication.php'); final class SSH extends Authentication { private $port; diff --git a/auth/telnet.php b/auth/telnet.php index 40a8822..2f3465d 100644 --- a/auth/telnet.php +++ b/auth/telnet.php @@ -19,7 +19,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -require_once 'authentication.php'; +require_once('authentication.php'); final class Telnet extends Authentication { private $port; diff --git a/execute.php b/execute.php index 18c5051..a1da942 100644 --- a/execute.php +++ b/execute.php @@ -19,9 +19,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -require_once 'includes/config.defaults.php'; -require_once 'config.php'; -require_once 'routers/router.php'; +require_once('includes/config.defaults.php'); +require_once('config.php'); +require_once('routers/router.php'); // From where the user *really* comes from. if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { @@ -39,7 +39,7 @@ if (!isset($_POST['dontlook']) || !empty($_POST['dontlook'])) { // Just asked for the documentation if (isset($_POST['doc']) && !empty($_POST['doc'])) { $query = htmlspecialchars($_POST['doc']); - print json_encode($config['doc'][$query]); + print(json_encode($config['doc'][$query])); } if (isset($_POST['query']) && !empty($_POST['query']) && @@ -66,7 +66,7 @@ if (isset($_POST['query']) && !empty($_POST['query']) && $data = array('error' => $error); } - print json_encode($data); + print(json_encode($data)); } // End of execute.php diff --git a/includes/utils.php b/includes/utils.php index ebbea2c..828832f 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -19,7 +19,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -require_once 'config.php'; +require_once('config.php'); /** * Test if a given parameter is a private IPv4 or IPv6. diff --git a/index.php b/index.php index b30591b..f28bfd4 100644 --- a/index.php +++ b/index.php @@ -19,8 +19,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -require_once 'includes/config.defaults.php'; -require_once 'config.php'; +require_once('includes/config.defaults.php'); +require_once('config.php'); final class LookingGlass { private $frontpage; @@ -36,85 +36,84 @@ final class LookingGlass { } private function render_routers() { - print '
'; - print ''; - print ''); $first = true; foreach (array_keys($this->routers) as $router) { if ($first) { $first = false; - print ''; + print(''); } else { - print ''; + print(''); } } - print ''; - print '
'; + print(''); + print(''); } private function render_commands() { - print '
'; - print ''; - print ''; - print '
'; + print('
'); + print(''); + print(''); + print('
'); } private function render_parameters() { - print '
'; - print ''; - print '
'; - print ''; - print '
'; - print ''; - print '
'; - print '
'; - print '
'; + print('
'); + print(''); + print('
'); + print(''); + print('
'); + print(''); + print('
'); + print('
'); + print('
'); } private function render_buttons() { - print '
'; - print '
'; - print ''; - print '
'; - print '
'; - print ''; - print '
'; - print '
'; + print('
'); + print('
'); + print(''); + print('
'); + print('
'); + print(''); + print('
'); + print('
'); } private function render_header() { - print ''; - print '
'; + print(''); + print('
'); if ($this->frontpage['show_title']) { - print '

'.htmlentities($this->frontpage['title']).'


'; + print('

'.htmlentities($this->frontpage['title']).'


'); } if (isset($this->frontpage['image'])) { - print 'logo'; + print('logo'); } - print '
'; - print '
'; + print('
'); + print(''); } private function render_content() { - print '
'; - print ''; - print 'Error! '; - print '
'; - print '
'; - print '
'; - print '
'; + print('
'); + print(''); + print('Error! '); + print('
'); + print('
'); + print(''); foreach ($this->frontpage['order'] as $element) { switch ($element) { @@ -139,104 +138,103 @@ final class LookingGlass { } } - print ''; - print '
'; - print '
'; - print '
'; - print '
'; - print '
'; - print '
'; - print '
'; - print '
'; - print '
'; - print '
'; - print '
'; - print '
'; - print ''; - print '
'; - print '
'; + print(''); + print(''); + print(''); + print('
'); + print('
'); + print('
'); + print('
'); + print('
'); + print('
'); + print('
'); + print('
'); + print('
'); + print(''); + print('
'); + print('
'); } private function render_footer() { - print ''); } private function render_help_modal() { - print ''; + print(''); } public function render() { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''.htmlentities($this->frontpage['title']).''; - print ''; + print(''); + print(''); + print(''); + print(''); + print(''); + print(''); + print(''); + print(''); + print(''.htmlentities($this->frontpage['title']).''); + print(''); if ($this->frontpage['bootstrap_theme']) { - print ''; + print(''); } if ($this->frontpage['custom_bootstrap_theme']) { - print ''; + print(''); } - print ''; - print ''; - print ''; + print(''); + print(''); + print(''); $this->render_header(); $this->render_content(); $this->render_footer(); $this->render_help_modal(); - print ''; - print ''; - print ''; - print ''; - print ''; + print(''); + print(''); + print(''); + print(''); + print(''); } } diff --git a/routers/bird.php b/routers/bird.php index 25d7544..b86315b 100644 --- a/routers/bird.php +++ b/routers/bird.php @@ -19,8 +19,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -require_once 'router.php'; -require_once 'includes/utils.php'; +require_once('router.php'); +require_once('includes/utils.php'); final class Bird extends Router { protected function build_commands($command, $parameters) { diff --git a/routers/cisco.php b/routers/cisco.php index 304cb56..bc34653 100644 --- a/routers/cisco.php +++ b/routers/cisco.php @@ -19,8 +19,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -require_once 'router.php'; -require_once 'includes/utils.php'; +require_once('router.php'); +require_once('includes/utils.php'); final class Cisco extends Router { protected function build_commands($command, $parameters) { diff --git a/routers/juniper.php b/routers/juniper.php index d29161b..6c6acf7 100644 --- a/routers/juniper.php +++ b/routers/juniper.php @@ -19,8 +19,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -require_once 'router.php'; -require_once 'includes/utils.php'; +require_once('router.php'); +require_once('includes/utils.php'); final class Juniper extends Router { protected function build_commands($command, $parameters) { diff --git a/routers/quagga.php b/routers/quagga.php index 2dc7dc2..9d7ee77 100644 --- a/routers/quagga.php +++ b/routers/quagga.php @@ -19,8 +19,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -require_once 'router.php'; -require_once 'includes/utils.php'; +require_once('router.php'); +require_once('includes/utils.php'); final class Quagga extends Router { protected function build_commands($command, $parameters) { diff --git a/routers/router.php b/routers/router.php index 26f93fd..c878342 100644 --- a/routers/router.php +++ b/routers/router.php @@ -19,14 +19,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -require_once 'includes/config.defaults.php'; -require_once 'config.php'; -require_once 'bird.php'; -require_once 'cisco.php'; -require_once 'juniper.php'; -require_once 'quagga.php'; -require_once 'includes/utils.php'; -require_once 'auth/authentication.php'; +require_once('includes/config.defaults.php'); +require_once('config.php'); +require_once('bird.php'); +require_once('cisco.php'); +require_once('juniper.php'); +require_once('quagga.php'); +require_once('includes/utils.php'); +require_once('auth/authentication.php'); abstract class Router { protected $global_config; @@ -131,7 +131,7 @@ abstract class Router { return new Quagga($config, $router_config, $id, $requester); default: - print 'Unknown router type "'.$router_config['type'].'"."'; + print 'Unknown router type "'.$router_config['type'].'".'; return null; } } -- cgit v1.2.3