[Google map module 0.5.2.a] Authentication failure

eivind

Joined: 2002-08-22
Posts: 14
Posted: Mon, 2007-01-01 18:19

Hi.

I have upgraded gallery to 2.2SVN and the Google map module to 0.5.2a. When I try to enter new map coordinates for an album via the "get via a map" function, I receive the following error:

Authentication Failure

Your change cannot be completed due to a loss of session data. Please try again. If it still doesn't work, try logging out and logging back in.

Back to the Gallery
Error Detail -
Error (ERROR_REQUEST_FORGED)

* in modules/core/classes/GalleryController.class at line 235 (gallerycoreapi::error)
* in main.php at line 224 (gallerycontroller::assertisgenuinerequest)
* in main.php at line 94
* in main.php at line 83

System Information
Gallery version 2.2-rc-1
PHP version 4.4.4 cgi
Webserver Apache
Database mysql 4.0.27-log

I have seen another post in this forum regarding the same issue, but it wasn't resolved in that post, which was from November. Is there any workaround/fix for this problem?

Happy New Year, by the way:)

Best regards,

Eivind.

 
techsmarty

Joined: 2006-12-29
Posts: 24
Posted: Mon, 2007-01-01 19:05

I upgraded to 2.2-rc-1 When it came out last night and have the same issue.

Error Detail -
Error (ERROR_REQUEST_FORGED)

* in modules/core/classes/GalleryController.class at line 235 (gallerycoreapi::error)
* in main.php at line 224 (gallerycontroller::assertisgenuinerequest)
* in main.php at line 94
* in main.php at line 83

System Information
Gallery version 2.2-rc-1
PHP version 4.4.4 cgi
Webserver Apache/1.3.37 (Unix) mod_fastcgi/2.4.2 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a PHP-CGI/0.1b
Database mysql 4.1.21-standard-log
Toolkits ImageMagick, Thumbnail
Operating system Linux box204.bluehost.com 2.6.17-11_4.BHsmp #1 SMP Fri Nov 17 17:14:51 MST 2006 x86_64
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Tue, 2007-01-02 02:55

Yep this is known but I'm not sure why the problem is occurring yet :(

Stay tuned
-------------------------
The Termite - :-) - http://www.termitenshort.com/

 
conorboyd

Joined: 2005-03-29
Posts: 165
Posted: Tue, 2007-01-02 03:44

I suspect it's because of the new AuthToken functionality?

I've seen it detailed in the Gallery Remote doco (http://codex.gallery2.org/index.php/Gallery_Remote:Protocol): "Starting with G2.2 (svn r15234, protocol 2.10), a new security was put in place in order to defend against cross-site request forgery attacks. G2 expects all requests to have a new URL parameter, g2_authToken, which contains a string. The value of that string should be the value of the auth_token response element to the previous request."

HTH,

Conor
Christchurch, NZ

GLoSS: Gallery2 Local Screen Saver & Desktop Changer

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Tue, 2007-01-02 15:38

conorboyd, you are correct. It is because of the new authtoken functionality.

The part that is confusing is that the Form is formed by Gallery Core itself (and the URL parameter g2_authToken is there as well) as this part of the module is a simple edit plugin. I think I have done something wrong in the plugin but I haven't quite figured it out yet :-)

But like always I should figure it out :D:D
-------------------------
The Termite - :-) - http://www.termitenshort.com/

 
conorboyd

Joined: 2005-03-29
Posts: 165
Posted: Tue, 2007-01-02 19:37

No worries. I thought you'd probably be aware of it, but paour had told me directly about the upcoming change, so that I could incorporate it into my screensaver/desktop changer.

I don't know anything about how Gallery itself actually works with plugins etc, I just thought I would mention it in case it was useful. :-)

Cheers,

Conor
Christchurch, NZ

GLoSS: Gallery2 Local Screen Saver & Desktop Changer

 
techsmarty

Joined: 2006-12-29
Posts: 24
Posted: Fri, 2007-01-05 00:17

Any idea of when this issue can be resolved?

 
eivind

Joined: 2002-08-22
Posts: 14
Posted: Mon, 2007-01-15 10:47

