The forum for help and support with FreeNATS as well as any useful hints and tips
Post Reply
Posts: 92
Joined: Thu Sep 04, 2008 9:48 pm


Post by paullanders » Wed Dec 12, 2012 11:41 pm

Dave, is there a way to add a favicon, perhaps from includes?



Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK

Re: favicon

Post by dave » Thu Dec 13, 2012 1:52 pm

Hi Paul,

There's currently no supported method but I think it would be quite easy for me to put in as a config option.

In the meantime you have two choices.

1. If FreeNATS is on a web server root e.g. you go to http://myserver/ to access it then you can put a favicon.ico file in the web root folder (on the VM this is /srv/www/html)

2. You can change the following FreeNATS code - it's what I will do when I put this in and allows the favicon to be a configurable string.

Edit the file server/base/screen.inc.php

After line 90 e.g. after the block that goes:
echo "<style type=\"text/css\">\n";
echo "\n</style>\n";
So on a new line after the close comment put in these two lines:

if ($NATS->Cfg->Get("site.favicon","")!="")
echo "<link rel=\"shortcut icon\" href=\"".$NATS->Cfg->Get("site.favicon","")."\" />\n";

That will mean you can use a system config item called site.favicon which you set to the relative or absolute path to your favicon file e.g. you could set it to:

site.favicon = /freenats.ico
(this means if FreeNATS is on http://server/monitoring/freenats/ the file is at http://server/freenats.ico)

site.favicon = http://www.myiconserver.com/icons/whatever.ico
Will refer to one by full path.




Posts: 92
Joined: Thu Sep 04, 2008 9:48 pm

Re: favicon

Post by paullanders » Thu Dec 13, 2012 7:00 pm

Very cool! Works like a champ. Thanks, Dave! :-)

Post Reply