Line 17... |
Line 17... |
17 |
* along with this program; if not, write to the *
|
17 |
* along with this program; if not, write to the *
|
18 |
* Free Software Foundation, Inc., *
|
18 |
* Free Software Foundation, Inc., *
|
19 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
19 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
20 |
***************************************************************************/
|
20 |
***************************************************************************/
|
21 |
|
21 |
|
22 |
// $Id: portail.php 2171 2017-04-21 17:39:13Z tom.houdayer $
|
22 |
// $Id: portail.php 2182 2017-04-25 22:10:46Z tom.houdayer $
|
23 |
|
23 |
|
24 |
// xml_utilisateur()
|
24 |
// xml_utilisateur()
|
25 |
|
25 |
|
26 |
function request ($texte) {
|
26 |
function request ($texte) {
|
27 |
$strResult = 0;
|
27 |
$strResult = 0;
|
28 |
// Déclaration des paramètres de connexion
|
28 |
// Déclaration des paramètres de connexion
|
29 |
$host = "localhost";
|
29 |
$host = "localhost";
|
30 |
$DB_USER = "radius";
|
30 |
$DB_USER = "radius";
|
31 |
$DB_RADIUS = "radius";
|
31 |
$DB_RADIUS = "radius";
|
32 |
$radiuspwd = "J7YI65SW";
|
32 |
$radiuspwd = "";
|
33 |
// Connexion au serveur
|
33 |
// Connexion au serveur
|
34 |
$mysqli = new mysqli($host, $DB_USER, $radiuspwd, $DB_RADIUS);
|
34 |
$mysqli = new mysqli($host, $DB_USER, $radiuspwd, $DB_RADIUS);
|
35 |
if ($texte == 'user') {$query = "SELECT UserName FROM userinfo";}
|
35 |
if ($texte == 'user') {$query = "SELECT UserName FROM userinfo";}
|
36 |
else { $query = "SELECT GroupName FROM radusergroup GROUP BY GroupName";}
|
36 |
else { $query = "SELECT GroupName FROM radusergroup GROUP BY GroupName";}
|
37 |
$result = $mysqli->query($query);
|
37 |
$result = $mysqli->query($query);
|
Line 96... |
Line 96... |
96 |
// html_portail()
|
96 |
// html_portail()
|
97 |
function html_portail () {
|
97 |
function html_portail () {
|
98 |
global $webpath;
|
98 |
global $webpath;
|
99 |
global $XPath;
|
99 |
global $XPath;
|
100 |
global $text;
|
100 |
global $text;
|
- |
|
101 |
|
- |
|
102 |
// Read CONF_FILE
|
- |
|
103 |
define ('CONF_FILE', '/usr/local/etc/alcasar.conf');
|
- |
|
104 |
$file_conf = fopen(CONF_FILE, 'r');
|
- |
|
105 |
if (!$file_conf) {
|
- |
|
106 |
exit('Error opening the file '.CONF_FILE);
|
- |
|
107 |
}
|
- |
|
108 |
while (!feof($file_conf)) {
|
- |
|
109 |
$tampon = fgets($file_conf, 4096);
|
- |
|
110 |
if ((strpos($tampon, '=') !== false) && (substr($tampon, 0, 1) !== '#')) {
|
- |
|
111 |
$tmp = explode('=', $tampon);
|
- |
|
112 |
$conf[$tmp[0]] = trim($tmp[1]);
|
- |
|
113 |
}
|
- |
|
114 |
}
|
- |
|
115 |
fclose($file_conf);
|
- |
|
116 |
|
101 |
exec ("sudo /usr/local/bin/alcasar-watchdog.sh -lt");
|
117 |
exec ("sudo /usr/local/bin/alcasar-watchdog.sh -lt");
|
102 |
// Get current version
|
118 |
// Get current version
|
103 |
$INSTALLEDVERSION = trim(exec("grep ^VERSION /usr/local/etc/alcasar.conf | cut -d'=' -f2"));
|
119 |
$INSTALLEDVERSION = $conf['VERSION'];
|
104 |
$VERSIONBL = date ("F d Y", filemtime ('/etc/dansguardian/lists/blacklists/README'));
|
120 |
$VERSIONBL = date ("F d Y", filemtime ('/etc/dansguardian/lists/blacklists/README'));
|
105 |
$nbr_user = request ('user');
|
121 |
$nbr_user = request ('user');
|
106 |
$nbr_grp = request ('group');
|
122 |
$nbr_grp = request ('group');
|
107 |
$nbr_user_online = exec ("sudo /usr/sbin/chilli_query list | cut -d\" \" -f5 | grep \"1\" | wc -l");
|
123 |
$nbr_user_online = exec ("sudo /usr/sbin/chilli_query list | cut -d\" \" -f5 | grep \"1\" | wc -l");
|
108 |
if ((filtrageTest("/var/www/html/index.php","/network_pb = False/")) && (internetTest($INSTALLEDVERSION))){
|
124 |
if ((filtrageTest("/var/www/html/index.php","/network_pb = False/")) && (internetTest($INSTALLEDVERSION))){
|