Hi again.

I'm currently trying to download the latest map module version from SVN using TortoiseSVN, but I'm being asked for a username and password....am I doing something wrong or do I need to register somewhere to obtain the latest build?

Best regards,

Eivind.

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Thu, 2007-01-18 00:29

I can take a look at this. I don't think it's a huge issue to fix it, just add the session key to the generated links, from what I've seen in the other modules. However, I don't have Gallery 2.2 installed to test this so someone else will have to verify the fix.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Thu, 2007-01-18 01:54

Thanks !!

-------------------------
The Termite - :-) - http://www.termitenshort.com/

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22879
Posted: Thu, 2007-01-18 05:27
SiliconFiend wrote:
However, I don't have Gallery 2.2 installed to test this so someone else will have to verify the fix.

I'm inline to test.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Thu, 2007-01-18 05:41

Thanks to both of you for this. I really am swamped with work these days :-)
-------------------------
The Termite - :-) - http://www.termitenshort.com/

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2007-01-18 06:15

Termitenshort

simple fix:

templates/ShowMap.tpl doesn't have {g->hiddenFormVars} yet.

if you run the g2 codeaudit tests it should discover such issues.
(note that the codeaudit tests only check files that are in .svn since the test looks at your .svn folders to traverse all files)

--------------
Enter the Gallery 2 Theme Contest today!

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Thu, 2007-01-18 06:21

Can someone try this file with Gallery 2.2: http://vorticon.no-ip.info/pub/patches/ShowMap.tpl or the small patch at http://vorticon.no-ip.info/pub/patches/ShowMap.tpl.patch. The changes seem to be in line with what is done in the main gallery codebase.

If it works then I'll commit it to SVN.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2007-01-18 06:44

works fine.

btw:
please set display_errors to 1 (bottom of config.php) and set error_reporting to E_ALL when developing g2 code.
i see a lot of PHP notice ... undefined when tryging the map module. you should fix them all.

--------------
Enter the Gallery 2 Theme Contest today!

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Thu, 2007-01-18 06:56

Thanks, I'll get that change committed.

I'll take a look at those other bugs, but I'm still running Gallery 2.1.2 (I'm waiting for 2.2 to be released and get into Gentoo Portage before upgrading) and a modified map module 0.5.1d. So, no promises but I'll do what I can.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2007-01-18 07:05

as a developer you should really really have a g2.2 / svn version. i don't ask you to replace your prod environment with g2.2, but as a dev it makes a lot of sense to have a svn version of g2. it can be in parallel to whatever else you're running as well.

that's just a strong suggestion. :)

besides: this map module is just awesome and the goodies you're adding make it even better. keep up the good work!

--------------
Enter the Gallery 2 Theme Contest today!

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Thu, 2007-01-18 15:50
valiant wrote:
btw:
please set display_errors to 1 (bottom of config.php) and set error_reporting to E_ALL when developing g2 code.
i see a lot of PHP notice ... undefined when tryging the map module. you should fix them all.

That's the way my dev box is but all these notices go away after you save a in the admin page. I'll go throught a new install tonight and get all of these out of the way which should be no big deal but sure will make the module cleaner :-)

Thanks !
-------------------------
The Termite - :-) - http://www.termitenshort.com/

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Thu, 2007-01-18 19:32

Okay, the fix has been committed, along with a few other fixes to the ShowMap.tpl file. I'll work on setting up a SVN G2 installation for development and testing.

 
eivind

Joined: 2002-08-22
Posts: 14
Posted: Thu, 2007-01-18 21:57

Hi guys.

I just upgraded the google map module to the latest SVN version after SiliconFiend committed the changes. Under the routes management tab, I chose the option to automatically update a file (was it albums.tpl?) so that the routes would be displayed in the map when using Internet Explorer. The result is that the main page of my gallery (gallery2/main.php) is now a blank page. When I look at the source code of main.php all I see is the html code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>

Any idea how I can undo this change manually? I hope to avoid doing a restore.

Best regards,

Eivind.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Thu, 2007-01-18 22:57

Hello,

