Line 123... |
Line 123... |
123 |
|
123 |
|
124 |
/********************************************************
|
124 |
/********************************************************
|
125 |
* Redémarage des service *
|
125 |
* Redémarage des service *
|
126 |
*********************************************************/
|
126 |
*********************************************************/
|
127 |
|
127 |
|
128 |
if ($auth_enable == "1"){
|
128 |
if ($auth_enable == "1") {
|
- |
|
129 |
if (!preg_match('/^[A-Za-z0-9_\-\.]+$/', $ldap_server)) {
|
- |
|
130 |
exit('Invalid LDAP server.');
|
- |
|
131 |
}
|
129 |
file_put_contents(ALCASAR_CONF_FILE, str_replace('LDAP=off', 'LDAP=on', file_get_contents(ALCASAR_CONF_FILE)));
|
132 |
file_put_contents(ALCASAR_CONF_FILE, str_replace('LDAP=off', 'LDAP=on', file_get_contents(ALCASAR_CONF_FILE)));
|
130 |
exec("sudo sed -i \"s/^LDAP_IP=.*/LDAP_IP=$ldap_server/g\" ALCASAR_CONF_FILE");}
|
133 |
exec("sed -i \"s/^LDAP_IP=.*/LDAP_IP=$ldap_server/g\" ALCASAR_CONF_FILE");
|
- |
|
134 |
}
|
131 |
else {
|
135 |
else {
|
132 |
file_put_contents(ALCASAR_CONF_FILE, str_replace('LDAP=on', 'LDAP=off', file_get_contents(ALCASAR_CONF_FILE)));
|
136 |
file_put_contents(ALCASAR_CONF_FILE, str_replace('LDAP=on', 'LDAP=off', file_get_contents(ALCASAR_CONF_FILE)));
|
133 |
exec("sudo sed -i \"s/^LDAP_IP=.*/LDAP_IP=0.0.0.0/g\" ALCASAR_CONF_FILE");}
|
137 |
exec("sed -i \"s/^LDAP_IP=.*/LDAP_IP=0.0.0.0/g\" ALCASAR_CONF_FILE");
|
- |
|
138 |
}
|
134 |
exec ("sudo /usr/local/bin/alcasar-iptables.sh");
|
139 |
exec("sudo /usr/local/bin/alcasar-iptables.sh");
|
135 |
exec ("sudo /usr/bin/systemctl restart radiusd");
|
140 |
exec("sudo /usr/bin/systemctl restart radiusd");
|
136 |
|
141 |
|
137 |
/****************************************************************
|
142 |
/****************************************************************
|
138 |
* Redirection vers la page de configuration LDAP *
|
143 |
* Redirection vers la page de configuration LDAP *
|
139 |
*****************************************************************/
|
144 |
*****************************************************************/
|
140 |
|
145 |
|
141 |
header('Location:ldap.php?update=ok');
|
146 |
header('Location:ldap.php?update=ok');
|
142 |
exit();
|
147 |
exit();
|
143 |
?>
|
- |
|