get_Passwd()) { require('conflogin.php'); exit; } // user pressed submit/abort button if ($_POST['submit']) { //selection ok, back to other settings metarefresh('confmain.php?modulesback=true&moduleschanged=true'); } elseif ($_POST['abort']) { // no changes metarefresh('confmain.php?modulesback=true'); } echo $_SESSION['header']; echo "" . _("LDAP Account Manager Configuration") . "\n"; echo "\n"; echo "\n"; echo ("

". "\"LDAP



\n"); echo ("
\n"); echo "

" . _("Module selection") . "

"; // user modules $selected_users_temp = $_SESSION['conf_usermodules']; $available_users = array(); $available_users = getAvailableModules('user'); $selected_users = array(); // only use available modules as selected for ($i = 0; $i < sizeof($selected_users_temp); $i++) { if (in_array($selected_users_temp[$i], $available_users)) $selected_users[] = $selected_users_temp[$i]; } $no_conflicts_user = true; $no_depends_user = true; $no_missing_basemodule_user = true; // remove modules from selection if ($_POST['user_selected'] && ($_POST['user_remove'])) { $new_selected_users = array(); for ($i = 0; $i < sizeof($selected_users); $i++) { if (! in_array($selected_users[$i], $_POST['user_selected'])) $new_selected_users[] = $selected_users[$i]; } $selected_users = $new_selected_users; $_SESSION['conf_usermodules'] = $selected_users; } // add modules to selection elseif ($_POST['user_available'] && ($_POST['user_add'])) { $new_selected_users = $selected_users; for ($i = 0; $i < sizeof($_POST['user_available']); $i++) { if (! in_array($_POST['user_available'][$i], $selected_users)) $new_selected_users[] = $_POST['user_available'][$i]; } $selected_users = $new_selected_users; $_SESSION['conf_usermodules'] = $selected_users; } // group modules $selected_groups_temp = $_SESSION['conf_groupmodules']; $available_groups = array(); $available_groups = getAvailableModules('group'); $selected_groups = array(); // only use available modules as selected for ($i = 0; $i < sizeof($selected_groups_temp); $i++) { if (in_array($selected_groups_temp[$i], $available_groups)) $selected_groups[] = $selected_groups_temp[$i]; } $no_conflicts_group = true; $no_depends_group = true; $no_missing_basemodule_group = true; // remove modules from selection if ($_POST['group_selected'] && ($_POST['group_remove'])) { $new_selected_groups = array(); for ($i = 0; $i < sizeof($selected_groups); $i++) { if (! in_array($selected_groups[$i], $_POST['group_selected'])) $new_selected_groups[] = $selected_groups[$i]; } $selected_groups = $new_selected_groups; $_SESSION['conf_groupmodules'] = $selected_groups; } // add modules to selection elseif ($_POST['group_available'] && ($_POST['group_add'])) { $new_selected_groups = $selected_groups; for ($i = 0; $i < sizeof($_POST['group_available']); $i++) { if (! in_array($_POST['group_available'][$i], $selected_groups)) $new_selected_groups[] = $_POST['group_available'][$i]; } $selected_groups = $new_selected_groups; $_SESSION['conf_groupmodules'] = $selected_groups; } // host modules $selected_hosts_temp = $_SESSION['conf_hostmodules']; $available_hosts = array(); $available_hosts = getAvailableModules('host'); $selected_hosts = array(); // only use available modules as selected for ($i = 0; $i < sizeof($selected_hosts_temp); $i++) { if (in_array($selected_hosts_temp[$i], $available_hosts)) $selected_hosts[] = $selected_hosts_temp[$i]; } $no_conflicts_host = true; $no_depends_host = true; $no_missing_basemodule_host = true; // remove modules from selection if ($_POST['host_selected'] && ($_POST['host_remove'])) { $new_selected_hosts = array(); for ($i = 0; $i < sizeof($selected_hosts); $i++) { if (! in_array($selected_hosts[$i], $_POST['host_selected'])) $new_selected_hosts[] = $selected_hosts[$i]; } $selected_hosts = $new_selected_hosts; $_SESSION['conf_hostmodules'] = $selected_hosts; } // add modules to selection elseif ($_POST['host_available'] && ($_POST['host_add'])) { $new_selected_hosts = $selected_hosts; for ($i = 0; $i < sizeof($_POST['host_available']); $i++) { if (! in_array($_POST['host_available'][$i], $selected_hosts)) $new_selected_hosts[] = $_POST['host_available'][$i]; } $selected_hosts = $new_selected_hosts; $_SESSION['conf_hostmodules'] = $selected_hosts; } // show user modules echo "
" . _("User modules") . "\n"; echo "\n"; // select boxes echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "" . _("Selected user modules") . "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "

"; echo ""; echo "
"; echo ""; echo "