When the button is triggered (to update theme.tpl manually) a backup of the file is created in the same folder (assuming all the rights are in place but without them, the change will not even occur)

If you go to your theme folder, you can see inside the templates folder theme.tpl and theme.back, you can restore the previous version this way :-)

If you don't see a .back file, then gallery doesn't have rights inside that folder and nothing would have been changed.

Let us know !
-------------------------
The Termite - :-) - http://www.termitenshort.com/

 
eivind

Joined: 2002-08-22
Posts: 14
Posted: Fri, 2007-01-19 10:01

Hi!

Thank you - that fixed the problem:) For your information, this error occurred using the PGlightbox theme, version 1.2.0.

Best regards,

Eivind:)

 
techsmarty

Joined: 2006-12-29
Posts: 24
Posted: Sun, 2007-01-21 05:41

Since I don't have access to installing the latest updates via SVN is there a way I can get this feature working in the near future or should i just wait till the next release candidate comes out?
Thanks for everyone's hard work. It is really appreciated!

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sun, 2007-01-21 06:23

I'm a bit confuse I think. Do you mean Release Candidate of the Gallery ? which feature are you interested in ?

Let me know !
-------------------------
The Termite - :-) - http://www.termitenshort.com/

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Sun, 2007-01-21 18:27
techsmarty wrote:
Since I don't have access to installing the latest updates via SVN is there a way I can get this feature working in the near future or should i just wait till the next release candidate comes out?

The SVN repository allows anonymous read access. Just follow the instructions at https://sourceforge.net/svn/?group_id=152389 to check out the latest version.

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Wed, 2007-01-31 23:40
eivind wrote:
I just upgraded the google map module to the latest SVN version after SiliconFiend committed the changes. Under the routes management tab, I chose the option to automatically update a file (was it albums.tpl?) so that the routes would be displayed in the map when using Internet Explorer. The result is that the main page of my gallery (gallery2/main.php) is now a blank page.

Note that there is a bug in the released version of the map module when interacting with the theme.tpl files included in G2.2. The current detection and modification code is somewhat brittle, so it doesn't work with the changes that have been made to the themes in G2.2. I updated that code in MapRouteAdmin.inc to work with G2.2 themes while preserving compatibility with earlier versions. It's not perfect but it's more likely to succeed in detecting the change if made manually, and less likely to damage the file if done automatically. The changes are in SVN.

 
techsmarty

Joined: 2006-12-29
Posts: 24
Posted: Thu, 2007-03-01 05:41

