<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Chillispot Forum — Guest Signup Period followed by login only.]]></title>
		<link>http://www.chillispot.org/chilliforum/topic334-guest-signup-period-followed-by-login-only.html</link>
		<atom:link href="http://www.chillispot.org/chilliforum/feed-rss-topic334.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Guest Signup Period followed by login only..]]></description>
		<lastBuildDate>Tue, 02 Jun 2009 13:29:39 +0000</lastBuildDate>
		<generator>PunBB 1.4.4</generator>
		<item>
			<title><![CDATA[Re: Guest Signup Period followed by login only.]]></title>
			<link>http://www.chillispot.org/chilliforum/post966.html#p966</link>
			<description><![CDATA[<p>Err not sure, enable groups as the guy above says and create the table. Then Restart Radius.</p><p>As to the loging off - I didn&#039;t disconnect them I mearly set a login time in radgroupreply, guests get logged off after half an hour any way. Users after a n Hour I think. Stops the little B****ers leaving filesharing apps on all night.</p><p>For the observant of you who spotted I&#039;d ballesd up the full version of this post on my website, I&#039;ve fixed it.....</p><p>http://www.oceanhippie.net/content.php?Cat=1&amp;Res=1190</p><p>Tom</p>]]></description>
			<author><![CDATA[null@example.com (oceanhippie)]]></author>
			<pubDate>Tue, 02 Jun 2009 13:29:39 +0000</pubDate>
			<guid>http://www.chillispot.org/chilliforum/post966.html#p966</guid>
		</item>
		<item>
			<title><![CDATA[Re: Guest Signup Period followed by login only.]]></title>
			<link>http://www.chillispot.org/chilliforum/post951.html#p951</link>
			<description><![CDATA[<p>need more help on this. Can seem to use the radusergroup table still. Am i doing something wrong? or is there a special configuration?</p>]]></description>
			<author><![CDATA[null@example.com (quibski)]]></author>
			<pubDate>Wed, 27 May 2009 06:47:22 +0000</pubDate>
			<guid>http://www.chillispot.org/chilliforum/post951.html#p951</guid>
		</item>
		<item>
			<title><![CDATA[Re: Guest Signup Period followed by login only.]]></title>
			<link>http://www.chillispot.org/chilliforum/post948.html#p948</link>
			<description><![CDATA[<p>Could you help me? </p><p>I have a lot of questions here:</p><p>1) How did you set which user to which group? I dont see any sql table that could connect radcheck?&nbsp; </p><p>2) How did you force the user to disconnect?</p>]]></description>
			<author><![CDATA[null@example.com (quibski)]]></author>
			<pubDate>Mon, 25 May 2009 07:01:50 +0000</pubDate>
			<guid>http://www.chillispot.org/chilliforum/post948.html#p948</guid>
		</item>
		<item>
			<title><![CDATA[Re: Guest Signup Period followed by login only.]]></title>
			<link>http://www.chillispot.org/chilliforum/post943.html#p943</link>
			<description><![CDATA[<p>I&#039;ve cleaned up the above and inculded the code to be added to hotspotlogin.php and put it on my site.</p><p>its here: <a href="http://www.oceanhippie.net/content.php?Cat=1&amp;Res=1190">http://www.oceanhippie.net/content.php? … p;Res=1190</a></p><p>The above could be adapted to provide a trial period.</p>]]></description>
			<author><![CDATA[null@example.com (oceanhippie)]]></author>
			<pubDate>Sat, 23 May 2009 10:16:40 +0000</pubDate>
			<guid>http://www.chillispot.org/chilliforum/post943.html#p943</guid>
		</item>
		<item>
			<title><![CDATA[Guest Signup Period followed by login only.]]></title>
			<link>http://www.chillispot.org/chilliforum/post926.html#p926</link>
			<description><![CDATA[<p>Using a series of hacks to the UAM server our free network now works on the following rules:</p><p>Users must register to use the system.<br />Users must confrim their email address<br />However if they just chance on the hotspot they&#039;re&nbsp; allowed limited &quot;trial period&quot; to recieve the confrim email address message.<br />Usage limits are applied to prevent overuse of the sytem and to irritate fileshares (its bloody hard to block them).</p><p>My codes kind of a mess at the minute but if anyones interested I&#039;ll share it with some instructions.</p><p>In basic it goes something like this:<br />UAM and Radius are on same server, radius is using MySQL to store usernames etc.</p><p>Customised splash screen reads the mac=ADDRESS attribute that chilli helpfully sents it.<br />Then it looks for that mac address as a username in the Raduis users<br />If its not there it creats a radius user with name of ADDRESS. Now there is a unique &quot;Guest&quot; account specific to that computer.<br />If it is there then it looks that MAC (also a username in radius) up in the Radius Accounting table. If its been used more than reasonable to retrieve and email. It moves it to a different radius group, wich is no longer allowed to log in. </p><p>The splash screen has an extra form, identical to the normal login one, except the username field is hidden and preset to the MAC address of the PC.</p><p>Voila, free acess, with Identifiable users with no pre-registration required.</p><p>PART 2 Fair usage.</p><p>This one&#039;s script is easier, this is a PHP script I run off cron every hour. Punishes people who download too much stay online too long, or upload to much. Works by moving group membership around.</p><p>My Groups:<br />[pre]<br />+----+-----------+-----------+----+--------+<br />| id | GroupName | Attribute | op | Value&nbsp; |<br />+----+-----------+-----------+----+--------+<br />|&nbsp; 1 | device&nbsp; &nbsp; | Auth-Type | := | Local&nbsp; | mac authed devices<br />|&nbsp; 2 | user&nbsp; &nbsp; &nbsp; | Auth-Type | := | Local&nbsp; | &quot;normal&quot; users<br />|&nbsp; 3 | guest&nbsp; &nbsp; &nbsp;| Auth-Type | := | Local&nbsp; | &quot;guest&#039;s with registraition period remaining&quot;<br />|&nbsp; 4 | expGuest&nbsp; | Auth-Type | := | Reject | guest registration preriod expired<br />|&nbsp; 5 | mates&nbsp; &nbsp; &nbsp;| Auth-Type | := | Local&nbsp; | my mates (extra privalges)<br />|&nbsp; 6 | punish&nbsp; &nbsp; | Auth-Type | := | Reject | people temporally punihed.<br />+----+-----------+-----------+----+--------+<br />[/pre]<br />My Group Reply (big fat warning, unless its been changed hotspotlogin.php&#039;s reply feature is broken)<br />[pre]<br />+----+-----------+--------------------------+----+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+<br />| id | GroupName | Attribute&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | op | Value&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | prio |<br />+----+-----------+--------------------------+----+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+<br />|&nbsp; 1 | guest&nbsp; &nbsp; &nbsp;| WISPr-Bandwidth-Max-Down | := | 512000&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; 0 |<br />|&nbsp; 2 | guest&nbsp; &nbsp; &nbsp;| WISPr-Bandwidth-Max-Up&nbsp; &nbsp;| := | 128000&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; 0 |<br />|&nbsp; 3 | guest&nbsp; &nbsp; &nbsp;| Session-Timeout&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | := | 1800&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; 0 |<br />|&nbsp; 4 | user&nbsp; &nbsp; &nbsp; | WISPr-Bandwidth-Max-Down | := | 512000&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; 0 |<br />|&nbsp; 5 | user&nbsp; &nbsp; &nbsp; | WISPr-Bandwidth-Max-Up&nbsp; &nbsp;| := | 128000&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; 0 |<br />|&nbsp; 6 | user&nbsp; &nbsp; &nbsp; | Session-Timeout&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | := | 7200&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; 0 |<br />|&nbsp; 7 | guest&nbsp; &nbsp; &nbsp;| Reply-Message&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | := | This is a GUEST login - you have 20 minutes to register! before this is permantly disabled. WE ARE NOT KIDDING! It will stop working VERY SOON!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; 0 |<br />| 12 | punish&nbsp; &nbsp; | Reply-Message&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | := | You&#039;ve over used one of our our quotas. either by downloading or uploading to much or staying online too long. Wait a while and your access will be restored. The PierToPier.net Team.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; 0 |<br />| 11 | expGuest&nbsp; | Reply-Message&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | := | Your Guest Access has expired. You need to register. Since you&#039;re going to need to confim your email, your going to have to get some internet somewhere else! Register Now, reply to the confirm email latter! |&nbsp; &nbsp; 0 |<br />+----+-----------+--------------------------+----+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+<br />9 rows in set (0.00 sec)<br />[/pre]<br />Bit difficult to read, but they set the bandwidth for the various groups and the reply messages for guests and expired guests and punished people.<br />[pre]</p><p>anyway heres the code <br />#!/usr/bin/php -q<br />&lt;?php<br />$hostname = &quot;localhost&quot;;<br />$database = &quot;radius&quot;; //your radius database name<br />$username = &quot;MySQLUserWithAccessToRadius&quot;; //MySQL username<br />$password = &quot;PasswordForAbove&quot;; //MySQL password</p><p>// LIMITS of aceptability<br />$timeOn=21600; //minutes 6 hours = 21600<br />$inData=1000000000; //bytes<br />$outData=500000000; //bytes<br />// Punishament Adjusters.<br />$timePen=7200; //don&#039;t re-enable till ther&#039;es 2 hours in hand<br />$inPen=100000000; //make a 10 percent leway<br />$out=50000000; //make a 10 percent leway<br />$p2pdb = mysql_pconnect($hostname, $username, $password) or die(mysql_error());<br />mysql_select_db($database, $p2pdb);<br />$query_day = &quot;SELECT radacct.UserName, SUM(acctSessionTime) as timeOn, SUM(AcctInputOctets) AS inData, SUM(AcctOutputOctets) AS outData, NOW() as now<br />FROM radacct LEFT JOIN usergroup ON radacct.UserName=usergroup.UserName<br />WHERE AcctStopTime &gt;= DATE_SUB(NOW(),INTERVAL 1 DAY) AND GroupName=&#039;user&#039;<br />GROUP BY UserName&quot;;<br />$day = mysql_query($query_day, $p2pdb) or die(mysql_error());<br />$row_day = mysql_fetch_assoc($day);<br />$totalRows_day = mysql_num_rows($day);<br />$flag=0;<br />echo &quot;Normal Users&#039;s on last 24 hours, looking for evildoers\n&quot;;<br />do{<br />&nbsp; &nbsp; &nbsp; &nbsp; echo $row_day[&#039;UserName&#039;].&quot;\tTime: &quot;.round($row_day[&#039;timeOn&#039;]/3600,3).&quot;\tIn: &quot;.round($row_day[&#039;inData&#039;]/1000000).&quot;Meg\tOut: &quot;.round($row_day[&#039;outData&#039;]/1000000).&quot;Meg\n&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; if($row_day[&#039;timeOn&#039;]&gt;=$timeOn) {$flag=1; echo &quot;Time On Flagged\n&quot;;}<br />&nbsp; &nbsp; &nbsp; &nbsp; if($row_day[&#039;inData&#039;]&gt;=$inData) {$flag=1; echo &quot;data In&nbsp; Flagged\n&quot;;}<br />&nbsp; &nbsp; &nbsp; &nbsp; if($row_day[&#039;outData&#039;]&gt;=$outData) {$flag=1; echo &quot;data Out Flagged\n&quot;;}<br />&nbsp; &nbsp; &nbsp; &nbsp; if($flag==1) { //got our self a scumbag<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $moveGroup = &quot;update usergroup SET GroupName=&#039;punish&#039; WHERE UserName=&#039;&quot;.$row_day[&#039;UserName&#039;].&quot;&#039;&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (@mysql_query($moveGroup)) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Moved &quot;.$row_day[&#039;UserName&#039;].&quot; to punishment cell\n&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else { $mess=($mess. &quot;Oops, something nasty happened updating the Radius Server Group membership&quot;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />} while ($row_day = mysql_fetch_assoc($day));<br />$flag=0; //Re-set flag<br />// put them back if they&#039;ve droped below the levels<br />$query_ret = &quot;SELECT radacct.UserName, SUM(acctSessionTime) as timeOn, SUM(AcctInputOctets) AS inData, SUM(AcctOutputOctets) AS outData<br />FROM radacct LEFT JOIN usergroup ON radacct.UserName=usergroup.UserName<br />WHERE AcctStopTime &gt;= DATE_SUB(NOW(),INTERVAL 1 DAY) AND GroupName=&#039;punish&#039;<br />GROUP BY UserName&quot;;<br />$ret = mysql_query($query_ret, $p2pdb) or die(mysql_error());<br />$row_ret = mysql_fetch_assoc($ret);<br />$totalRows_ret = mysql_num_rows($ret);<br />//re caulcuate for re-enable<br />$timeOn=$timeOn-$timePen;<br />$inData=$inData-$inPen;<br />$outData=$outData-$outPen;<br />echo &quot;\n&quot;;<br />echo &quot;&nbsp; &nbsp; &nbsp; Looking for people to move back\n&quot;;<br />do{<br />&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Time: &quot;.round($row_ret[&#039;timeOn&#039;]/3600,3).&quot;\tIn: &quot;.round($row_ret[&#039;inData&#039;]/1000000).&quot;Meg\tOut: &quot;.round($row_ret[&#039;outData&#039;]/1000000).&quot;Meg&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; if($row_ret[&#039;timeOn&#039;]&lt;=$timeOn &amp;&amp; $row_ret[&#039;inData&#039;]&lt;=$inData &amp;&amp; $row_ret[&#039;outData&#039;]&lt;=$outData) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $moveGroup = &quot;update usergroup SET GroupName=&#039;user&#039; WHERE UserName=&#039;&quot;.$row_ret[&#039;UserName&#039;].&quot;&#039;&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (@mysql_query($moveGroup)) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;\tMoving &quot;.$row_ret[&#039;UserName&#039;].&quot; back to the General Population\n&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else { $mess=($mess. &quot;Oops, something nasty happened updating the Radius Server Group membership&quot;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; } else { echo &quot;\tLeaving &quot;.$row_ret[&#039;UserName&#039;].&quot; in punish\n&quot;; }<br />} while ($row_ret = mysql_fetch_assoc($ret));</p><p>?&gt;</p><p>[/pre]<br />you will need command line php to run this one. </p><p>Have fun Tom http://www.oceanhippie.net/cat.php?Cat=1</p>]]></description>
			<author><![CDATA[null@example.com (oceanhippie)]]></author>
			<pubDate>Thu, 21 May 2009 16:00:22 +0000</pubDate>
			<guid>http://www.chillispot.org/chilliforum/post926.html#p926</guid>
		</item>
	</channel>
</rss>
