diff --git a/html/pages/settings.inc.php b/html/pages/settings.inc.php index be3c34e72e..88a1a45724 100644 --- a/html/pages/settings.inc.php +++ b/html/pages/settings.inc.php @@ -1,12 +1,46 @@ + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ -if ($_SESSION['userlevel'] == '10') -{ - echo("
");
-  print_r($config);
-  echo("
"); -} else { - include("includes/error-no-perm.inc.php"); +/** + * Global Settings + * @author f0o + * @copyright 2015 f0o, LibreNMS + * @license GPL + * @package LibreNMS + * @subpackage Page + */ + +/** + * Array-To-Table + * @param array $a N-Dimensional, Associative Array + * @return string + */ +function a2t($a) { + $r = ""; + foreach( $a as $k=>$v ) { + if( !empty($v) ) { + $r .= ""; + } + } + $r .= '
".$k."".(is_array($v)?a2t($v):"".wordwrap($v,75,"
")."
")."
'; + return $r; } +if( $_SESSION['userlevel'] == 10 ) { + echo "
".a2t($config)."
"; +} else { + include("includes/error-no-perm.inc.php"); +} ?>