Line 1... |
Line 1... |
1 |
<?php
|
1 |
<?php
|
2 |
# $Id: ldap.php 2462 2017-12-15 14:26:24Z tom.houdayer $
|
2 |
# $Id: ldap.php 2465 2017-12-17 23:00:14Z richard $
|
3 |
|
3 |
|
4 |
/* written by steweb57, Rexy & Tom HOUDAYER */
|
4 |
/* written by steweb57, Rexy & Tom HOUDAYER */
|
5 |
/****************************************************************
|
5 |
/****************************************************************
|
6 |
* GLOBAL FILE PATHS *
|
6 |
* GLOBAL FILE PATHS *
|
7 |
*****************************************************************/
|
7 |
*****************************************************************/
|
Line 174... |
Line 174... |
174 |
if (!empty($varErrors)) {
|
174 |
if (!empty($varErrors)) {
|
175 |
foreach ($varErrors as $error) {
|
175 |
foreach ($varErrors as $error) {
|
176 |
$messages .= '<span style="font-weight: bold; color: red;">'.$error.'</span><br>';
|
176 |
$messages .= '<span style="font-weight: bold; color: red;">'.$error.'</span><br>';
|
177 |
}
|
177 |
}
|
178 |
} else {
|
178 |
} else {
|
179 |
exec('sed -i \'s/^LDAP=.*/LDAP=on/g\' '.CONF_FILE);
|
- |
|
180 |
exec('sed -i '.escapeshellarg("s/^LDAP_SERVER=.*/LDAP_SERVER=$ldap_server/g").' '.CONF_FILE);
|
179 |
exec('sed -i '.escapeshellarg("s/^LDAP_SERVER=.*/LDAP_SERVER=$ldap_server/g").' '.CONF_FILE);
|
181 |
exec('sed -i '.escapeshellarg("s/^LDAP_BASE=.*/LDAP_BASE=$ldap_base_dn/g").' '.CONF_FILE);
|
180 |
exec('sed -i '.escapeshellarg("s/^LDAP_BASE=.*/LDAP_BASE=$ldap_base_dn/g").' '.CONF_FILE);
|
182 |
exec('sed -i '.escapeshellarg("s/^LDAP_UID=.*/LDAP_UID=$ldap_uid/g").' '.CONF_FILE);
|
181 |
exec('sed -i '.escapeshellarg("s/^LDAP_UID=.*/LDAP_UID=$ldap_uid/g").' '.CONF_FILE);
|
183 |
exec('sed -i '.escapeshellarg("s/^LDAP_FILTER=.*/LDAP_FILTER=$ldap_base_filter/g").' '.CONF_FILE);
|
182 |
exec('sed -i '.escapeshellarg("s/^LDAP_FILTER=.*/LDAP_FILTER=$ldap_base_filter/g").' '.CONF_FILE);
|
184 |
exec('sed -i '.escapeshellarg("s/^LDAP_USER=.*/LDAP_USER=$ldap_user/g").' '.CONF_FILE);
|
183 |
exec('sed -i '.escapeshellarg("s/^LDAP_USER=.*/LDAP_USER=$ldap_user/g").' '.CONF_FILE);
|
185 |
exec('sed -i '.escapeshellarg("s/^LDAP_PASSWORD=.*/LDAP_PASSWORD=$ldap_password/g").' '.CONF_FILE);
|
184 |
exec('sed -i '.escapeshellarg("s/^LDAP_PASSWORD=.*/LDAP_PASSWORD=$ldap_password/g").' '.CONF_FILE);
|
- |
|
185 |
exec('sed -i \'s/^LDAP=.*/LDAP=on/g\' '.CONF_FILE);
|
186 |
exec('sudo /usr/local/bin/alcasar-ldap.sh --on');
|
186 |
exec('sudo /usr/local/bin/alcasar-ldap.sh --on');
|
187 |
$messages .= '<span style="font-weight: bold; color: green;">'.$l_ldap_update.'</span><br>';
|
187 |
$messages .= '<span style="font-weight: bold; color: green;">'.$l_ldap_update.'</span><br>';
|
188 |
}
|
188 |
}
|
189 |
} else {
|
189 |
} else {
|
190 |
exec('sed -i "s/^LDAP=.*/LDAP=off/g" '.CONF_FILE);
|
190 |
exec('sed -i "s/^LDAP=.*/LDAP=off/g" '.CONF_FILE);
|