[FIXED HUDSON-1833] Update center accepts HTTP proxy username/password.

In 1.234.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10737 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2008-07-10 06:43:03 +00:00
1 parent 0963c86306
commit 297c2b9fdf
5 files changed
+58 -16

No files matched your search

+8 -2
View File
@@ -218,7 +218,12 @@ public final class PluginManager extends AbstractModelObject {
rsp.sendRedirect("../updateCenter/");
}
public void doProxyConfigure(@QueryParameter("proxy.server") String server, @QueryParameter("proxy.port") String port, StaplerResponse rsp) throws IOException {
public void doProxyConfigure(
@QueryParameter("proxy.server") String server,
@QueryParameter("proxy.port") String port,
@QueryParameter("proxy.userName") String userName,
@QueryParameter("proxy.password") String password,
StaplerResponse rsp) throws IOException {
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
Hudson hudson = Hudson.getInstance();
@@ -227,7 +232,8 @@ public final class PluginManager extends AbstractModelObject {
hudson.proxy = null;
ProxyConfiguration.getXmlFile().delete();
} else {
hudson.proxy = new ProxyConfiguration(server,Integer.parseInt(Util.fixEmptyAndTrim(port)));
hudson.proxy = new ProxyConfiguration(server,Integer.parseInt(Util.fixEmptyAndTrim(port)),
Util.fixEmptyAndTrim(userName),Util.fixEmptyAndTrim(password));
hudson.proxy.save();
}
rsp.sendRedirect("./advanced");