/** * Get the DrWebID of the current user from the session. * * @param request the HttpServletRequest object that contains the client's request. * @return the DrWebID of the current user from the session; or -1 if one cannot retrieve. */ public static Long getDrWebID(HttpServletRequest request) { Long drWebID = new Long(-1); UserInfo userInfo; userInfo = getUserInfo(request); if (userInfo != null) { drWebID = userInfo.getID().longValue(); } return drWebID; }
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { StaffHelperClass helperClass = StaffHelperClass.getInstance(); PrintWriter out; HttpSession session; String accessValue; boolean memberStaff = false; boolean memberAdmin = false; helperClass.checkSession(req, res); session = req.getSession(false); out = res.getWriter(); if (session == null) { out.println("ERROR: internal servlet problem - no session"); out.flush(); out.close(); return; } else { UserInfo userInfo = (UserInfo) session.getValue("USER"); memberAdmin = (accessValue = userInfo.getMemberType()).equals("DR1A") ? true : false; memberStaff = (accessValue = userInfo.getMemberType()).equals("DR1S") ? true : false || memberAdmin; } // Build Link Array MenuLinks[] links = new MenuLinks[8]; // Amit - Modified for 006; // changed array size from [10] // to [11] int x = -1; // 02.12.10 CC: Comment out three links due to no longer in use. They // are "Send Follow-up emails for Rcopia Registrants", // "Use Of User Agreement", and // "Enable/Disable a Rcopia User for Download". /* * links[++x] = new MenuLinks(memberAdmin, "/staff/epsFollowup.html", * "/images/email.gif", "Send Follow-up emails for Rcopia Registrants"); * links[++x] = new MenuLinks(memberAdmin, * "/staff/UserAgreementTop.html", "/images/email.gif", * "Use Of User Agreement"); */ links[++x] = new MenuLinks( memberAdmin, "/servlet/staff.SignatureImagesApproval", "/images/staff-enablestaff.gif", "Signature Image Approval"); // Amit - Added/Modified for 006 START links[++x] = new MenuLinks( memberAdmin, "/servlet/eps.EnableEps?Session=N", "/images/staff-enablestaff.gif", "Enable Prescriber for Rcopia"); links[++x] = new MenuLinks( memberAdmin, "/servlet/eps.EnableProviderAgent?Session=N", "/images/staff-enablestaff.gif", "Enable Provider Agent for Rcopia"); // Amit - Added/Modified for 006 END /* * links[++x] = new MenuLinks(memberAdmin, * "/servlet/eps.EnableRcopiaDownload?Session=Y", * "/images/staff-enablestaff.gif", * "Enable/Disable a Rcopia User for Download"); */ links[++x] = new MenuLinks( memberStaff, "/staff/prescriptionQuery.html", "/images/staff-presquery.gif", "Prescription Query"); links[++x] = new MenuLinks( memberStaff, "/servlet/staff.FaxConsole?Session=Y", "/images/staff-presquery.gif", "Fax Console"); links[++x] = new MenuLinks( memberStaff, "/servlet/staff.PharmacySearch?Session=Y", "/images/staff-update.gif", "Pharmacy Maintenance"); links[++x] = new MenuLinks( false, "/servlet/staff.AddPharmacyServlet?Session=Y", "/images/staff-update.gif", "Add A Pharmacy"); links[++x] = new MenuLinks( memberAdmin, "/servlet/staff.ResetPasswordSearch?Session=Y&FirstTime=Y&Rcopia=Y", "/images/staff-resetpass.gif", "Reset Digital Signature's Password"); res.setContentType("text/html"); StringBuffer sbf = new StringBuffer(); sbf.append("<html> "); sbf.append(" <head> "); sbf.append(" <title>Staff Options</title> "); sbf.append(" <style type=\"text/css\"> "); sbf.append(" <!-- "); sbf.append(" A.menu:link, A.menu:visited {"); sbf.append(" font: bold 12pt georgian; "); sbf.append(" color: black"); sbf.append(" } "); sbf.append(" A.menu:active {"); sbf.append(" color: black"); sbf.append(" } "); sbf.append(" --> "); sbf.append(" </style> "); sbf.append(" </head> "); sbf.append(" <body> "); sbf.append(" <img src=\"/images/staff-title.gif\"> "); sbf.append(" <p> "); sbf.append(" <center> "); sbf.append(" <table width=\"90%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> "); sbf.append(" <tr> "); sbf.append( " <td colspan=\"3\" align=\"left\"><img src=\"/images/empty.gif\" width=\"41\" height=\"20\"></td> "); sbf.append(" </tr> "); for (int linkIndex = 0; linkIndex < links.length; linkIndex++) { if (links[linkIndex].hasAccess) { sbf.append(" <tr> "); sbf.append(" <td width=\"41\" background=\"/images/empty.gif\"> "); sbf.append( " <a href=\"" + links[linkIndex].link + "\"><img src=\"" + links[linkIndex].imgSrc + "\" width=\"41\" height=\"40\" border=\"0\"></a>"); sbf.append(" </td> "); sbf.append( " <td width=\"10\" rowspan=\"2\"><img src=\"/images/empty.gif\" width=\"10\" height=\"1\"></td> "); sbf.append( " <td><a class=\"menu\" href=\"" + links[linkIndex].link + "\">" + links[linkIndex].desc + "</a></td>"); sbf.append(" </tr> "); sbf.append(" <tr> "); sbf.append( " <td width=\"41\" background=\"/images/empty.gif\"><img src=\"/images/empty.gif\" width=\"41\" height=\"1\"></td> "); sbf.append(" <td width=\"100%\"> </td> "); sbf.append(" </tr> "); } } sbf.append(" </table> "); sbf.append(" </center> "); sbf.append(" </body> "); sbf.append("</html> "); out.println(sbf.toString()); out.close(); }