Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Sat Apr 20, 2024 6:01 am

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 42 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Home page update
PostPosted: Fri Mar 09, 2007 7:35 pm 
Offline
Contributor

Joined: Fri Jul 28, 2006 6:30 am
Posts: 157
Location: London
Not really a feature request as I've already written the code:
[url]http://www.npbconsultants.com/openauditupdate.zip[/url]

I originally sent this to Mark while the forum was unavailable, but thought I'd share with anyone else that wanted to use it:

A couple of things have always bugged me with the OpenAudit home page:
1. The page takes a long time to load as each element waits for a query result before being drawn. This can also result in the browser juggling the elements around as new elements are added.
2. Data is downloaded to the browser that may not even be viewed (the table that is displayed in each section when the dropdown arrow is clicked)

Now, depending on configuration options chosen and the performance of the host running OpenAudit these may not be a nuisance, but on my system the page can sometimes take 15 seconds or more to display correctly.

So I have redesigned the index.php page. The major change is that it uses a javascript class called HttpRequestor (which is just a wrapper for a XMLHttpRequest object). A different instance of this class is associated with each section to be displayed on the main page. At the end of index.php each instance makes a call to a different function in index_data.php. The functions in this file perform the relevant SQL query and return HTML code which is then written back to the associated HTML element in the main page.

The effect of this is that the page loads almost instantly and the data for the various sections is populated as soon as the query results are returned, which is much more elegant IMO.

Now originally my intention was to only return the "count" values for each section at first and then use a similar method to download the table data only when the down arrow is clicked (so the data table is only downloaded if the user requests it). However, this would mean performing 2 very similar queries for each section:
- First to get the "count" value only. The query could be optimised (only COUNT(*) needed, no sorting)
- Second to get the table data

In the end I decided that this wasn't worth the extra load on the SQL server, but it's not too hard to implement in future.

I've re-written the index.php in a more modular fashion which should make it easier to add new sections at a later date and to manage future changes.

Finally, I've made a minor change to include.php to change the way that the logo header is displayed - I thought it needed a splash of colour. Just a personal choice :-)

The only other thing I'm working on is to make sure that the "hourglass-busy.gif" is fully loaded before the browser attempts to display it. Sometimes using Firefox if it's not in the browser cache the nasty "picture unavailable" icon is displayed.

See what you think, but I'd like it to be considered for adding to the SVN .

Cheers, Nick.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Mar 10, 2007 1:27 am 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
Looks to work OK, however, it seems to me that the new index page takes a whole lot longer to load...

Not sure what change you have made to the banner. :?

The code is a lot easier to read, give me a bit more time to have a play, and I'll let you know.
:)

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Home page update
PostPosted: Mon Apr 07, 2008 9:44 pm 
Offline
Contributor

Joined: Fri Jul 28, 2006 6:30 am
Posts: 157
Location: London
I know it's been ages, but I'd like to pick this thread back up.

I have some new code at:
[url]http://www.npbconsultants.com/public/openauditupdate.zip[/url]

I've taken a couple of screen captures to show what I'm referring to.

The standard home page looks and loads like this:
[url]http://www.npbconsultants.com/public/cap1.swf.html[/url]
My modified page works like this:
[url]http://www.npbconsultants.com/public/cap2.swf.html[/url]

This might not look very dramatic, but I'll reiterate my original reasons for implementing these changes:
- The page loads virtually instantly and is useable straight away. This gives a more polished, "application" type feel. I'd really like OA to have a slicker interface - it's a good product, but the GUI is a little "flat" IMO.
- The code at the back end is much more modular making it easier to maintain

