Location: PHPKode > projects > phpMyPrepaid > phpmyprepaid/www/include/configuration/RadiusConfiguration.php
<?php
if(!isset($msg)){
if ($buttonID=="saveconfigr") {
 
	//GENERAL
  $opt->radius_server=$_POST['RadiusServer'];
  $opt->radius_server_sec=$_POST['RadiusServer'];
  $opt->radius_server_port=$_POST['RadiusPort'];
  $opt->radius_server_secret=$_POST['RadiusSecret'];
  $opt->radius_log=$_POST['RadiusLog'];
  $opt->radius_bin=$_POST['RadiusBin'];
  $opt->radius_conf=$_POST['RadiusConf'];
  $opt->radius_version=$_POST['radius_version'];
  $opt->radius_dictionnary=$_POST['RadiusDictionnary'];
  $opt->radius_startscript=$_POST['RadiusStartscript'];
  $opt->radclient=$_POST['RadiusClientbin'];
  $opt->location_id=$_SESSION['locID'];
  $oreon->database->saveradiusconfiguration($opt);
  echo "<p class=\"information\">Configuration have been saved</p>";
  
}

if (isset($_POST['load_default']))
{	
	$lid=-1;
	unset($_POST['load_default']);
}

else
	$lid=$_SESSION['locID'];
$opt=$oreon->database->getradiusconfiguration($lid);

echo "
<form action=\"phpmyprepaid.php\" method=\"post\">
<br>
<hr>
<big><big  style=\"font-family: Aircut\"><span style=\"font-weight: bold;\"><b>Radius general configuration</span></b></big></big><br>
<table>
<tr>
<td>Radius server : </td>
<td><input name=\"RadiusServer\" value=\"".$opt['radius_server']."\"></td>
</tr><tr>
<td>Radius secondary server : </td>
<td><input name=\"RadiusServerSec\" value=\"".$opt['radius_server_sec']."\"></td>
</tr><tr>
<td>Radius port : </td>
<td><input name=\"RadiusPort\" value=\"".$opt['radius_server_port']."\"></td>
</tr><tr>
<td>Radius secret : </td>
<td><input name=\"RadiusSecret\" value=\"".$opt['radius_server_secret']."\"></td>
</tr><tr>
<td>Radius log : </td>
<td><input name=\"RadiusLog\" value=\"".$opt['radius_log']."\"></td>
</tr><tr>
<td>Radius binary : </td>
<td><input name=\"RadiusBin\" value=\"".$opt['radius_bin']."\"></td>
</tr><tr>
<td>Radius configuration file : </td>
<td><input name=\"RadiusConf\" value=\"".$opt['radius_conf']."\"></td>
</tr><tr>
<td>Radius dictionnary path : </td>
<td><input name=\"RadiusDictionnary\" value=\"".$opt['radius_dictionnary']."\"></td>
</tr><tr>
<td>Radius start script : </td>
<td><input name=\"RadiusStartscript\" value=\"".$opt['radius_startscript']."\"></td>
</tr><tr>
<td>Radius client bin : </td>
<td><input name=\"RadiusClientbin\" value=\"".$opt['radclient']."\"></td>
</tr><tr>
 <td >Radius version. </td>
 <td>1.X <input type=\"radio\" name=\"radius_version\" value=\"1\" checked> 2.X <input type=\"radio\" name=\"radius_version\" value=\"2\" enabled"; 
 if (isset($opt["radius_version"]) && $opt["radius_version"] == 2) print "checked"; ?>></td>
	              </tr>

<hr>

</tr>
</table>

<hr>
<table>
<tr>
<?
 print "
<td><input type=\"hidden\" name=\"buttonID\" value=\"saveconfigr\">
<input name=\"submit\" class=\"smallButton\" type=\"submit\" value=\"Save Configuration\" >
</form>
</td><td>
<form action=\"phpmyprepaid.php\" method=\"post\">
<input type=\"hidden\" name=\"buttonID\" value=\"radius_config\">
<input type=\"hidden\" name=\"load_default\" value=\"radius_config\">
<input name=\"submit\" type=\"submit\" class=\"smallButton\"  value=\"Get default configuration\" >
</form>
</td></tr>
</table>
";
}
else echo $msg;
Return current item: phpMyPrepaid