Skip to content

Commit

Permalink
2005-02-28 Pierre-Luc Paour <gallery@paour.com> (1.4.2-b11)
Browse files Browse the repository at this point in the history
	* Fixed setting proxy info for downloading images already
	  on server.
	* Yet another attempt at fixing applet URL logic. Added a
	  manual gr_url_override applet parameter as a fix
	  for people whose Gallery URLs hopelessly confuse GR.
	* Applet jars are signed with the new cert, which expires
	  in 2007.
  • Loading branch information
Pierre-Luc Paour committed Feb 28, 2005
1 parent a241365 commit b719cc9
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 13 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
@@ -1,3 +1,13 @@
2005-02-28 Pierre-Luc Paour <gallery@paour.com> (1.4.2-b11)

* Fixed setting proxy info for downloading images already
on server.
* Yet another attempt at fixing applet URL logic. Added a
manual gr_url_override applet parameter as a fix
for people whose Gallery URLs hopelessly confuse GR.
* Applet jars are signed with the new cert, which expires
in 2007.

2005-01-23 Pierre-Luc Paour <gallery@paour.com> (1.4.2-b10)

* Fixed mis-caching of files downloaded from the server
Expand Down
30 changes: 21 additions & 9 deletions com/gallery/GalleryRemote/GRApplet.java
Expand Up @@ -90,6 +90,7 @@ protected AppletInfo getGRAppletInfo() {

String url = getParameter("gr_url");
String urlFull = getParameter("gr_url_full");
String urlOverride = getParameter("gr_url_override");
String cookieName = getParameter("gr_cookie_name");
String cookieValue = getParameter("gr_cookie_value");
String cookieDomain = getParameter("gr_cookie_domain");
Expand All @@ -101,6 +102,7 @@ protected AppletInfo getGRAppletInfo() {
Log.log(Log.LEVEL_INFO, MODULE, "Applet parameters:");
Log.log(Log.LEVEL_INFO, MODULE, "gr_url: " + url);
Log.log(Log.LEVEL_INFO, MODULE, "gr_url_full: " + urlFull);
Log.log(Log.LEVEL_INFO, MODULE, "gr_url_override: " + urlOverride);
Log.log(Log.LEVEL_INFO, MODULE, "gr_cookie_name: " + cookieName);
Log.log(Log.LEVEL_INFO, MODULE, "gr_cookie_domain: " + cookieDomain);
Log.log(Log.LEVEL_INFO, MODULE, "gr_cookie_path: " + cookiePath);
Expand All @@ -126,7 +128,11 @@ protected AppletInfo getGRAppletInfo() {
}
}

if (urlFull != null) {
if (urlOverride != null) {
info.gallery.setType(Gallery.TYPE_APPLET);
info.gallery.setApUrlString(urlOverride);
urlFull = urlOverride;
} else if (urlFull != null) {
// the server specified a full URL, we're probably in embedded mode
// and we have to recreate the URL

Expand All @@ -151,19 +157,25 @@ protected AppletInfo getGRAppletInfo() {
Log.log(Log.LEVEL_TRACE, MODULE, "urlFull is not a valid URL: recomposing it from documentBase");

try {

String path = documentBase.getPath();
int i = path.lastIndexOf("/");
if (i != -1) {
path = path.substring(0, i);
String path = null;

if (urlFull.startsWith("/")) {
path = urlFull;
} else {
path = documentBase.getPath();
int i = path.lastIndexOf("/");
if (i != -1) {
path = path.substring(0, i);
}

path += "/" + urlFull;
}

urlFull = new URL(documentBase.getProtocol(), documentBase.getHost(), documentBase.getPort(),
path + "/" + urlFull).toString();
path).toString();

info.gallery.setType(Gallery.TYPE_APPLET);
info.gallery.setApUrlString(urlFull);
info.gallery.setUserAgent(userAgent);

Log.log(Log.LEVEL_TRACE, MODULE, "Full URL: " + urlFull);
} catch (MalformedURLException ee) {
Expand All @@ -177,9 +189,9 @@ protected AppletInfo getGRAppletInfo() {
// old versions of Gallery, or bad urlFull
info.gallery.setType(Gallery.TYPE_STANDALONE);
info.gallery.setStUrlString(url);
info.gallery.setUserAgent(userAgent);
}

info.gallery.setUserAgent(userAgent);
info.gallery.cookieLogin = true;

CookieModule.discardAllCookies();
Expand Down
14 changes: 13 additions & 1 deletion com/gallery/GalleryRemote/GalleryComm.java
Expand Up @@ -38,6 +38,7 @@
import java.net.URL;
import java.net.UnknownHostException;
import java.util.StringTokenizer;
import java.util.Properties;

/**
* This interface is a temporary mechanism to let us use version
Expand Down Expand Up @@ -81,17 +82,22 @@ public boolean sendCookie(Cookie cookie, RoRequest req) {
}
});

// http://cvs.sourceforge.net/viewcvs.py/jameleon/jameleon/src/java/net/sf/jameleon/util/JsseSettings.java?rev=1.4&view=markup
// http://tp.its.yale.edu/pipermail/cas/2004-March/000348.html
// Create a trust manager that does not validate certificate chains
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
Log.log(Log.LEVEL_INFO, MODULE, "TrustManager.getAcceptedIssuers");
return new java.security.cert.X509Certificate[0];
}
public void checkClientTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
Log.log(Log.LEVEL_INFO, MODULE, "TrustManager.checkClientTrusted");
}
public void checkServerTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
Log.log(Log.LEVEL_INFO, MODULE, "TrustManager.checkServerTrusted");
}
}
};
Expand Down Expand Up @@ -246,6 +252,12 @@ public static GalleryComm getCommInstance(StatusUpdate su, URL url, Gallery g) {
AuthorizationInfo.addBasicAuthorization(proxyHost, proxyPort, "",
proxyUsername, proxyPassword);
}

// also set Java URLConnection proxy
Properties sprops = System.getProperties();
sprops.setProperty("http.proxySet", "true");
sprops.setProperty("http.proxyHost", proxyHost);
sprops.setProperty("http.proxyPort", ""+proxyPort);
} else {
HTTPConnection.setProxyServer(null, 0);
}
Expand Down
8 changes: 7 additions & 1 deletion com/gallery/GalleryRemote/model/Gallery.java
Expand Up @@ -115,7 +115,13 @@ public void treeStructureChanged(TreeModelEvent e) {
*/

public void doUploadFiles(StatusUpdate su) {
getComm(su).uploadFiles(su, true);
GalleryComm comm = getComm(su);

if (comm != null) {
comm.uploadFiles(su, true);
} else {
// don't worry about it, an error message is displayed somewhere else.
}
}

public void doFetchAlbums(StatusUpdate su) {
Expand Down
4 changes: 2 additions & 2 deletions defaults.properties
Expand Up @@ -242,6 +242,6 @@ updateUrlBeta=http://gallery.sourceforge.net/gallery_remote_version_check_beta.p
#
# --- Do not edit below this line ---
#
version=1.4.2-b10
releaseDate=2005/01/23
version=1.4.2-b11
releaseDate=2005/02/28
aboutText=Gallery Remote\n \n \nA part of the Gallery Open-Source Project\nhttp://gallery.sourceforge.net\n \n \nMaintained by:\n \nPierre-Luc Paour\n \n \nInitial version by Chris Smith\n \n \nContributors:\n \nTim Miller\nDolan Halbrook\nMarkus Cozowicz\nScott Gartner\nAmedeo Paglione\nChris Schwerdt\nSeth Ladd\n \n \nArtwork by Ross A. Reyman\n \n \nBundled software:\n \nImageMagick\nJava look and feel Graphics Repository icons\njpegtran, Guido Vollbeding's version\nMetadataExtractor

0 comments on commit b719cc9

Please sign in to comment.