www.chilliwave.com

Wifi Network Distribution and Billing Server
It is currently Sat Jan 18, 2020 10:39 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 58 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: Tweaking up Monitoring with Online Users
PostPosted: Wed Dec 17, 2008 7:28 pm 
I don't know whether to plonk this here or in some code discussion somewheres.... maybe Chuck can shift if need be..

However. here's a quick tweak to make Online users more useful. Online Users can be the hub of Management, the present concept is good, but needs seriuos mods to make it a more useful tool, rather than just a crippled tabled display..

This change puts a link from the Username to users_rad.php. That way you can easily see the User details. I'm using a modded 2.1.0 as it runs like a battleship... but should maybe works for 3.x.x.

Using an editor proggy (Kate) grab online.php find this on/around Line 137

<td><?php echo $Recordset1->Fields('UserName'); ?></td>

And change to:

<td height="20" class="style1"><div align="left" class="style4 style4"><a href="./users_rad.php?UserName=<?php echo $Recordset1->Fields('UserName'); ?>"><img src="../wifi-1.1.1/images/edit.jpg" alt="Edit This Record" width="13" height="15" border="0" align="absmiddle"> <?php echo $Recordset1->Fields('UserName'); ?></a></div></td>


I'll post another tweak later, that makes all the 'Online Users' headings ascending or descending. At the moment it defaults to the username in ascending order. e.g if we made 'Last login" descending , then you instntly see who's online or been online for today, or yesterday or the day before etc etc. Along with ascend/descending the other headings, this makes management and monitoring much more powerful...

Cheers


Top
  
 
 Post subject:
PostPosted: Thu Dec 18, 2008 12:16 am 
Thanks! works great on my 2.1.0 system


George


Top
  
 
 Post subject:
PostPosted: Mon Feb 02, 2009 5:39 am 
Offline

Joined: Fri Jul 11, 2008 2:12 am
Posts: 109
Thanks rst_ccd
This also works on 3.3.1
Although nothing shows up in the nasid on either format. Did you ever get around to doing the second tweak? (showing users by past login sequence) And just to push my luck, i know there is a tweak to change kb to mb in the manage users. Is there a similar tweak for this section that you know of (manage online users)
Cheers, jonathon.

_________________
"you can't stop the signal"
-Serenity-


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2009 9:44 am 
Thanks for this I like it


Top
  
 
 Post subject:
PostPosted: Mon Feb 02, 2009 12:38 pm 
Offline
Site Admin
User avatar

Joined: Fri Mar 17, 2006 4:52 pm
Posts: 4413
Location: Bend, Oregon
when you are super admin, the nasid field is blank right now and we will fix that on the next build, but when you are in a hotspot as a site owner you will see that the nasid does show up there..


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 03, 2009 12:42 am 
Hiya jonnyXXX

i think the MB for online.php is from :

http://oregonmicroscience.com/hotspotfo ... php?t=1033
in 'KB to MB tweak for Users 210 & 306'. ( in case i messed up on the link)

withanhdammit and webtron nutted out a good fix here, for the MB and also converting the 'seconds' in minutes..

