Change-Id: I20f80a92be83a9bd84d0a925d77761269d36c0e4
-<? if($usertable) {?>
-<p>Multiple users where found.</p>
-<table class="table">
-<tr>
-<th>Id</th><th>E-Mail</th></tr>
-<? foreach($usertable) {?>
- <tr><td><a href="/support/user/<?=$usrid?>/"><?=$usrid?></a></td><td><a href="/support/user/<?=$usrid?>/"><?=$usermail?></a></td></tr>
-<? } ?>
-</table>
-<? } ?>
-<? if($first) {?>
<table class="table">
<tbody><tr>
<th colspan="2"><?=_Find User by Email?></th>
<table class="table">
<tbody><tr>
<th colspan="2"><?=_Find User by Email?></th>
<td colspan="2"><input name="process" value="<?=_Next?>" type="submit"/></td>
</tr>
</tbody></table>
<td colspan="2"><input name="process" value="<?=_Next?>" type="submit"/></td>
</tr>
</tbody></table>
import org.cacert.gigi.localisation.Language;
import org.cacert.gigi.output.template.Form;
import org.cacert.gigi.output.template.IterableDataset;
import org.cacert.gigi.localisation.Language;
import org.cacert.gigi.output.template.Form;
import org.cacert.gigi.output.template.IterableDataset;
+import org.cacert.gigi.output.template.Template;
import org.cacert.gigi.pages.Page;
import org.cacert.gigi.util.AuthorizationContext;
import org.cacert.gigi.pages.Page;
import org.cacert.gigi.util.AuthorizationContext;
public static final String PATH = "/support/find/email";
public static final String PATH = "/support/find/email";
+ private static final Template USERTABLE = new Template(FindUserByDomainPage.class.getResource("FindUserByEmailUsertable.templ"));
+
public FindUserByEmailPage() {
super("Find Email");
}
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
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 FindUserByEmailForm(req).output(resp.getWriter(), Page.getLanguage(req), vars);
+ new FindUserByEmailForm(req).output(resp.getWriter(), Page.getLanguage(req), new HashMap<String, Object>());
resp.sendRedirect(SupportUserDetailsPage.PATH + emails[0].getOwner().getId() + "/");
} else {
HashMap<String, Object> vars = new HashMap<String, Object>();
resp.sendRedirect(SupportUserDetailsPage.PATH + emails[0].getOwner().getId() + "/");
} else {
HashMap<String, Object> vars = new HashMap<String, Object>();
- vars.put("first", false);
vars.put("usertable", new IterableDataset() {
int i = 0;
vars.put("usertable", new IterableDataset() {
int i = 0;
- form.output(resp.getWriter(), getLanguage(req), vars);
+ USERTABLE.output(resp.getWriter(), getLanguage(req), vars);
}
} catch (GigiApiException e) {
e.format(resp.getWriter(), Page.getLanguage(req));
}
} catch (GigiApiException e) {
e.format(resp.getWriter(), Page.getLanguage(req));
+ form.output(resp.getWriter(), Page.getLanguage(req), new HashMap<String, Object>());
--- /dev/null
+<p>Multiple users where found.</p>
+<table class="table">
+<tr>
+<th>Id</th><th>E-Mail</th></tr>
+<? foreach($usertable) {?>
+ <tr><td><a href="/support/user/<?=$usrid?>/"><?=$usrid?></a></td><td><a href="/support/user/<?=$usrid?>/"><?=$usermail?></a></td></tr>
+<? } ?>
+</table>