import org.cacert.gigi.pages.account.domain.DomainOverview;
import org.cacert.gigi.pages.account.mail.MailOverview;
import org.cacert.gigi.pages.admin.TTPAdminPage;
-import org.cacert.gigi.pages.admin.support.FindDomainPage;
-import org.cacert.gigi.pages.admin.support.FindUserPage;
+import org.cacert.gigi.pages.admin.support.FindUserByDomainPage;
+import org.cacert.gigi.pages.admin.support.FindUserByEmailPage;
import org.cacert.gigi.pages.admin.support.SupportEnterTicketPage;
import org.cacert.gigi.pages.admin.support.SupportUserDetailsPage;
import org.cacert.gigi.pages.error.AccessDenied;
putPage(ViewOrgPage.DEFAULT_PATH + "/*", new ViewOrgPage(), "Organisation Admin");
putPage(SupportEnterTicketPage.PATH, new SupportEnterTicketPage(), "Support Console");
- putPage(FindUserPage.PATH, new FindUserPage(), "Support Console");
- putPage(FindDomainPage.PATH, new FindDomainPage(), "Support Console");
+ putPage(FindUserByEmailPage.PATH, new FindUserByEmailPage(), "Support Console");
+ putPage(FindUserByDomainPage.PATH, new FindUserByDomainPage(), "Support Console");
putPage(SupportUserDetailsPage.PATH + "*", new SupportUserDetailsPage(), null);
putPage(ChangePasswordPage.PATH, new ChangePasswordPage(), "My Account");
import org.cacert.gigi.output.template.SprintfCommand;
import org.cacert.gigi.output.template.Template;
-public class FindDomainForm extends Form {
+public class FindUserByDomainForm extends Form {
private CertificateOwner res = null;
- private static final Template t = new Template(FindDomainForm.class.getResource("FindDomainForm.templ"));
+ private static final Template t = new Template(FindUserByDomainForm.class.getResource("FindUserByDomainForm.templ"));
- public FindDomainForm(HttpServletRequest hsr) {
+ public FindUserByDomainForm(HttpServletRequest hsr) {
super(hsr);
}
import org.cacert.gigi.pages.OneFormPage;
import org.cacert.gigi.util.AuthorizationContext;
-public class FindDomainPage extends OneFormPage {
+public class FindUserByDomainPage extends OneFormPage {
public static final String PATH = "/support/find/domain";
- public FindDomainPage() {
- super("Find Domain", FindDomainForm.class);
+ public FindUserByDomainPage() {
+ super("Find Domain", FindUserByDomainForm.class);
}
@Override
public String getSuccessPath(Form f) {
- CertificateOwner res = ((FindDomainForm) f).getRes();
+ CertificateOwner res = ((FindUserByDomainForm) f).getRes();
if (res instanceof User) {
return SupportUserDetailsPage.PATH + res.getId();
} else if (res instanceof Organisation) {
import org.cacert.gigi.output.template.SprintfCommand;
import org.cacert.gigi.output.template.Template;
-public class FindUserForm extends Form {
+public class FindUserByEmailForm extends Form {
private EmailAddress emails[];
- private static final Template t = new Template(FindDomainForm.class.getResource("FindUserForm.templ"));
+ private static final Template t = new Template(FindUserByDomainForm.class.getResource("FindUserByEmailForm.templ"));
- public FindUserForm(HttpServletRequest hsr) {
+ public FindUserByEmailForm(HttpServletRequest hsr) {
super(hsr);
}
<? if($first) {?>
<table class="table">
<tbody><tr>
- <th colspan="2"><?=_Find User?></th>
+ <th colspan="2"><?=_Find User by Email?></th>
</tr>
<tr>
<td><?=_Email?>:</td>
import org.cacert.gigi.pages.Page;
import org.cacert.gigi.util.AuthorizationContext;
-public class FindUserPage extends Page {
+public class FindUserByEmailPage extends Page {
- public static final String PATH = "/support/find/user";
+ public static final String PATH = "/support/find/email";
- public FindUserPage() {
- super("Find User");
+ public FindUserByEmailPage() {
+ super("Find Email");
}
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
HashMap<String, Object> vars = new HashMap<String, Object>();
vars.put("first", true);
- new FindUserForm(req).output(resp.getWriter(), Page.getLanguage(req), vars);
+ new FindUserByEmailForm(req).output(resp.getWriter(), Page.getLanguage(req), vars);
}
@Override
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
- FindUserForm form = Form.getForm(req, FindUserForm.class);
+ FindUserByEmailForm form = Form.getForm(req, FindUserByEmailForm.class);
try {
form.submit(resp.getWriter(), req);
final EmailAddress[] emails = form.getEmails();
public class SupportUserDetailsForm extends Form {
- private static final Template t = new Template(FindDomainForm.class.getResource("SupportUserDetailsForm.templ"));
+ private static final Template t = new Template(FindUserByDomainForm.class.getResource("SupportUserDetailsForm.templ"));
private SupportedUser user;
import org.cacert.gigi.dbObjects.Domain;
import org.cacert.gigi.dbObjects.Group;
import org.cacert.gigi.dbObjects.User;
-import org.cacert.gigi.pages.admin.support.FindDomainPage;
+import org.cacert.gigi.pages.admin.support.FindUserByDomainPage;
import org.cacert.gigi.pages.admin.support.SupportEnterTicketPage;
import org.cacert.gigi.pages.admin.support.SupportUserDetailsPage;
import org.cacert.gigi.testUtils.ClientTest;
@Test
public void testDomainSearch() throws MalformedURLException, UnsupportedEncodingException, IOException, GigiApiException {
- URLConnection uc = post(FindDomainPage.PATH, "process&domain=" + URLEncoder.encode(domainName, "UTF-8"));
+ URLConnection uc = post(FindUserByDomainPage.PATH, "process&domain=" + URLEncoder.encode(domainName, "UTF-8"));
assertEquals("https://" + ServerConstants.getWwwHostNamePortSecure() + SupportUserDetailsPage.PATH + tid, uc.getHeaderField("Location"));
}
@Test
public void testDomainSearchById() throws MalformedURLException, UnsupportedEncodingException, IOException, GigiApiException {
- URLConnection uc = post(FindDomainPage.PATH, "process&domain=#" + d.getId());
+ URLConnection uc = post(FindUserByDomainPage.PATH, "process&domain=#" + d.getId());
assertEquals("https://" + ServerConstants.getWwwHostNamePortSecure() + SupportUserDetailsPage.PATH + tid, uc.getHeaderField("Location"));
}
@Test
public void testDomainSearchNonExist() throws MalformedURLException, UnsupportedEncodingException, IOException, GigiApiException {
- URLConnection uc = post(FindDomainPage.PATH, "process&domain=" + URLEncoder.encode(createUniqueName() + ".de", "UTF-8"));
+ URLConnection uc = post(FindUserByDomainPage.PATH, "process&domain=" + URLEncoder.encode(createUniqueName() + ".de", "UTF-8"));
assertNotNull(fetchStartErrorMessage(IOUtils.readURL(uc)));
}
found = true;
}
assumeTrue(found);
- URLConnection uc = post(FindDomainPage.PATH, "process&domain=#" + id);
+ URLConnection uc = post(FindUserByDomainPage.PATH, "process&domain=#" + id);
assertNotNull(fetchStartErrorMessage(IOUtils.readURL(uc)));
}
}
import java.net.URLEncoder;
import org.cacert.gigi.dbObjects.Group;
-import org.cacert.gigi.pages.admin.support.FindUserPage;
+import org.cacert.gigi.pages.admin.support.FindUserByEmailPage;
import org.cacert.gigi.pages.admin.support.SupportEnterTicketPage;
import org.cacert.gigi.pages.admin.support.SupportUserDetailsPage;
import org.cacert.gigi.testUtils.ClientTest;
String mail = createUniqueName() + "@example.com";
int id = createVerifiedUser("Först", "Secönd", mail, TEST_PASSWORD);
- URLConnection uc = post(cookie, FindUserPage.PATH, "process&email=" + URLEncoder.encode(mail, "UTF-8"), 0);
+ URLConnection uc = post(cookie, FindUserByEmailPage.PATH, "process&email=" + URLEncoder.encode(mail, "UTF-8"), 0);
assertEquals("https://" + ServerConstants.getWwwHostNamePortSecure() + SupportUserDetailsPage.PATH + id, uc.getHeaderField("Location"));
}
String mail = createUniqueName() + "@example.tld";
int id = createVerifiedUser("Först", "Secönd", mail, TEST_PASSWORD);
- URLConnection uc = post(cookie, FindUserPage.PATH, "process&email=" + URLEncoder.encode("%@example.tld", "UTF-8"), 0);
+ URLConnection uc = post(cookie, FindUserByEmailPage.PATH, "process&email=" + URLEncoder.encode("%@example.tld", "UTF-8"), 0);
assertEquals("https://" + ServerConstants.getWwwHostNamePortSecure() + SupportUserDetailsPage.PATH + id, uc.getHeaderField("Location"));
}
int id = createVerifiedUser("Först", "Secönd", mail, TEST_PASSWORD);
String mail2 = createUniqueName() + "@example.org";
int id2 = createVerifiedUser("Först", "Secönd", mail2, TEST_PASSWORD);
- URLConnection uc = post(cookie, FindUserPage.PATH, "process&email=" + URLEncoder.encode("%@example.org", "UTF-8"), 0);
+ URLConnection uc = post(cookie, FindUserByEmailPage.PATH, "process&email=" + URLEncoder.encode("%@example.org", "UTF-8"), 0);
String res = IOUtils.readURL(uc);
assertThat(res, containsString(SupportUserDetailsPage.PATH + id));
String mail2 = createUniqueName() + "@fxample.org";
int id2 = createVerifiedUser("Först", "Secönd", mail2, TEST_PASSWORD);
- URLConnection uc = post(cookie, FindUserPage.PATH, "process&email=" + URLEncoder.encode("%@_xample.org", "UTF-8"), 0);
+ URLConnection uc = post(cookie, FindUserByEmailPage.PATH, "process&email=" + URLEncoder.encode("%@_xample.org", "UTF-8"), 0);
String res = IOUtils.readURL(uc);
assertThat(res, containsString(SupportUserDetailsPage.PATH + id));
@Test
public void testWildcardMailSearchNoRes() throws MalformedURLException, UnsupportedEncodingException, IOException {
- URLConnection uc = post(FindUserPage.PATH, "process&email=" + URLEncoder.encode("%@_humpfelkumpf.org", "UTF-8"));
+ URLConnection uc = post(FindUserByEmailPage.PATH, "process&email=" + URLEncoder.encode("%@_humpfelkumpf.org", "UTF-8"));
assertNotNull(fetchStartErrorMessage(IOUtils.readURL(uc)));
}
@Test
public void testFulltextMailSearchNoRes() throws MalformedURLException, UnsupportedEncodingException, IOException {
- URLConnection uc = post(cookie, FindUserPage.PATH, "process&email=" + URLEncoder.encode(createUniqueName() + "@example.org", "UTF-8"), 0);
+ URLConnection uc = post(cookie, FindUserByEmailPage.PATH, "process&email=" + URLEncoder.encode(createUniqueName() + "@example.org", "UTF-8"), 0);
assertNotNull(fetchStartErrorMessage(IOUtils.readURL(uc)));
}
import java.net.MalformedURLException;
import org.cacert.gigi.dbObjects.Group;
-import org.cacert.gigi.pages.admin.support.FindDomainPage;
-import org.cacert.gigi.pages.admin.support.FindUserPage;
+import org.cacert.gigi.pages.admin.support.FindUserByDomainPage;
+import org.cacert.gigi.pages.admin.support.FindUserByEmailPage;
import org.cacert.gigi.pages.admin.support.SupportEnterTicketPage;
import org.cacert.gigi.testUtils.ClientTest;
import org.junit.Test;
@Test
public void testFulltextMailSearch() throws MalformedURLException, UnsupportedEncodingException, IOException {
- assertEquals(403, get(FindUserPage.PATH).getResponseCode());
+ assertEquals(403, get(FindUserByEmailPage.PATH).getResponseCode());
assertEquals(302, post(cookie, SupportEnterTicketPage.PATH, "ticketno=a20140808.8&setTicket=action", 0).getResponseCode());
- assertEquals(200, get(FindUserPage.PATH).getResponseCode());
- assertEquals(200, get(FindDomainPage.PATH).getResponseCode());
+ assertEquals(200, get(FindUserByEmailPage.PATH).getResponseCode());
+ assertEquals(200, get(FindUserByDomainPage.PATH).getResponseCode());
assertEquals(302, post(cookie, SupportEnterTicketPage.PATH, "ticketno=a20140808.8&deleteTicket=action", 0).getResponseCode());
- assertEquals(403, get(FindUserPage.PATH).getResponseCode());
+ assertEquals(403, get(FindUserByEmailPage.PATH).getResponseCode());
}
}