\n"; echo "
\n"; echo "
\n"; echo "" . _("Available user modules") . "\n"; echo "\n"; echo "
\n"; echo "
\n"; // check dependencies $user_depends = check_module_depends($selected_users, getModulesDependencies('user')); if ($user_depends != false) { $no_depends_user = false; echo "

\n"; for ($i = 0; $i < sizeof($user_depends); $i++) { echo "" . _("Unsolved dependency: ") . "" . $user_depends[$i][0] . " (" . $user_depends[$i][1] . ")" . "
\n"; } echo "

\n"; } // check conflicts $user_conflicts = check_module_conflicts($selected_users, getModulesDependencies('user')); if ($user_conflicts != false) { $no_conflicts_user = false; echo "

\n"; for ($i = 0; $i < sizeof($user_conflicts); $i++) { echo "" . _("Conflicting module: ") . "" . $user_conflicts[$i][0] . " (" . $user_conflicts[$i][1] . ")" . "
\n"; } echo "

\n"; } // check for base module $found = false; for ($i = 0; $i < sizeof($selected_users); $i++) { if (is_base_module($selected_users[$i], "user")) { $found = true; break; } } if (! $found) { $no_missing_basemodule_user = false; echo "

\n"; echo "" . _("No base module selected!") . "
\n"; echo "

\n"; } echo "

\n"; echo "

\n"; // show group modules echo "
" . _("Group modules") . "\n"; echo "\n"; // select boxes echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "" . _("Selected group modules") . "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "

"; echo ""; echo "
"; echo ""; echo "

\n"; echo "
\n"; echo "
\n"; echo "" . _("Available group modules") . "\n"; echo "\n"; echo "
\n"; echo "
\n"; // check dependencies $group_depends = check_module_depends($selected_groups, getModulesDependencies('group')); if ($group_depends != false) { $no_depends_group = false; echo "

\n"; for ($i = 0; $i < sizeof($group_depends); $i++) { echo "" . _("Unsolved dependency: ") . "" . $group_depends[$i][0] . " (" . $group_depends[$i][1] . ")" . "
\n"; } echo "

\n"; } // check conflicts $group_conflicts = check_module_conflicts($selected_groups, getModulesDependencies('group')); if ($group_conflicts != false) { $no_conflicts_group = false; echo "

\n"; for ($i = 0; $i < sizeof($group_conflicts); $i++) { echo "" . _("Conflicting module: ") . "" . $group_conflicts[$i][0] . " (" . $group_conflicts[$i][1] . ")" . "
\n"; } echo "

\n"; } // check for base module $found = false; for ($i = 0; $i < sizeof($selected_groups); $i++) { if (is_base_module($selected_groups[$i], "group")) { $found = true; break; } } if (! $found) { $no_missing_basemodule_group = false; echo "

\n"; echo "" . _("No base module selected!") . "
\n"; echo "

\n"; } echo "

\n"; echo "

\n"; // show host modules echo "
" . _("Host modules") . "\n"; echo "\n"; // select boxes echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "" . _("Selected host modules") . "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "

"; echo ""; echo "
"; echo ""; echo "

\n"; echo "
\n"; echo "
\n"; echo "" . _("Available host modules") . "\n"; echo "\n"; echo "
\n"; echo "
\n"; // check dependencies $host_depends = check_module_depends($selected_hosts, getModulesDependencies('host')); if ($host_depends != false) { $no_depends_host = false; echo "

\n"; for ($i = 0; $i < sizeof($host_depends); $i++) { echo "" . _("Unsolved dependency: ") . "" . $host_depends[$i][0] . " (" . $host_depends[$i][1] . ")" . "
\n"; } echo "

\n"; } // check conflicts $host_conflicts = check_module_conflicts($selected_hosts, getModulesDependencies('host')); if ($host_conflicts != false) { $no_conflicts_host = false; echo "

\n"; for ($i = 0; $i < sizeof($host_conflicts); $i++) { echo "" . _("Conflicting module: ") . "" . $host_conflicts[$i][0] . " (" . $host_conflicts[$i][1] . ")" . "
\n"; } echo "

\n"; } // check for base module $found = false; for ($i = 0; $i < sizeof($selected_hosts); $i++) { if (is_base_module($selected_hosts[$i], "host")) { $found = true; break; } } if (! $found) { $no_missing_basemodule_host = false; echo "

\n"; echo "" . _("No base module selected!") . "
\n"; echo "

\n"; } echo "

\n"; // submit buttons echo "

\n"; // disable button if there are conflicts/depends if ($no_conflicts_user && $no_depends_user && $no_missing_basemodule_user && $no_conflicts_group && $no_depends_group && $no_missing_basemodule_group && $no_conflicts_host && $no_depends_host && $no_missing_basemodule_host) { echo "\n"; } else { echo "\n"; } echo " "; echo "\n"; echo "

\n"; echo "
\n"; echo "\n"; echo "\n"; ?>