get_ActiveTypes(); $profileClasses = array(); for ($i = 0; $i < sizeof($types); $i++) { $profileClasses[] = array( 'scope' => $types[$i], 'title' => getTypeAlias($types[$i]), 'profiles' => ""); } // check if user is logged in, if not go to login if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) { metaRefresh("../login.php"); exit; } // on abort go back to main page if (isset($_POST['abort'])) { metaRefresh("../tools.php"); exit; } // check if user has pressed submit button elseif (isset($_POST['submit'])) { // forward to other profile pages if ($_POST['submit']) { for ($i = 0; $i < sizeof($profileClasses); $i++) { // create new profile if ($_POST['profile'] == ("new" . $profileClasses[$i]['scope'])) { metaRefresh("profilepage.php?type=" . $profileClasses[$i]['scope']); } // edit profile elseif($_POST['profile'] == ("edit" . $profileClasses[$i]['scope'])) { metaRefresh("profilepage.php?type=" . $profileClasses[$i]['scope'] . "&edit=" . $_POST['e_' . $profileClasses[$i]['scope']]); } // delete profile elseif($_POST['profile'] == ("del" . $profileClasses[$i]['scope'])) { metaRefresh("profiledelete.php?type=" . $profileClasses[$i]['scope'] . "&del=" . $_POST['d_' . $profileClasses[$i]['scope']]); } } } exit; } // get list of profiles for each account type for ($i = 0; $i < sizeof($profileClasses); $i++) { $profileList = getAccountProfiles($profileClasses[$i]['scope']); $profiles = ""; for ($l = 0; $l < sizeof($profileList); $l++) { $profiles = $profiles . "\n"; } $profileClasses[$i]['profiles'] = $profiles; } echo $_SESSION['header']; echo "