I've also added a new feature to the home page (hence the reason for picking up this thread). OA is only useful if your systems are being regularly audited. Like many people I audit (every 7 days) via a startup script. But I had a couple of occasions where the script wasn't being run (can't remember the cause right now). I only noticed this when "Systems Not Audited" started increasing abnormally. To stop this happening again my home page now has a graph which displays the number of systems audited on each day. This is a simple visual indicator that things are working normally.

Andrew, I know that when I first posted you reported that the home page loaded slowly on your system. I'm not sure why this might be, but as you can see from the captures it's not the case on my system. So let's assume that it is something that we can diagnose and fix, is this a direction you'd be happy to see the code take? I've only worked on the home page but there are few other pages that could benefit from a similar approach IMO.

On a selfish note it'd be great to get it submitted into the SVN because I wouldn't have to hack around getting my own code working again after every time I update to the latest SVN version :wink:

Cheers, Nick


Top
 Profile  
Reply with quote  
 Post subject: Re: Home page update
PostPosted: Mon Apr 07, 2008 10:28 pm 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
Tried the zip file (neither swf files loaded in Firefox :? )

I see...

[code]
Warning: include(includenpb.php) [function.include]: failed to open stream: No such file or directory in C:\Program Files\xampp\htdocs\OpenAuditTest\index.php on line 37

Warning: include() [function.include]: Failed opening 'includenpb.php' for inclusion (include_path='.;C:\Program Files\xampp\php\pear\') in C:\Program Files\xampp\htdocs\OpenAuditTest\index.php on line 37

Fatal error: Call to undefined function versioncheck() in C:\Program Files\xampp\htdocs\OpenAuditTest\index.php on line 78
[/code]

:? Very Confused. :?

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Home page update
PostPosted: Mon Apr 07, 2008 10:35 pm 
Offline
Contributor

Joined: Fri Jul 28, 2006 6:30 am
Posts: 157
Location: London
Don't be. I've probably just dropped a wrong file into the ZIP :roll:
I'll double-check ...

_________________
Cheers, Nick.

[size=85]OA Server: Windows Server 2003 / Apache 2
Auditing: 1600 Workstations, 200 Servers
OS's: Windows XP / Windows 2000 / Windows 2003 Server / Windows Vista
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Home page update
PostPosted: Mon Apr 07, 2008 11:27 pm 
Offline
Contributor

Joined: Fri Jul 28, 2006 6:30 am
Posts: 157
Location: London
Ok, I missed 'includenpb.php' from the ZIP. I've also fixed the flash pages (I used a tool called Camstudio to produce those pages and quite liked it - apart from the HTML bug that you just found, that is - [url]http://camstudio.org[/url]).

Cheers, Nick.

_________________
Cheers, Nick.

[size=85]OA Server: Windows Server 2003 / Apache 2
Auditing: 1600 Workstations, 200 Servers
OS's: Windows XP / Windows 2000 / Windows 2003 Server / Windows Vista
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Home page update
PostPosted: Mon Apr 07, 2008 11:51 pm 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
Haven't tried Camstudio, but do use Wink.. http://www.debugmode.com/wink/ Thats what the OpenOffice tutorial in OA was created with.

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Home page update
PostPosted: Thu Apr 10, 2008 4:55 am 
Offline
Newbie

Joined: Wed Jan 30, 2008 6:17 am
Posts: 28
I like the updated home page. Looks good on my system.


Top
 Profile  
Reply with quote  
 Post subject: Re: Home page update
PostPosted: Thu Apr 10, 2008 7:27 pm 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
OK I like that.... a lot... (and your flash now works). :D

Let me take a good look to see what (if anything) it breaks (apart from a divide by zero error on the graph if there is no data available :? )

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Home page update
PostPosted: Thu Apr 10, 2008 10:15 pm 
Offline
Contributor

Joined: Fri Jul 28, 2006 6:30 am
Posts: 157
Location: London
Andrew,

Some things to take into account:

- The index page was written many months ago, so it wouldn't be in sync with any changes that have since come through SVN.
- includenpb.php is simply a modified version of include.php to make the graphical changes to the logo header. These changes should really go into include.php so they appear on every page.
- The graph code is quite new and there's very little error checking in it at the moment - Although days with 0 systems scanned seem to display fine on my system. I'll take a look to see where that error might be coming from.

Cheers, Nick.

_________________
Cheers, Nick.

[size=85]OA Server: Windows Server 2003 / Apache 2
Auditing: 1600 Workstations, 200 Servers
OS's: Windows XP / Windows 2000 / Windows 2003 Server / Windows Vista
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Home page update
PostPosted: Thu Apr 10, 2008 11:35 pm 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
Nick, nothing seems to be damaged, so apart from fixing the divide by zero bug (which only occurs with a new install, so you might not have spotted it) I couldn't find any reason for not including it. Mark was happy with it too, so I added it to the SVN. Enjoy. Any bugs... in the bugs forum please. :D

I take on board your comments about the include stuff, if you do update, let me know and I will post to the SVN.

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Home page update
PostPosted: Thu Apr 10, 2008 11:48 pm 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
[quote]
- The index page was written many months ago, so it wouldn't be in sync with any changes that have since come through SVN.


How long ago is "many Months", if you let me know I can look at the changes to the index page and update accordingly.

We have added a fair few bits'n bobs recently that I would like to add to this version (nmap stuff, MDAc and so forth)

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Home page update
PostPosted: Fri Apr 11, 2008 2:37 am 
Offline
Contributor

Joined: Fri Jul 28, 2006 6:30 am
Posts: 157
Location: London
Hmm, looking at my original post it's longer ago than I thought. I reckon 14 months would be about right.
Looking at the SVN logs my index.php comes from somewhere around version 690.

I'll take a closer look through SVN this evening, make the necessary modifications to bring it up to date, then repost.

Cheers, Nick.

_________________
Cheers, Nick.

[size=85]OA Server: Windows Server 2003 / Apache 2
Auditing: 1600 Workstations, 200 Servers
OS's: Windows XP / Windows 2000 / Windows 2003 Server / Windows Vista
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Home page update
PostPosted: Fri Apr 11, 2008 2:45 am 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
Nick, can you update to the latest index page before we add this, and see what is missing. We can then add these features back in. Otherwise there will be a mutiny!

We are seeing ..
Notice: Undefined variable: bgcolor in \index_data.php on line 99
Notice: Undefined variable: bg1 in \index_data.php on line 99
Notice: Undefined variable: bg2 in \index_data.php on line 99

and

Also some features are missing:
- rss link for other items detected
- RDP and Terminal Servers section
- Database Servers section
- updated sql queries for web servers/email servers services
and I don't know how many other fixes, including those added when network card and nmap tables were updated.

Can we move the banner code to the include file etc as per your comments and re-post the changes, I will then add back to the SVN. In the meantime I have reverted back to the Old page, sorry, but we broke too much. Let me know if you need a hand with this, 'cos I like the new look.

BTW if you use windows and tortoise SVN, and would like to see the changes made since a particular date, right click on the index.php page and look at the revision log. I have reverted the SVN index page back to how it was (your page is SVN version 1017)

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Home page update
PostPosted: Fri Apr 11, 2008 2:51 am 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
[quote="NickBrown"]Hmm, looking at my original post it's longer ago than I thought. I reckon 14 months would be about right.
Looking at the SVN logs my index.php comes from somewhere around version 690.

I'll take a closer look through SVN this evening, make the necessary modifications to bring it up to date, then repost.

Cheers, Nick.


Thanks, don't forget the divide by zero bug on the Graphs page, (install a fresh copy in another folder and set it up with a different database, you will see what I am talking about). Speak to you soon.

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 42 posts ]  Go to page 1, 2, 3  Next

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group