Subversion Repositories ALCASAR

Rev

Rev 2653 | Rev 2691 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2653 Rev 2654
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: group_new.php 2653 2018-11-04 02:05:54Z tom.houdayer $
2
# $Id: group_new.php 2654 2018-11-04 02:11:25Z tom.houdayer $
3
 
3
 
4
//Gestion de la langue
4
//Gestion de la langue
5
if (is_file("../lib/langues.php"))
5
if (is_file("../lib/langues.php"))
6
	include("../lib/langues.php");
6
	include("../lib/langues.php");
7
 
7
 
Line 122... Line 122...
122
		echo <<<EOM
122
		echo <<<EOM
123
<b><i>$login</i> $l_already_exist</b>
123
<b><i>$login</i> $l_already_exist</b>
124
EOM;
124
EOM;
125
	}
125
	}
126
	else{
126
	else{
-
 
127
		$Members = preg_split("/[\n\s]+/",$members,-1,PREG_SPLIT_NO_EMPTY);
-
 
128
		$group_macs = [];
-
 
129
		if (!empty($Members)){
-
 
130
			foreach ($Members as $member){
-
 
131
				$mac = exec('sudo /usr/sbin/chilli_query list | awk '.escapeshellarg('($5 == 1) && ($6 == "'.$member.'") {print $1}'));
-
 
132
				if (!empty($mac)) {
-
 
133
					exec('sudo /usr/sbin/chilli_query logout mac '.escapeshellarg($mac));
-
 
134
					if ($member === $mac) {
-
 
135
						$group_macs[] = $mac;
-
 
136
					}
-
 
137
				}
-
 
138
			}
-
 
139
		}
-
 
140
 
127
		if (is_file("../lib/$config[general_lib_type]/create_group.php"))
141
		if (is_file("../lib/$config[general_lib_type]/create_group.php"))
128
			include("../lib/$config[general_lib_type]/create_group.php");
142
			include("../lib/$config[general_lib_type]/create_group.php");
129
		if (is_file("../lib/$config[general_lib_type]/group_info.php"))
143
		if (is_file("../lib/$config[general_lib_type]/group_info.php"))
130
			include("../lib/$config[general_lib_type]/group_info.php");
144
			include("../lib/$config[general_lib_type]/group_info.php");
-
 
145
 
-
 
146
		// Reconnect allowed MAC from the selected group
-
 
147
		foreach ($group_macs as $mac) {
-
 
148
			exec('sudo /usr/sbin/chilli_query login mac '.escapeshellarg($mac).' username '.escapeshellarg($mac)." password 'password'");
-
 
149
		}
131
	}
150
	}
132
}
151
}
133
if ($create == 0){
152
if ($create == 0){
134
?>
153
?>
135
   <form name="newgroup" method="post" class="">
154
   <form name="newgroup" method="post" class="">