} if (isset($_GET['gg'])) { $guidelineGroupsDAO->Delete($_GET['gg']); } header('Location: create_edit_guideline.php?id=' . $gid); exit; } // interface display if (!isset($gid)) { // create guideline $checksDAO = new ChecksDAO(); $savant->assign('author', $_current_user->getUserName()); } else { // edit existing guideline $checksDAO = new ChecksDAO(); $rows = $guidelinesDAO->getGuidelineByIDs($gid); // get author name $usersDAO = new UsersDAO(); $user_name = $usersDAO->getUserName($rows[0]['user_id']); if (!$user_name) { $user_name = _AC('author_not_exist'); } $savant->assign('gid', $gid); $savant->assign('row', $rows[0]); $savant->assign('author', $user_name); $savant->assign('checksDAO', $checksDAO); } if (isset($_current_user)) { $savant->assign('is_admin', $_current_user->isAdmin()); } $savant->display('guideline/create_edit_guideline.tmpl.php');
// end of handle submit // initialize page $checksDAO = new ChecksDAO(); if (isset($check_id)) { $check_row = $checksDAO->getCheckByID($check_id); if (!$check_row) { // invalid check id $msg->addError('INVALID_CHECK_ID'); require AC_INCLUDE_PATH . 'header.inc.php'; $msg->printAll(); require AC_INCLUDE_PATH . 'footer.inc.php'; exit; } // get author name $usersDAO = new UsersDAO(); $user_name = $usersDAO->getUserName($check_row['user_id']); if ($user_name != '') { $savant->assign('author', $user_name); } $check_pass_example_rows = $checkExamplesDAO->getByCheckIDAndType($check_id, AC_CHECK_EXAMPLE_PASS); $check_fail_example_rows = $checkExamplesDAO->getByCheckIDAndType($check_id, AC_CHECK_EXAMPLE_FAIL); $check_example_row['pass_example_desc'] = $check_pass_example_rows[0]['description']; $check_example_row['pass_example'] = $check_pass_example_rows[0]['content']; $check_example_row['fail_example_desc'] = $check_fail_example_rows[0]['description']; $check_example_row['fail_example'] = $check_fail_example_rows[0]['content']; $savant->assign('check_row', $check_row); $savant->assign('pre_rows', $checkPrerequisitesDAO->getPreChecksByCheckID($check_id)); $savant->assign('next_rows', $testPassDAO->getNextChecksByCheckID($check_id)); $savant->assign('guideline_rows', $guidelinesDAO->getEnabledGuidelinesByCheckID($check_id)); $savant->assign('check_example_row', $check_example_row); }
/* as published by the Free Software Foundation. */ /************************************************************************/ define('TR_INCLUDE_PATH', '../include/'); include TR_INCLUDE_PATH . 'vitals.inc.php'; include_once TR_INCLUDE_PATH . 'classes/DAO/UsersDAO.class.php'; $usersDAO = new UsersDAO(); $ids = explode(',', $_REQUEST['id']); if (isset($_POST['submit_no'])) { $msg->addFeedback('CANCELLED'); header('Location: index.php'); exit; } else { if (isset($_POST['submit_yes'])) { foreach ($ids as $id) { $usersDAO->Delete($id); } $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY'); header('Location: index.php'); exit; } } require TR_INCLUDE_PATH . 'header.inc.php'; unset($hidden_vars); foreach ($ids as $id) { $names[] = $usersDAO->getUserName($id); } $names_html = '<ul>' . html_get_list($names) . '</ul>'; $hidden_vars['id'] = $_REQUEST['id']; $msg->addConfirm(array('DELETE_USER', $names_html), $hidden_vars); $msg->printConfirm(); require TR_INCLUDE_PATH . 'footer.inc.php';