Skip to content

Commit

Permalink
2005-04-25 Pierre-Luc Paour <gallery@paour.com> (1.4.2-b14)
Browse files Browse the repository at this point in the history
	* Added support for the applet to force the version of Gallery
	  it's embedded in, to overcome instances of Apache sending
	  a 200 error code even though gallery_remote2.php doesn't exist
	  instead of 404 (in G2).
  • Loading branch information
Pierre-Luc Paour committed Apr 25, 2005
1 parent 9893c60 commit 7a9066e
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 20 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -1,3 +1,10 @@
2005-04-25 Pierre-Luc Paour <gallery@paour.com> (1.4.2-b14)

* Added support for the applet to force the version of Gallery
it's embedded in, to overcome instances of Apache sending
a 200 error code even though gallery_remote2.php doesn't exist
instead of 404 (in G2).

2005-04-22 Pierre-Luc Paour <gallery@paour.com> (1.4.2-b13)

* Fixed error message for self-signed cert to point to GR documentation.
Expand Down
9 changes: 9 additions & 0 deletions com/gallery/GalleryRemote/GRApplet.java
Expand Up @@ -96,6 +96,7 @@ protected AppletInfo getGRAppletInfo() {
String cookieDomain = getParameter("gr_cookie_domain");
String cookiePath = getParameter("gr_cookie_path");
String userAgent = getParameter("gr_user_agent");
String galleryVersion = getParameter("gr_gallery_version");
String cookie1Name = getParameter("gr_cookie1_name");
String cookie1Value = getParameter("gr_cookie1_value");

Expand All @@ -111,6 +112,7 @@ protected AppletInfo getGRAppletInfo() {
Log.log(Log.LEVEL_INFO, MODULE, "gr_cookie1_name: " + cookie1Name);
Log.log(Log.LEVEL_INFO, MODULE, "gr_album: " + info.albumName);
Log.log(Log.LEVEL_INFO, MODULE, "gr_user_agent: " + userAgent);
Log.log(Log.LEVEL_INFO, MODULE, "gr_gallery_version: " + galleryVersion);

if (cookieDomain == null || cookieDomain.length() < 1) {
try {
Expand Down Expand Up @@ -196,6 +198,13 @@ protected AppletInfo getGRAppletInfo() {

info.gallery.setUserAgent(userAgent);
info.gallery.cookieLogin = true;
if (galleryVersion != null) {
try {
info.gallery.forceGalleryVersion = Integer.parseInt(galleryVersion);
} catch (RuntimeException e) {
Log.logException(Log.LEVEL_ERROR, MODULE, e);
}
}

CookieModule.discardAllCookies();
Cookie cookie = new Cookie(cookieName, cookieValue, cookieDomain, cookiePath, null, false);
Expand Down
38 changes: 21 additions & 17 deletions com/gallery/GalleryRemote/GalleryComm.java
Expand Up @@ -270,25 +270,29 @@ public static GalleryComm getCommInstance(StatusUpdate su, URL url, Gallery g) {
// assemble the URL
String urlPath = url.getFile();

Log.log(Log.LEVEL_TRACE, MODULE, "Trying protocol 2 for " + url);
// Test GalleryComm2
String urlPath2 = urlPath + ((urlPath.endsWith("/")) ? GalleryComm2.SCRIPT_NAME : "/" + GalleryComm2.SCRIPT_NAME);
if (tryComm(su, mConnection, urlPath2, null)) {
Log.log(Log.LEVEL_TRACE, MODULE, "Server has protocol 2");
return new GalleryComm2(g);
if (g.forceGalleryVersion == 0 || g.forceGalleryVersion == 1) {
Log.log(Log.LEVEL_TRACE, MODULE, "Trying protocol 2 for " + url);
// Test GalleryComm2
String urlPath2 = urlPath + ((urlPath.endsWith("/")) ? GalleryComm2.SCRIPT_NAME : "/" + GalleryComm2.SCRIPT_NAME);
if (tryComm(su, mConnection, urlPath2, null)) {
Log.log(Log.LEVEL_TRACE, MODULE, "Server has protocol 2");
return new GalleryComm2(g);
}
}

Log.log(Log.LEVEL_TRACE, MODULE, "Trying protocol 2.5 for " + url);
// Test GalleryComm2
String urlPath2_5 = urlPath + ((urlPath.endsWith("/")) ? GalleryComm2_5.SCRIPT_NAME : "/" + GalleryComm2_5.SCRIPT_NAME);
StringBuffer sb = new StringBuffer();
if (tryComm(su, mConnection, urlPath2_5, sb)) {
if (sb != null && sb.indexOf("ERROR_PERMISSION_DENIED") == -1) {
Log.log(Log.LEVEL_TRACE, MODULE, "Server has protocol 2.5");
return new GalleryComm2_5(g);
} else {
// G2 remote module is deactivated
su.error(GRI18n.getString(MODULE, "g2.moduleDisabled"));
if (g.forceGalleryVersion == 0 || g.forceGalleryVersion == 2) {
Log.log(Log.LEVEL_TRACE, MODULE, "Trying protocol 2.5 for " + url);
// Test GalleryComm2
String urlPath2_5 = urlPath + ((urlPath.endsWith("/")) ? GalleryComm2_5.SCRIPT_NAME : "/" + GalleryComm2_5.SCRIPT_NAME);
StringBuffer sb = new StringBuffer();
if (tryComm(su, mConnection, urlPath2_5, sb)) {
if (sb != null && sb.indexOf("ERROR_PERMISSION_DENIED") == -1) {
Log.log(Log.LEVEL_TRACE, MODULE, "Server has protocol 2.5");
return new GalleryComm2_5(g);
} else {
// G2 remote module is deactivated
su.error(GRI18n.getString(MODULE, "g2.moduleDisabled"));
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion com/gallery/GalleryRemote/model/Gallery.java
Expand Up @@ -58,7 +58,7 @@ public class Gallery extends DefaultTreeModel implements Serializable, Preferenc
String username;
String password;
String alias;
String userAgent = null;
String userAgent = null;
int type = TYPE_STANDALONE;

transient GalleryComm comm = null;
Expand All @@ -69,6 +69,7 @@ public class Gallery extends DefaultTreeModel implements Serializable, Preferenc
transient private boolean blockWrites = false;
transient public boolean cookieLogin = false;
transient public int galleryVersion = 1;
transient public int forceGalleryVersion = 0;

public static String types[] = new String[]{STANDALONE, POSTNUKE, PHPNUKE, GEEKLOG};
public static final int TYPE_STANDALONE = 0;
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-b13
releaseDate=2005/04/22
version=1.4.2-b14
releaseDate=2005/04/25
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 7a9066e

Please sign in to comment.