I just upgraded to 2.2 RC-2 and this is still a problem =( is there a reason everyone else seems to say this if fixed and on mine i have no luck fixing this?

Error (ERROR_REQUEST_FORGED)

* in modules/core/classes/GalleryController.class at line 239 (gallerycoreapi::error)
* in main.php at line 224 (gallerycontroller::assertisgenuinerequest)
* in main.php at line 94
* in main.php at line 83

System Information
Gallery version 2.2-rc-2
PHP version 4.4.4 cgi
Webserver Apache/1.3.37 (Unix) mod_fastcgi/2.4.2 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a PHP-CGI/0.1b
Database mysql 4.1.21-standard-log
Toolkits ImageMagick, Thumbnail
Operating system Linux box204.bluehost.com 2.6.19-1_3.BHsmp #1 SMP Mon Jan 15 07:50:58 MST 2007 x86_64
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Thu, 2007-03-01 16:35

You need to upgrade the Google Map module from SVN as well. If you don't want to do that, then just modify ShowMap.tpl to add {g->hiddenFormVars} at around line 146 (find the g->formVar calls and put it in with them).

 
techsmarty

Joined: 2006-12-29
Posts: 24
Posted: Sat, 2007-03-03 05:11

I just noticed that all the SVN servers I use don't include the map module, is there a specific one that I should be using?

Here is the current showmap.tpl file wasn't to sure what I was suppose to put in

      <form action="{g->url}" method="post" id="itemEdit" enctype="application/x-www-form-urlencoded">
      <div>
      <input type="hidden" name="g2_controller" value="map.ShowMap"/>
      </div>

      <input type='hidden' name="{g->formVar var="form[id]"}" value="{$form.id}"/>
      <input type='hidden' name="{g->formVar var="form[mode]"}" value="{$map.mode}"/>
      <input type='hidden' name="{g->formVar var="form[plugin]"}" value="{$map.plugin}"/>
      <input type='hidden' id="coord" name="{g->formVar var="form[coord]"}" value="{if $map.centerLongLat neq 'none'}{$map.centerLongLat}{else}-12,20{/if}"/>
      <input type='hidden' id="zoom" name="{g->formVar var="form[zoom]"}" value="{if $map.zoomLevel neq 'none'}{$map.zoomLevel}{else}16{/if}"/>
      <input type='submit' name="{g->formVar var="form[save]"}" value="{g->text text="Save these coordinates"}"  class="inputTypeSubmit"/>
      <input type='submit' name="{g->formVar var="form[cancel]"}" value="{g->text text="Cancel"}"  class="inputTypeSubmit"/>
      </form>

Thanks,
Joel

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22879
Posted: Sat, 2007-03-03 17:17
Quote:
all the SVN servers I use don't include the map module, is there a specific one that I should be using?

try:
http://gmap-module.svn.sourceforge.net/viewvc/gmap-module/Gallery2.1/modules/map/

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
primedomain

Joined: 2002-11-09
Posts: 115
Posted: Sun, 2007-03-04 11:31

I just upgraded from RC1 to RC2 and uploaded the latest google map files. When clicking on "install", I get:

Quote:
Error (ERROR_STORAGE_FAILURE) : Error trying to run query: CREATE TABLE g2_mapMap( g_itemId varchar(11) NOT NULL, g_field varchar(128) NOT NULL, g_value varchar(255), g_setId int(11), g_setType int(11), INDEX g2_mapMap_75985(g_itemId) ) ENGINE = ENGINE=InnoDB

* in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 1529 (gallerycoreapi::error)
* in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 1275 (gallerystorageextras::_executesql)
* in modules/core/classes/GalleryStorage.class at line 740 (gallerystorageextras::configurestore)
* in modules/core/classes/GalleryModule.class at line 146 (mysqlstorage::configurestore)
* in modules/core/PluginCallback.inc at line 236 (mapmodule::installorupgrade)
* in modules/core/PluginCallback.inc at line 73 (plugincallbackview::handlecallback)
* in index.php at line 433 (plugincallbackview::renderimmediate)
* in index.php at line 94
* in index.php at line 83

I had the module installed before and uninstalled/deleleted because of the authentification error. However, I was able to install the module and basically use it (apart from the autentification error).

Quote:
Gallery version 2.2-rc-2
PHP version 4.4.4 cgi
Webserver Apache/1.3.37 (Unix)
Database mysqlt 4.0.25-standard
Toolkits Thumbnail, SquareThumb, NetPBM, Gd
Operating system Linux infong 2.4 #1 SMP Thu Jan 13 08:59:31 CET 2005 i686 unknown

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Sun, 2007-03-04 18:27

I believe that's an incompatibility with the GalleryStorage function when trying to use Gallery 2.2 with modules written for Gallery 2.1. The problem is that line "ENGINE = ENGINE=INNODB" It's not expecting ENGINE twice. The fix is easy--just go to modules/map/classes/GalleryStorage/schema.tpl and remove the "ENGINE=" in front of "DB_TABLE_TYPE" (or it might say "TYPE="). It's around line 19. I haven't gotten around to creating a 2.2 branch for the map module yet, and the project leader Termitenshort says that the next release is going to target 2.1. As far as I know that's the only breaking change between 2.1 and 2.2 (meaning the code can't coexist in both versions of the map module). I have made some other changes for 2.2 compatibility, but they didn't break anything for 2.1.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sun, 2007-03-04 19:14

When Gallery 2.2 is fully released we'll make a branch for gallery 2.2 of the map module if the amount of changes isn't great :-)

See you !

-------------------------
The Termite - :-) - http://www.termitenshort.com/

 
abravorus

Joined: 2007-03-16
Posts: 10
Posted: Fri, 2007-03-16 07:57

Hello,

