[ previous ] [ next ] [ threads ]
 
 From:  Vittore Zen <drzen at gamebox dot net>
 To:  m0n0wall at lists dot m0n0 dot ch
 Subject:  Re: [m0n0wall] what RADIUS server is good and Free?
 Date:  Mon, 15 Nov 2004 16:07:14 +0100
In data 15/11/2004 12.23 Vittore Zen ha scritto:

> In data 12/11/2004 17.39 eric at ericmagny dot com ha scritto:
>
>> Hi,
>>
>> Im interested to see thi spage, I'm also using this server, but don't 
>> have this interface..
>>
>> I'll appreciate if you can send it to me ..  (or you can also send it 
>> to the list, I'm probably not the only one interested by this add-on!)
>>
>> Best regards,
>>
>> eric.
>>  
>>
>
> See the page in attachment.
> change the line
> $radius_server_dir='c:\Programmi\Multi-Tech Systems\RADIUS Server2.00';
> to link your radius server file
> and
> if ($_POST['cifra']!="1234") die;
> to password
>
>
>

Ops! The file :-)

<?
$radius_server_dir='c:\Programmi\Multi-Tech Systems\RADIUS Server2.00';
$users_file_name=$radius_server_dir."\Users";
?>

<form name="form1" action="index.php" method="POST">
Codice di modifica: <input type=password name=cifra 
value="<?=$_POST['cifra']?>">


<?
if ($_POST['cifra']!="1234") die;

if (isset($_POST['username']))
    {
        $file = fopen ($users_file_name, "w");
        if (!$file)
            {
                echo "<p>Impossibile aprire il file remoto in scrittura.\n";
                exit;
            }
        $data="";
        foreach ($_POST['username'] as $key => $user)
            {
            if ($_POST['del'][$key]!="on")
                {
                    if ($user=="" OR $user=="Auth-Type") continue;
                    $data.="$user   Auth-Type = Local, Password = 
\"".$_POST['password'][$key]."\"\r\n";
                }
            }   
        $data=trim($data,"\r\n");
        fputs ($file, $data);
        fclose ($file);
    }


?>




<table>
<tr>
<td>Del.</td>
<td>Username</td>
<td>Password</td>
</tr>
<?
$users_file=file($users_file_name);
foreach ($users_file as $key => $user) {
list ($username,$password)=sscanf($user,"%s   Auth-Type = Local, 
Password = \"%s\"");
$password=substr($password,0,strlen($password)-1 );
?>
<tr>
<td>
<input type=checkbox name=del[<?=$key?>]>
</td>
<td><input type=text name=username[<?=$key?>] value='<?=$username?>'></td>
<td><input type=text name=password[<?=$key?>] value='<?=$password?>'></td>
</tr>

<?
}
?>
<tr><td></td>
<td><input type=text name=username[<?=$key+1?>] value=''></td>
<td><input type=text name=password[<?=$key+1?>] value=''></td>
</tr>
<tr><td colspan=2>
<input type=submit value="Salva modifiche">

</td></tr>
</table>
</form>