Simplifying NeDi

I just got off the phone with a customer, who’s using NeDi to manage his global network. He’s created shared users, thus disabled User-Profile to avoid them changing any settings by accident. The drawback is, that he cannot use the otherwise helpful admin-notice anymore.

As NeDi can easily be expanded to fit most needs, I told him to create User-Notice.php in NeDi’s html folder with the following content:

# Program: User-Notice.php
# Programmer: Remo Rickli

$exportxls = 0;
$msgfile   = "log/msg.txt";

include_once ("inc/header.php");

echo "<h1>$usrlbl $mlvl[100]</h1>\n";

$link  = DbConnect($dbhost,$dbuser,$dbpass,$dbname);

if( file_exists($msgfile) ){
	echo "<div class=\"textpad txtb tqrt\">\n";
	include_once ($msgfile);
	echo "</div><br>\n";

include_once ("inc/footer.php");

Then add a menu entry in nedi.conf:

module	User		Notice			brc

Last but not least replace the wizard in msg.txt with this for example:

<table class="content">
	<tr class="bgsub">
<form method="get" action="Devices-List.php">
<a href="Devices-List.php"><img src="img/32/dev.png"></a>
<input type="hidden" name="in[]" value="device">
<input type="hidden" name="op[]" value="~">
<input type="text" name="st[]" placeholder="Device">
<form method="get" action="Nodes-List.php">
<a href="Nodes-List.php"><img src="img/32/node.png"></a>
<input type="hidden" name="in[]" value="aname">
<input type="hidden" name="op[]" value="~">
<input type="text" name="st[]" placeholder="Node">

<! Discovery history report showing last 50 entries >
include_once ("inc/librep.php");

Behold the result! A simple landing page, helping to get started with your daily business. Just have a look at the librep.php library for including other reports…


Following this example, you can expand NeDi anyway you want. Starting with NeDi 1.6 the default login page (User-Profile) can be changed as well. Alternatively, you can just bookmark your favorite NeDi view and you’ll be taken there right after login.