1 package org.sourceforge.vlibrary.security.actions;
2
3 import java.util.ArrayList;
4 import javax.servlet.http.HttpServletRequest;
5 import javax.servlet.http.HttpServletResponse;
6 import org.apache.struts.action.ActionForm;
7 import org.apache.struts.action.ActionForward;
8 import org.apache.struts.action.ActionMapping;
9 import org.apache.struts.util.MessageResources;
10 import org.apache.log4j.Logger;
11
12 import org.sourceforge.vlibrary.Constants;
13 import org.sourceforge.vlibrary.security.forms.AdminPasswordResetForm;
14 import org.sourceforge.vlibrary.user.actions.LibraryAction;
15 import org.sourceforge.vlibrary.exceptions.LibraryException;
16
17
18
19
20
21
22 public class PreparePasswordResetAction extends LibraryAction {
23
24 private static Logger logger =
25 Logger.getLogger(PreparePasswordResetAction.class.getName());
26
27
28
29
30
31
32
33
34
35
36
37
38 public ActionForward executeAction(ActionMapping mapping, ActionForm form,
39 HttpServletRequest request, HttpServletResponse response,
40 MessageResources messages) throws Exception {
41
42 ArrayList errors = new ArrayList();
43
44 try {
45 if (mapping.getPath().startsWith(Constants.ADMIN_PATH)) {
46
47
48
49
50 AdminPasswordResetForm frm = (AdminPasswordResetForm) form;
51 frm.setReaders(libraryManager.getReaders());
52 }
53 } catch (Throwable t) {
54 String errString = messages.getMessage("error.readers.retrieve");
55 logger.error(errString, t);
56 errors.add(new LibraryException(errString, t));
57 }
58
59 return standardForward(mapping, request, errors);
60 }
61 }