yes i got the changes for default 'last login' on online.php. Been slack getting up there !! i'd crashed the whole thing up one night, out of desperation as i'd had numerous people logging on & got a headache trying to follow who was online etc etc.. as it was. With 210 theres also the ongoing prob of purchasers missing out on being issued username/password ( even though i'd plastered 'help'screenshots of final PayPal page). Anyways, this mod also tells you straightaway if they've got a username/password and successfully logged on.. & if it's a users 1 'login' you know you've just sold a plan...

It's pretty rough ... but works okay..
i'll go into all the gory details
Give us a day or two...

yeah, the NASID would be cool... looks like Chucks got a finger on it. i ended up slapping patch of code in users_rad.php that gave me the users nasid, name, plan type, time remaining ...all the details. Thats why i'd put the link direct to 'users_rad' from 'online.php'

Actualy .. i'd also modded that above tweak again, to give the trash can icon and 'delete' option of the username also.. i'll dig it up...

Cheers


Top
  
 
 Post subject:
PostPosted: Tue Feb 03, 2009 7:10 pm 
Offline

Joined: Fri Jul 11, 2008 2:12 am
Posts: 109
Quote:
Hiya jonnyXXX

LOL. While I thank you for the implied compliment, at my age I think I lost any pornstar potential many years ago. Just two XX's in my moniker. (i knew that was going to get me into trouble eventually. 8)

Thanks for the info above. I'll give the new one a try as soon as you post it. The trash can is a good thing from that section. Saves a good many button clicks.
One thing I hope Chuck or Loren or someone adds to the system at some stage is the ability to batch delete.
I have already had some long and tedious deleting sessions with trial tickets.
I wonder if a batch of codes eventually expires, whether we will have to go through and clear them one by one from the data base. Not looking forward to that one if there are hundreds.
Thanks again mate. Cheers, jonnyXX

_________________
"you can't stop the signal"
-Serenity-


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 03, 2009 11:06 pm 
Offline
Site Admin
User avatar

Joined: Fri Mar 17, 2006 4:52 pm
Posts: 4413
Location: Bend, Oregon
jonyyxx... good call.. I wrote that down.. It has been mentioned before and somehow slipped through the cracks.. It would not be hard to add at all.. consider it done..

Right now you can go into phpmyadmin and in the radius database, click on the following tables and batch delete whatever you want..

radcheck
radreply

maybe radacct.. depends what part of their data you want to delete..

radcheck will have four fields per user that has their remaining time and other attributes and the radreply will have the bandwidth control data for each user, even if you are not using BW control.. That just means it will have 0's in there for everybody, but they will still exist in there..

If you delete the user info from radacct, then you will be deleting their user history and wiping them from the reports also..

What you do is get the entire list of users you want all listed on one page and then click the button to check the entire list and at the bottom is a red X that means DELETE.. It will ask if you are sure you want to delete all of this stuff and BOOM, all of those users will be gone in one swoop..

I do it all the time.. This is how I clean all of my test activiity out of the server before I remaster the DVD to put out to all of you. that way all database tables are blank and ready to go..

Don't get the bright ideal to go through every table and delete everything though.. Some of that stuff has to be there even when the system is totally blank or it will not even work..

Take care and I have this now written down on my task sheet..

Chuck


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 04, 2009 3:06 am 
Offline

Joined: Fri Jul 11, 2008 2:12 am
Posts: 109
Thanks Chuck, It's good to have a plan B for deleting. I dont have many codes in my database at the moment, so I am inclined to wait for it to appear, but good to know there is the other option.

While I have your attention, I might just push my luck. I put this post into a thread yesterday but i think it got a bit lost with the other activity:

Quote:
Hi guys, I just wanted to make a comment about changing a ticket to a specific persons name and password. Not a big thing, but good to be aware of.
If you set a bandwidth limitation on the original ticket, when you change the name and password, it will revert to an unlimited bandwidth allowance.

Just one other thing and perhaps not for the next update or two, but I can see problems happening with multiple users being able to log in with the same code (under the 99 logins rule). Picture a scenario at a backpackers hostel where another user successfully logs in with the first users code which is lying on the table. Word will spread like a bushfire! and you won't sell any more codes that night at least. Perhaps this is the best use of mac IDENTIFICATION, as opposed to mac authentication, to make sure that only one mac at a time can log in with any particular code.

The first point was just a bit of trivia. It was the second RE the possibility of mac identification regardless of the number of logins I was concerned about.
Just a thought, cheers, jonathon.

_________________
"you can't stop the signal"
-Serenity-


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 04, 2009 9:03 am 
Offline
Site Admin
User avatar

Joined: Fri Mar 17, 2006 4:52 pm
Posts: 4413
Location: Bend, Oregon
Jonathan.. If I miss a post just bump it and I will find it... I try to scan the threads for posts that are not showing up in the "Latest post since your last visit", but they do slip through the cracks quite often and I do not see them until someone bumps it again..

regarding changing a username... How are you changing the username? If you do change a username and password, you have to change it in 6 places throughout the system.. I will wait to see what you are doing to change the name before I pontificate on it...

Here is how you set those simultaneous logins to any number you want them to be for paypal buttons.. Open the following file:

/var/www/inc-gateway/inc-functions.php

You will find the simultaneous logins there on lines 118, 209, 288......

change them down to between 1 - 3 ... If you set it at 1, you will have people calling and saying they are trying to login and the user is already logged in..

what is happening there is the person has moved from one router to another router and is not logged out from the first router..

This is actually a complicated thing that ties into the lack of "Idle-Timeout" attribute in the radreply table for each user.. That will affect many parts of this that people are talking about, and this is one of them.. The idle timeout would cause the person to timeout and be automatically logged out by inactivity on one access point and then when they move to another location the system will not argue with them about whether they are already logged in or not..

I know it has been a few weeks since I put out an update, but I am doing that on purpose... this is allowing everybody to get on the same page and up to speed with us and the creme is really rising to the top and allowing me to nail every single one of these bugs.. This will make this next update really powerful for all of us.. I think it is time to get it rolled out though..

Loren and I have one more project bid to put in today and as soon as that is finished, there will be nothing else on our to do list but go back to this bug sheet..

Good to go...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 04, 2009 9:59 am 
hiya jonnyxx
sorry bout the name change.... lost for xxx's :lol:

Chuck... the batch deletes would be a buzz.. looking forward to this one .
it's tedoius when managers create a 'hundred' tickets before they choose one. i used batch deletes in radius as you mentioned, but found this only a little less painful as entries are made in radreply and also in user_tickets.
Dug up the 'trash can' tweak i mentioned in the last post, but found why i scrapped the idea as it utilised the script 'deletepreusers.php' in Manage Current Users, which calls for 'id' field in radcheck and not the 'username'. Also i think it only deletes entries in radcheck. Theres still the entries in radreply and user_tickets (for tickets) or billing (for online purchases). Ended up making up a seperate script that deleted all these.. in one hit.
In addition was a similiar script that could also archive old accounts into made up radius tables ie 2008_billing, 2008_radreply, 2008_users_tickets etc, thus freeing up the current radius tables...
Could post these if theres any interest.... trash can included !

The multiple users or 'abusers' jonnyxx mentioned is an intersting point.
Maybe figured that monitoring was better than trying to impliment blanket bans. It may not suit all, but some clients are multiple family users on their own PC's. What i did here was include the users MAC address to be displayed in users_rad.php. If more than one MAC addy showed up, it meant more thaan one user... multiple MAC addy's .. and yes... it would indicate as mentioned ,,, the entire backpackers had found someones login details!
Also has it set up so the users could access their own "accounts" if they desired, to monitor what they'd used, when they'd used it and who was using it.. thus the onus is on them ....to look after themselves..

Anyways ,,, better go & find this online users

cheers


Top
  
 
 Post subject:
PostPosted: Wed Feb 04, 2009 10:54 am 
Offline
User avatar

Joined: Thu Feb 28, 2008 8:33 am
Posts: 858
Location: Odessa TX
I would be interested to see what you have going as I'm sure many more would so if you don't mind giving us a link it would definatly be used.

thanks,

_________________
Steve

Yes, I'm a PC and I run great on LINUX.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 04, 2009 11:04 am 
The idea behind this mod is to see all the current logins by date in desending order. This allows you to see who is logged in for today and how many have logged in. Also if Number Logins is 1 for today, then you'd know its a new user.

At the moment Online Users defaults to the 'usernames' is alphabetical order which makes managing whos online a little tediuos

Using online.php find this around line 39

$query_Recordset1 = "SELECT r1.UserName, max(r1.AcctStartTime) as LastLogin, min(r1.AcctStartTime) as FirstLogin, sum(r1.AcctInputOctets)as Upload, sum(r1.AcctOutputOctets) as Download, count(*) as NumLogins,case when min(AcctStopTime) = '0000-00-00 00:00:00' then 'Yes' else 'No' end as online,(select case when r3.value is null then 0 else r3.value - case when min(ra2.AcctStartTime) is null then 0 else sum(ra2.AcctSessionTime) end end from radacct ra2 where ra2.username = r1.username) as 'SecondsRemaining',(select case when (min(ra.AcctStartTime) is null or sum(ra.AcctSessionTime) < r3.value) then 'No' else 'Yes' end from radacct ra where ra.username = r1.username) as 'Time_Used_Up',case when (r2.value is null or r2.value > unix_timestamp(now())) then 'No' else 'Yes' end as 'Expired' FROM radacct r1 left outer join radcheck r3 on r3.username = r1.username and r3.attribute='Max-All-Session' left outer join radcheck r2 on r2.username = r1.username and r2.attribute='Expiration' GROUP BY r1.UserName";

and change to this

$query_Recordset1 = "SELECT r1.UserName, max(r1.AcctStartTime) as LastLogin, min(r1.AcctStartTime) as FirstLogin, sum(r1.AcctInputOctets)as Upload, sum(r1.AcctOutputOctets) as Download, count(*) as NumLogins,case when max(AcctStopTime) = '0000-00-00 00:00:00' then 'Yes' else 'No' end as online,(select case when r3.value is null then 0 else r3.value - case when min(ra2.AcctStartTime) is null then 0 else sum(ra2.AcctSessionTime) end end from radacct ra2 where ra2.username = r1.username) as 'SecondsRemaining',(select case when (min(ra.AcctStartTime) is null or sum(ra.AcctSessionTime) < r3.value) then 'No' else 'Yes' end from radacct ra where ra.username = r1.username) as 'Time_Used_Up',case when (r2.value is null or r2.value > unix_timestamp(now())) then 'No' else 'Yes' end as 'Expired' FROM radacct r1 left outer join radcheck r3 on r3.username = r1.username and r3.attribute='Max-All-Session' left outer join radcheck r2 on r2.username = r1.username and r2.attribute='Expiration' GROUP BY UserName order by max(r1.AcctStartTime) DESC ";

The actual change is in green if you wish just to edit manually....

This mod would probably suit most as it is...

What i'd done was convert all the Table headings with Href links that gave the rows ascending or descending order relevant to the Heading. i.e Username, Last Login, First Login, Number Logins etc etc. This meant having 10 renamed copies of online.php . If anybody is intersted in going this far, i can post, but i found using Last Login the most useful...

Just a quick note from this code... it gets its info from radacct and calculates into the display you see,,,, The heading 'Online?" with Yes or No result, derives this from the radacct field 'AcctStopTime'. Normally when a user has just logged in this is set at '0000-00-00 00:00:00' because the user hasn't logged out yet. So this code interprets it as 'Yes the user is Online.' ... very clever..

However if radius hiccups and some prevoius entries hasn't been given its proper logout time/date, you'll find the user is always "online" . You can check this by looking up the user in users_rad.php. If there are "Stop Time" entries with '0000-00-00 00:00:00' then that user is always read as being 'Online'. ( such as the case with mythical 'Steve' being always 'Online' in 210)

Just a bit of trivia...

cheers


Top
  
 
 Post subject:
PostPosted: Wed Feb 04, 2009 7:46 pm 
Offline

Joined: Fri Jul 11, 2008 2:12 am
Posts: 109
Quote:
Jonathan.. If I miss a post just bump it and I will find it... I try to scan the threads for posts that are not showing up in the "Latest post since your last visit", but they do slip through the cracks quite often and I do not see them until someone bumps it again..

Not your fault Chuck, I should have really started a new thread on it.

The username change thing is not an issue for me. A couple of times I made a code with a bandwidth limit on it and changed it to a user friendly name for one of the people in the office i share so they could access the net. Just a simple username/password change in manage users. I just happened to notice that after the change the bandwidth limit no longer applied and was just giving a heads up to anyone wanting to do the same thing.

What is of great concern to me though is the 99 login issue. I fully understand the reasons for having the multiple logins. Quite frankly it shouldn't matter if the logins are set to 999. What is at issue here is that every other user in the group or hostel or backpackers doesn't have to buy a code to access the internet. They can just use their friends code.
The original user isn't going to mind because it doesn't affect his access to the net. He will just say, here use this, it will get you on for "free".
I want every person who gets onto the internet to have bought a code and to have put some cash back into the system. After all , thats why we are here.

We are social creatures by habit. It won't take long for word to get around the rec room table that one code works for all. And if a family is traveling together it would be unnatural for the 15 year old to not try dads code on his laptop.
I don't want to operate a semi free system, reliant on people feeling they should buy a code even though they don't have to. Because it won't happen.

perhaps some form of mac identification so the system know that this code is currently being used by another mac so sorry "login failed, Code is in use by another user"

rst_ccd i see what you are saying by putting the onus on the user to monitor their own account, but if they have nothing to lose by letting others using their code, it won't mean much to them. And if at some stage they are going to lose bandwidth by another user using their code (the fifteen year old son), they are more likely to question why the system allows it in the first place, putting the onus back on you.
Just my two cents worth. :)

rst_ccd Thanks for the online.php addition It does make it a lot easier to see what is going on when the order is chronological. nice one

Cheers, jonnyxx.

_________________
"you can't stop the signal"
-Serenity-


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 04, 2009 7:49 pm 
Offline
Site Admin
User avatar

Joined: Fri Mar 17, 2006 4:52 pm
Posts: 4413
Location: Bend, Oregon
Damn... You are one smart cookie... Holy cow.. that makes too much sense not to just roll it right in..

This also dovetails with a few others threads where people report occasional unexplained readings of all zero's just like you describe above... No scientific explanation, but @#$% just happens occasionally....... weird..

Thanks for that.. I am going to roll this in and make be the default...

Chuck


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 58 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group