I have Gallery 2.2-rc2 installed with Google map module 0.5.1d. I replaced ShowMap.tpl with newer one from SVN, there is no Authentication Error anymore, thanks for advices here. But I still have another problem. Independently from the Zoom level set in Google Map album or Item properties I always have Google map displayed with maximum zoom level, which is not available for my locations. Looks like zoom level value is not read from item properties correctly and every time I need to manualy adjust zoom level. I changed MapHeader.tpl from SVN to remove "Hybrib"->"Hybrid" typo, but this didn't help with my initial zoom level problem.

I can demonstrate this by real example from my gallery - http://terijoki.spb.ru/g2/main.php?g2_itemId=2139 . Sorry, it's in Russian only, but it's easy to show you my problem. Just select from the pull-down menu (over the gallery tree) the very first item "Show a Google Map" and you will see the map with maximum zoom level, while it's set to 15 in album properties.

Thanks,
Alexandr

 
abravorus

Joined: 2007-03-16
Posts: 10
Posted: Fri, 2007-03-16 11:24

Sorry, probably I've understood the roots... I had only one point on the map and Autozoom and Autocenter switched on. With one point autozoom sets the maximum zoom level available, that's not a bug, that's a feature, I guess :)

 
bugambilia

Joined: 2006-06-20
Posts: 9
Posted: Thu, 2007-05-17 21:21

I'm figuring out how to use SVN. But in the meantime, I was able to get around by downloading the ShowMap.tpl from here and replaced it in my directory:
http://gmap-module.svn.sourceforge.net/viewvc/gmap-module/Gallery2.1/modules/map/templates/

Running
Gallery version = 2.2.1 core 1.2.0.1
Google Map Module 0.5.1d

 
sphism
sphism's picture

Joined: 2006-10-11
Posts: 4
Posted: Wed, 2007-05-23 00:15

I've just upgraded to gallery 2.2.1

installed the Map module 0.5.1d

I get the same problem as the first post here:
__________________________________________________________________________________________
Authentication Failure

Your change cannot be completed due to a loss of session data. Please try again. If it still doesn't work, try logging out and logging back in.

Back to the Gallery
Error Detail -
Error (ERROR_REQUEST_FORGED)

* in modules/core/classes/GalleryController.class at line 239 (GalleryCoreApi::error)
* in main.php at line 224 (GalleryController::assertIsGenuineRequest)
* in main.php at line 94
* in main.php at line 83

System Information
Gallery version 2.2.1
PHP version 5.2.1 cgi-fcgi
Webserver Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.4 mod_ssl/2.8.22 OpenSSL/0.9.7e
Database mysql 5.0.24a-standard-log
Toolkits SquareThumb, ImageMagick, Thumbnail, NetPBM, Gd
Operating system Linux snicker 2.4.32-grsec+f6b+gr217+nfs+a32+fuse23+tg+++opt+c8+gr2b-v6.194 #1 SMP Tue Jun 6 15:52:09 PDT 2006 i686
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
_______________________________________________________________________________________

I'm wondering if it's because the gallery is embedded and the users are dealt with outside of gallery2 itself???

ANy help would be much appreciated,

cheers,

matt

ps this looks like an awesome module, i cannot wait to get this up and running, great work everyone.

Spherculism ~:~ The Act of Becomming Spherculish [ www.spherculism.net ]

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Wed, 2007-05-23 03:49

No, it's because the Map module 0.5.1d is not compatible with Gallery 2.2 as-is. You can either download the single file ShowMap.tpl from SVN, or patch it yourself by adding {g->hiddenFormVars}, or download the entire SVN version or wait a very short while for the next version to be released.

 
sphism
sphism's picture

Joined: 2006-10-11
Posts: 4
Posted: Thu, 2007-05-24 07:52

Cheers Chief :) looking forward to getting it working.

m

Spherculism ~:~ The Act of Becomming Spherculish [ www.spherculism.net ]

 
ruggi

Joined: 2006-09-23
Posts: 45
Posted: Mon, 2007-07-16 23:22

Thanks SiliconFiend, I've downloaded the SVN version and it works just fine!