Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1507 → Rev 1508

/alcasar.sh
1308,7 → 1308,7
$SED "s?^Group.*?Group tinyproxy?g" /etc/tinyproxy/tinyproxy.conf
$SED "s?^Port.*?Port 8090?g" /etc/tinyproxy/tinyproxy.conf # Listen Port
$SED "s?^#Listen.*?Listen $PRIVATE_IP?g" /etc/tinyproxy/tinyproxy.conf # Listen NIC (only intif)
$SED "s?^#LogFile.*?LogFile /var/log/tinyproxy/tinyproxy.log?g" /etc/tinyproxy/tinyproxy.conf
$SED "s?^#LogFile.*?LogFile \"/var/log/tinyproxy/tinyproxy.log\"?g" /etc/tinyproxy/tinyproxy.conf
$SED "s?^LogLevel.*?LogLevel Error?g" /etc/tinyproxy/tinyproxy.conf # Only errors are logged
$SED "s?^#Upstream.*?Upstream 127.0.0.1:8090?g" /etc/tinyproxy/tinyproxy.conf # forward to HAVP
$SED "s?^#DisableViaHeader.*?DisableViaHeader Yes?g" /etc/tinyproxy/tinyproxy.conf # Stealth mode
/scripts/sbin/alcasar-bypass.sh
50,7 → 50,7
/usr/bin/systemctl start chilli
sh /usr/local/bin/alcasar-iptables.sh
echo "L'authentification et le filtrage sont actifs"
echo "Authentication ans filterig system are enabled"
echo "Authentication and filtering system are enabled"
;;
*)
echo "Argument inconnu :$1";
/web/acc/admin/services.php
27,7 → 27,7
$l_freshclam = "Mise à jour de l'antivirus toutes les 2 heures";
$l_ntpd = "Service de mise à l'heure réseau";
$l_havp = "Proxy Antivirus 1";
$l_havp2 = "Proxy Antivirus 2";
$l_tinyproxy = "Proxy HTTP léger";
$l_dnsmasq = "Serveur DNS et DHCP";
$l_dnsmasq_blacklist = "Serveur DNS pour la Blacklist";
$l_dnsmasq_whitelist = "Serveur DNS pour la Whitelist";
57,7 → 57,7
$l_freshclam = "WEB antivirus update (every 2 hours)";
$l_ntpd = "Network time";
$l_havp = "Antivirus Proxy 1";
$l_havp2 = "Antivirus Proxy 2";
$l_tinyproxy = "Light HTTP Proxy";
$l_dnsmasq = "DNS and DHCP server";
$l_dnsmasq_blacklist = "DNS server for the Blacklist";
$l_dnsmasq_whitelist = "DNS server for the Whitelist";
122,7 → 122,7
// Les actions sur un service
//-------------------------------
//sécurité sur les actions à réaliser
$autorizeService = array("radiusd","chilli","dansguardian","mysqld","httpd","sshd","freshclam","ntpd","havp","havp2","dnsmasq","dnsmasq-blacklist","dnsmasq-whitelist","dnsmasq-blackhole");
$autorizeService = array("radiusd","chilli","dansguardian","mysqld","httpd","sshd","freshclam","ntpd","havp","tinyproxy","dnsmasq","dnsmasq-blacklist","dnsmasq-whitelist","dnsmasq-blackhole");
$autorizeAction = array("start","stop","restart");
 
