Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2009 → Rev 2010

/web/intercept.php
374,6 → 374,37
default: $result = 0; // Default: It was not a form request -> client go to login form
}
 
//check if we need to warn user about the imputability logs.
if($result == 1)
{
if ((is_file("./acc/manager/lib/sql/drivers/mysql/functions.php"))&&(is_file("/etc/freeradius-web/config.php"))){
include_once("/etc/freeradius-web/config.php");
include_once("./acc/manager/lib/sql/drivers/mysql/functions.php");
$user_url=$_GET['userurl'];
$user_uid=$_GET['uid'];
$sql = "SELECT attribute, value FROM radreply WHERE username='$user_uid'";
$link = @da_sql_pconnect($config); // on affiche pas les erreurs
if ($link){
$res = @da_sql_query($link,$config,$sql); // on affiche pas les erreurs
if ($res){
while(($row = @da_sql_fetch_array($res,$config))){
if ($row['attribute'] == "Filter-Id") $filter_id = $row['value']; // on obtient le Filter-Id de l'utilisateur
}
if($filter_id[3] == '1')
{
#set the fourth bit of filter-id to '0'
$sql = "set @CurrentFilter=(SELECT value from radreply where username='$user_uid');set @CurrentFilterLeft=(SELECT LEFT(@CurrentFilter,3));set @CurrentFilterRight=(SELECT RIGHT(@CurrentFilter,4));UPDATE radreply SET value = CONCAT((@CurrentFilterLeft),'0', (@CurrentFilterRight)) WHERE username='$user_uid'";
$res = mysqli_multi_query($link,$sql);
header("Location: http://alcasar/index.php?warn=1&url=$user_url"); //we present to user information about imputability logs
exit;
}
}
}
}
}
 
 
# Otherwise it was not a form request
# Send out an error message
if ($result == 0) { //erreur