getConfiguredType($_GET['type']); $DN = str_replace("\\'", '', $_GET['DN']); if ($type->isHidden()) { logNewMessage(LOG_ERR, 'User tried to access hidden account type: ' . $type->getId()); die(); } if ($_GET['DN'] == $DN) { if (substr($DN, 0, 1) === "'") { $DN = substr($DN, 1); } if (substr($DN, -1, 1) === "'") { $DN = substr($DN, 0, -1); } } $suffix = strtolower($type->getSuffix()); $DNlower = strtolower($DN); if (strpos($DNlower, $suffix) !== (strlen($DNlower) - strlen($suffix))) { logNewMessage(LOG_ERR, 'User tried to access entry of type ' . $type->getId() . ' outside suffix ' . $suffix); die(); } $_SESSION['account'] = new accountContainer($type, 'account', getRandomNumber()); $result = $_SESSION['account']->load_account($DN); if (sizeof($result) > 0) { include __DIR__ . '/../../lib/adminHeader.inc'; foreach ($result as $message) { call_user_func_array("StatusMessage", $message); } include __DIR__ . '/../../lib/adminFooter.inc'; die(); } } // new account else if (count($_POST) == 0) { $type = $typeManager->getConfiguredType($_GET['type']); if ($type->isHidden()) { logNewMessage(LOG_ERR, 'User tried to access hidden account type: ' . $type->getId()); die(); } elseif (!checkIfNewEntriesAreAllowed($type->getId())) { logNewMessage(LOG_ERR, 'User tried to create entry of forbidden account type: ' . $type->getId()); die(); } $_SESSION['account'] = new accountContainer($type, 'account', getRandomNumber()); $_SESSION['account']->new_account(); } // show account page $_SESSION['account']->continue_main(); ?>