get_ActiveTypes(); $profileClasses = array(); $profileClassesTemp = array(); for ($i = 0; $i < sizeof($types); $i++) { $profileClassesTemp[getTypeAlias($types[$i])] = array( 'scope' => $types[$i], 'title' => getTypeAlias($types[$i]), 'profiles' => ""); } $profileClassesKeys = array_keys($profileClassesTemp); natcasesort($profileClassesKeys); $profileClassesKeys = array_values($profileClassesKeys); for ($i = 0; $i < sizeof($profileClassesKeys); $i++) { $profileClasses[] = $profileClassesTemp[$profileClassesKeys[$i]]; } // check if user is logged in, if not go to login if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) { metaRefresh("../login.php"); exit; } // check if new profile should be created elseif (isset($_POST['createProfileButton'])) { metaRefresh("profilepage.php?type=" . $_POST['createProfile']); exit; } // check if a profile should be edited for ($i = 0; $i < sizeof($profileClasses); $i++) { if (isset($_POST['editProfile_' . $profileClasses[$i]['scope']]) || isset($_POST['editProfile_' . $profileClasses[$i]['scope'] . '_x'])) { metaRefresh("profilepage.php?type=" . $profileClasses[$i]['scope'] . "&edit=" . $_POST['profile_' . $profileClasses[$i]['scope']]); exit; } } // check if a profile should be deleted for ($i = 0; $i < sizeof($profileClasses); $i++) { if (isset($_POST['deleteProfile_' . $profileClasses[$i]['scope']]) || isset($_POST['deleteProfile_' . $profileClasses[$i]['scope'] . '_x'])) { metaRefresh("profiledelete.php?type=" . $profileClasses[$i]['scope'] . "&del=" . $_POST['profile_' . $profileClasses[$i]['scope']]); exit; } } // get list of profiles for each account type for ($i = 0; $i < sizeof($profileClasses); $i++) { $profileList = getAccountProfiles($profileClasses[$i]['scope']); natcasesort($profileList); $profiles = ""; foreach ($profileList as $p) { $profiles = $profiles . "\n"; } $profileClasses[$i]['profiles'] = $profiles; } include '../main_header.php'; echo "

" . _('Profile editor') . "

\n"; if (isset($_GET['savedSuccessfully'])) { StatusMessage("INFO", _("Profile was saved."), htmlspecialchars($_GET['savedSuccessfully'])); } if (isset($_GET['deleteFailed'])) { StatusMessage('ERROR', _('Unable to delete profile!'), getTypeAlias($_GET['deleteScope']) . ': ' . htmlspecialchars($_GET['deleteFailed'])); } if (isset($_GET['deleteSucceeded'])) { StatusMessage('INFO', _('Deleted profile.'), getTypeAlias($_GET['deleteScope']) . ': ' . htmlspecialchars($_GET['deleteSucceeded'])); } echo "
\n"; echo "
\n"; // new profile echo "
\n"; echo "\n"; echo "" . _('Create a new profile') . "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo ""; echo "
\n"; echo "
\n"; echo "
\n"; // existing profiles echo "
\n"; echo "\n"; echo "" . _('Manage existing profiles') . "\n"; echo "\n"; echo "
\n"; for ($i = 0; $i < sizeof($profileClasses); $i++) { if ($i > 0) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "
 
"; echo "\"" \n"; echo $profileClasses[$i]['title']; echo " "; echo "\n"; echo " "; echo ""; echo " "; echo ""; echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; include '../main_footer.php'; ?>