refactoring
This commit is contained in:
parent
f1decc1f4c
commit
fce8908a72
|
@ -92,19 +92,21 @@ if (isset($_POST['add_suff']) || isset($_POST['cancel'])) {
|
||||||
if (!@ldap_add($_SESSION['ldap']->server(), $dn, $attr)) {
|
if (!@ldap_add($_SESSION['ldap']->server(), $dn, $attr)) {
|
||||||
// check if we have to add parent entries
|
// check if we have to add parent entries
|
||||||
if (ldap_errno($_SESSION['ldap']->server()) == 32) {
|
if (ldap_errno($_SESSION['ldap']->server()) == 32) {
|
||||||
$temp = explode(",", $suff);
|
$dnParts = explode(",", $suff);
|
||||||
$subsuffs = array();
|
$subsuffs = array();
|
||||||
// make list of subsuffixes
|
// make list of subsuffixes
|
||||||
for ($k = 0; $k < sizeof($temp); $k++) {
|
$dnPartsCount = sizeof($dnParts);
|
||||||
$part = explode("=", $temp[$k]);
|
for ($k = 0; $k < $dnPartsCount; $k++) {
|
||||||
if ($part[0] == "ou") $subsuffs[] = implode(",", array_slice($temp, $k));
|
$part = explode("=", $dnParts[$k]);
|
||||||
|
if ($part[0] == "ou") $subsuffs[] = implode(",", array_slice($dnParts, $k));
|
||||||
else {
|
else {
|
||||||
$subsuffs[] = implode(",", array_slice($temp, $k));
|
$subsuffs[] = implode(",", array_slice($dnParts, $k));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// create missing entries
|
// create missing entries
|
||||||
for ($k = sizeof($subsuffs) - 1; $k >= 0; $k--) {
|
$subsuffCount = sizeof($subsuffs);
|
||||||
|
for ($k = $subsuffCount - 1; $k >= 0; $k--) {
|
||||||
// check if subsuffix is present
|
// check if subsuffix is present
|
||||||
$info = ldap_read($_SESSION['ldap']->server(), escapeDN($subsuffs[$k]), "objectclass=*", array('dn'), 0, 0, 0, LDAP_DEREF_NEVER);
|
$info = ldap_read($_SESSION['ldap']->server(), escapeDN($subsuffs[$k]), "objectclass=*", array('dn'), 0, 0, 0, LDAP_DEREF_NEVER);
|
||||||
$res = ldap_get_entries($_SESSION['ldap']->server(), $info);
|
$res = ldap_get_entries($_SESSION['ldap']->server(), $info);
|
||||||
|
|
|
@ -294,9 +294,9 @@ function display_LoginPage(LAMConfig $config_object, LAMCfgMain $cfgMain, $licen
|
||||||
if (!empty($config_object)) {
|
if (!empty($config_object)) {
|
||||||
// check extensions
|
// check extensions
|
||||||
$extList = getRequiredExtensions();
|
$extList = getRequiredExtensions();
|
||||||
for ($i = 0; $i < sizeof($extList); $i++) {
|
foreach ($extList as $extension) {
|
||||||
if (!extension_loaded($extList[$i])) {
|
if (!extension_loaded($extension)) {
|
||||||
StatusMessage("ERROR", "A required PHP extension is missing!", $extList[$i]);
|
StatusMessage("ERROR", "A required PHP extension is missing!", $extension);
|
||||||
echo "<br>";
|
echo "<br>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -369,14 +369,14 @@ function display_LoginPage(LAMConfig $config_object, LAMCfgMain $cfgMain, $licen
|
||||||
if ($config_object->getLoginMethod() == LAMConfig::LOGIN_LIST) {
|
if ($config_object->getLoginMethod() == LAMConfig::LOGIN_LIST) {
|
||||||
$admins = $config_object->get_Admins();
|
$admins = $config_object->get_Admins();
|
||||||
$adminList = array();
|
$adminList = array();
|
||||||
for($i = 0; $i < count($admins); $i++) {
|
foreach ($admins as $admin) {
|
||||||
$text = explode(",", $admins[$i]);
|
$text = explode(",", $admin);
|
||||||
$text = explode("=", $text[0]);
|
$text = explode("=", $text[0]);
|
||||||
if (isset($text[1])) {
|
if (isset($text[1])) {
|
||||||
$adminList[$text[1]] = $admins[$i];
|
$adminList[$text[1]] = $admin;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$adminList[$text[0]] = $admins[$i];
|
$adminList[$text[0]] = $admin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$selectedAdmin = array();
|
$selectedAdmin = array();
|
||||||
|
|
|
@ -144,16 +144,6 @@ if (isset($_POST['submit'])) {
|
||||||
foreach ($cssFiles as $cssEntry) {
|
foreach ($cssFiles as $cssEntry) {
|
||||||
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/" . $cssEntry . "\">\n";
|
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/" . $cssEntry . "\">\n";
|
||||||
}
|
}
|
||||||
if (isset($profile->additionalCSS) && ($profile->additionalCSS != '')) {
|
|
||||||
$CSSlinks = explode("\n", $profile->additionalCSS);
|
|
||||||
for ($i = 0; $i < sizeof($CSSlinks); $i++) {
|
|
||||||
$CSSlinks[$i] = trim($CSSlinks[$i]);
|
|
||||||
if ($CSSlinks[$i] == '') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $CSSlinks[$i] . "\">\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
</head>
|
</head>
|
||||||
<body class="admin">
|
<body class="admin">
|
||||||
|
|
Loading…
Reference in New Issue