Line 128... |
Line 128... |
128 |
if ($auth_enable == "1") {
|
128 |
if ($auth_enable == "1") {
|
129 |
if (!preg_match('/^[A-Za-z0-9_\-\.]+$/', $ldap_server)) {
|
129 |
if (!preg_match('/^[A-Za-z0-9_\-\.]+$/', $ldap_server)) {
|
130 |
exit('Invalid LDAP server.');
|
130 |
exit('Invalid LDAP server.');
|
131 |
}
|
131 |
}
|
132 |
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)));
|
133 |
exec("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 |
}
|
134 |
}
|
135 |
else {
|
135 |
else {
|
136 |
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)));
|
137 |
exec("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 |
}
|
138 |
}
|
139 |
exec("sudo /usr/local/bin/alcasar-iptables.sh");
|
139 |
exec("sudo /usr/local/bin/alcasar-iptables.sh");
|
140 |
exec("sudo /usr/bin/systemctl restart radiusd");
|
140 |
exec("sudo /usr/bin/systemctl restart radiusd");
|
141 |
|
141 |
|
142 |
/****************************************************************
|
142 |
/****************************************************************
|