if (isset($_GET['service'])&&(in_array($_GET['service'], $autorizeService))) {
150,7 → 150,7
$FilterServiceStatus['dnsmasq_blackhole'] = checkServiceStatus("dnsmasq-blackhole");
$filterServiceStatus['dansguardian'] = checkServiceStatus("dansguardian");
$FilterServiceStatus['havp'] = checkServiceStatus("havp");
$FilterServiceStatus['havp2'] = checkServiceStatus("havp2");
$FilterServiceStatus['tinyproxy'] = checkServiceStatus("tinyproxy");
$FilterServiceStatus['freshclam'] = checkServiceStatus("freshclam");
 
 
/web/acc/manager/htdocs/import_user.php
7,7 → 7,7
</HEAD>
<body>
<?php
# Choice of language
// Choice of language
$Language = 'en';
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
74,7 → 74,7
}
function GenPassword($nb_car="8")
{
/* generation aléatoire du mot de passe */
// Random password
$password = "";
$chaine = "aAzZeErRtTyYuUIopP152346897mMLkK";
$chaine .= "jJhHgGfFdDsSqQwWxXcCvVbBnN152346897";
122,7 → 122,7
{
exec ("sudo /usr/local/sbin/alcasar-mysql.sh --raz");
}
# un fichier est importé
// a file is downloaded
if(isset($_FILES['import-users']) && ($_FILES['import-users']['name'] !=""))
{
unset($result);
130,11 → 130,10
if (isset ($_POST['groupe'])) $group = $_POST ['groupe'];
$destination = '/tmp/import_file.txt';
list($file_name , $extension) = explode("." , $_FILES['import-users']['name']);
$extension = strstr($_FILES['import-users']['name'], '.');
if ($choix == "csv")
//import d'un fichier txt
echo "choix = ".$choix.", service = ".$service.", groupe = ".$group.", file_name = ".$file_name.", extension = ".$extension;
if ($choix == "csv") // import of a txt file
{
if (($extension != '.csv') && ($extension != '.txt')) $result = $l_error_ext_txt;
if (($extension != 'csv') && ($extension != 'txt')) $result = $l_error_ext_txt;
else
{
exec ("sudo /usr/local/sbin/alcasar-mysql.sh --dump");
167,7 → 166,7
$login = da_sql_escape_string($login);
$passwd = da_sql_escape_string($passwd);
$passwd = da_encrypt($password);
/* insertion (login + password) dans la table "radcheck" (si l'usager existe --> changement de mot de passe) */
// insertion (login + password) dans la table "radcheck" (si l'usager existe --> changement de mot de passe)
$res = @da_sql_query($link,$config,"INSERT INTO $config[sql_check_table] (attribute,value,username $text) VALUES ('$config[sql_password_attribute]','$passwd','$login' $passwd_op);");
if (!$res || !@da_sql_affected_rows($link,$res,$config))
{
176,7 → 175,7
}
else
{
/* create the user informations file */
// create the user informations file
fputs($RS_out,"$l_out_title\r\n\r\n");
if ($service != "" ) { fputs($RS_out,"Service : $service\r\n\r\n");}
fputs($RS_out,"$l_out_login $login | $l_out_passwd $password\r\n\r\n");
183,7 → 182,7
fputs($RS_out,"$l_out_mind\r\n\r\n");
fputs($RS_out,"--------------------------------------------------------------------------------\r\n\r\n");
}
/* insertion de l'usager dans la table "userinfo" */
// insertion de l'usager dans la table "userinfo"
if ($config[sql_use_user_info_table] == 'true' && !$da_abort)
{
$res = @da_sql_query($link,$config, "SELECT username FROM $config[sql_user_info_table] WHERE username = '$login';");
217,24 → 216,24
} # end if
else
echo "<b>Could not add user to group $group: " . da_sql_error($link,$config) . "</b><br>\n";
} # end if ($group)
} # end if ($config)
} # end if ($login !='')
} # end foreach
} // end if ($group)
} // end if ($config)
} // end if ($login !='')
} // end foreach
fclose($RS_out);
} # end if (is file)
} # end if (link)
} // end if (is file)
} // end if (link)
}
}
else if ($choix == "bdd")
//import d'une Bdd
else if ($choix == "bdd") // database import
{
if ($extension != '.sql') $result = $l_error_ext_sql;
if ($extension != 'sql') $result = $l_error_ext_sql;
else
{
exec ("sudo /usr/local/sbin/alcasar-mysql.sh --dump");
move_uploaded_file($_FILES['import-users']['tmp_name'], $destination);
exec ("sudo /usr/local/sbin/alcasar-mysql.sh --import $destination");
echo "OK : $destination";
}
}
}
/web/index.php
315,23 → 315,11
<img src="'.$img_rep.''.$img_sms.'">
</div>
';
 
$sms_div='
<div class="box_menu" id="box_acc" onmouseover="valoriserDiv5(text_acc);">
<span>'.$l_sms_access.'</span>
<img src="'.$img_rep.''.$img_sms.'">
</div>
';
 
$sms_div_over='
<div class="div-cache" id="text_acc">
<h2>'.$l_sms_access.'</h2>
<p>'.$l_sms_explain.'</p>
<p><font color="red"><center>'.$l_service_sms_n.'</center></font></p>
<img src="'.$img_rep.''.$img_sms.'">
</div>
';
}
else {
$sms_div='';
$sms_div_over='';
}
?>
<?php
if ($direct_access){