How can I restore missing admin directory to running Gallery site?

Charlie_Hein
Charlie_Hein's picture

Joined: 2008-07-11
Posts: 30
Posted: Sun, 2011-11-13 13:19

I have recently taken over the administration of our club web site and it appears that the /admin folder for our Gallery installation is missing. How can I restore these files?

Charlie

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2011-11-13 14:04

Gallery2 does not have an "/admin" folder.
it would be something like:
yoursite.com/gallery2/main.php?g2_view=core.SiteAdmin

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Charlie_Hein
Charlie_Hein's picture

Joined: 2008-07-11
Posts: 30
Posted: Fri, 2011-11-18 19:03

I am quite confused by your statement... when I log in and choose site admin, this is the link that is given to the web browser:

super long url

This sure seems to indicate that Gallery2 is looking for an \admin folder... and I get a 404 error which is what I would expect if the folder and its contents did not exist (which it does not)... what am I missing here?

I don't mean to be contradictory, I just do not understand.

Charlie

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2011-11-14 00:12
 
Charlie_Hein
Charlie_Hein's picture

Joined: 2008-07-11
Posts: 30
Posted: Mon, 2011-11-14 01:04

So, what can I do to fix this problem?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2011-11-14 01:34
 
Charlie_Hein
Charlie_Hein's picture

Joined: 2008-07-11
Posts: 30
Posted: Mon, 2011-11-14 03:01

Yes. I had to log in first, but it let me in. That said, the only options I had available to me were the User Options (Account Settings, Change Password and Watermarks) just for myself.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2011-11-14 03:45

Then you're not logged in as an admin.
When you got handed the keys to the club, did anyone give you admin rights? or the password to the admin account?

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2011-11-14 04:18
 
Charlie_Hein
Charlie_Hein's picture

Joined: 2008-07-11
Posts: 30
Posted: Mon, 2011-11-14 05:11

Had it previously, did much of the day to day stuff.

 
Charlie_Hein
Charlie_Hein's picture

Joined: 2008-07-11
Posts: 30
Posted: Mon, 2011-11-14 05:20

Okay, I'm slow but catching on... you're saying that it might be that someone removed admin access from my user profile? Sounds reasonable, but if that were the case would I still be seeing the "site admin" link? It does show up when I am logged in - it is what prompted me to check this out in the first place. I'll check out the link you sent tomorrow, it's late locally and i need to be up early for work.

By the way, I don't think I've said this so far, and it's way overdue - I appreciate your help a lot. Thanks so much for trying to help me sort this out.

Charlie

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2011-11-14 12:48
Quote:
would I still be seeing the "site admin" link?

That certainly suggests you have admin access.
After you are logged in visit this link http://sfaaa.com/gallery2/main.php?g2_view=core.SiteAdmin

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Charlie_Hein
Charlie_Hein's picture

Joined: 2008-07-11
Posts: 30
Posted: Fri, 2011-11-18 12:33

Sorry for the delay in getting back to you on this - life intrudes. I'm getting a blank screen now (all white).

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2011-11-18 12:37
 
Charlie_Hein
Charlie_Hein's picture

Joined: 2008-07-11
Posts: 30
Posted: Fri, 2011-11-18 15:54

The link appears to work (no 404 error), but nothing actually loads up. I get a blank screen.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2011-11-18 17:12

put gallery into buffered debug mode and copy the output to a txt file and attach it to your next response.
Don't bother copying the smarty debug, it won't help.

FAQ: How to set/use Gallery in debug mode?

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Charlie_Hein
Charlie_Hein's picture

Joined: 2008-07-11
Posts: 30
Posted: Fri, 2011-11-18 19:02

Okay... I turned on debug mode, logged in and got this output: see debug1.txt attached

I clicked the "Continue to the next page" link, which loaded the Main Gallery page. Then I pasted the link you gave me into the browser address bar and pressed return. This is what was returned: see debug2.txt attached

Charlie

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Fri, 2011-11-18 18:10

What do you use the "mranalysis" module for?
I have actually never heard of it.

***EDIT***
Read up on it in the codex.

Use the code here to disable it: http://gallery.menalto.com/node/103440#comment-380174
Edit "recaptcha" in the code to "mranalysis"

--
dakanji.com

 
Charlie_Hein
Charlie_Hein's picture

Joined: 2008-07-11
Posts: 30
Posted: Fri, 2011-11-18 19:06

Okay, progress for sure but no cure yet. I ran the code to remove that module (thanks much), and I am able to paste in the direct link to the site admin area and load the site admin page, which shows all the various options as expected. However, none of the links are working. I'm getting the 404 error just as I do when I try to use the site admin link on the main page.

Charlie

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2011-11-18 19:55

seems your rewrite rules may be messed up. try disabling rewrite the same way you disabled mranalysis

When rewrite was setup there was a warning about applying rules to the admin links. when they break, you're without any admin links.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Charlie_Hein
Charlie_Hein's picture

Joined: 2008-07-11
Posts: 30
Posted: Fri, 2011-11-18 20:46
Quote:
seems your rewrite rules may be messed up. try disabling rewrite the same way you disabled mranalysis

Makes total sense and worked like a charm - thanks!

Quote:
When rewrite was setup there was a warning about applying rules to the admin links. when they break, you're without any admin links.

Wouldn't know a thing about that as I didn't set it up, but this begs a question: Is it possible to generate "friendly" url's just for the gallery images themselves and not the entire site? We really only need the "friendly" URL's for linking images from the gallery to other places. If there is a way to only generate the URL's from within an album that would be ideal.

Charlie

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2011-11-18 22:47

Head to gallery admin -> plugins -> rewrite and uninstall
this will remove the current rewrite setting which were broken.
then re-install the rewrite module and head to gallery admin -> rewrite to setup new rules.
But this time I don't advise to rewrite admin links.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Charlie_Hein
Charlie_Hein's picture

Joined: 2008-07-11
Posts: 30
Posted: Sat, 2011-11-19 11:30

Interesting, when I tried to go into the plugins menu the page did not load. Turned debugging back on and see this old friend when I try to navigate to the plugins menu:

Quote:
Parse error: syntax error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /homepages/19/d87286445/htdocs/gallery2/modules/mranalysis/module.inc on line 50

UPDATE: I tried to remove the module again but this did not fix the issue. Any ideas?

Charlie

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2011-11-19 13:32

change gallery2/modules/mranalysis/module.inc line 50 from:
static function isModuleInstalledAndActive( $modulename ) {
to:
function isModuleInstalledAndActive( $modulename ) {

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2011-11-19 14:29

The script should have physically deleted the module files.

Delete the "/gallery2/modules/mranalysis" folder if still present and then go to "/gallery2/lib/support" and follow the steps there to clear your cache. Finally, clear your browser cache or try viewing with another browser or on another machine.

--
dakanji.com

 
Charlie_Hein
Charlie_Hein's picture

Joined: 2008-07-11
Posts: 30
Posted: Sat, 2011-11-19 16:42

Tried both options, changing the line in the modules.inc and then deleting the directory altogether. Both options left me with this error:

Quote:
Error 500 - Internal server error

An internal server error has occured!
Please try again later.

Of course, now the directory is gone for good.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2011-11-19 17:28

try downloading a fresh copy of the analysis module http://www.markridgwell.com/Downloads/mranalysis.zip
edit line 50 like I suggested above
upload the module to your modules directory

also make sure you have modules/rewrite in place as well
if not, get a fresh copy from http://downloads.sourceforge.net/gallery/g2-module-rewrite-1.1.19.zip
and upload to your modules directory

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Charlie_Hein
Charlie_Hein's picture

Joined: 2008-07-11
Posts: 30
Posted: Sat, 2011-11-19 19:27

Interesting... I uploaded the fresh files without editing line 50 and I'm back to the blank page (where the syntax error stops the page load). This was what I expected. When I edit line 50 of the modules.inc file as suggested, I get the 500 error. Anyway, at this point I restored the original modules.inc so at least we're back at square one.

FYI, I checked and the rewrite module's files are still present just as the myanalysis module's files were. They were not removed when the code was run to deactivate the module and remove the files. Not sure why.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2011-11-19 20:51

your editor is probably contaminating the module.inc file.
here is a pre-edited version.
do not open in your editor, simply rename to module.inc and upload/overwrite /gallery2/modules/mranalysis/module.inc

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Charlie_Hein
Charlie_Hein's picture

Joined: 2008-07-11
Posts: 30
Posted: Sat, 2011-11-19 21:38

Do you know of a way to directly download the attachment? I can open it in a browser window, where my options seem to be "save page as" from FF or to select the text and paste it into notepad. Either method gives me a file that causes the 500 error. I put the original file back just to be sure that things returned to "normal", and it did.

I sent you a PM with my email address - if you'd like to send the file that way at least we'd rule out corruption on my end.

Also, if it's the editor I'm using that's mangling the file, what would be a proper editor to use?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2011-11-19 21:49

notepad++ is a great free editor
As is my favorite Aptana Studio

But right-clicking the above link and save as module.inc should be appropriate.

If you want to PM me ftp access info along w/ gallery admin login info we could probably have this nipped in just a few minutes.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Charlie_Hein
Charlie_Hein's picture

Joined: 2008-07-11
Posts: 30
Posted: Sun, 2011-11-20 01:57

Got the same issue downloading the file directly, not thinking that I'm trashing the file but you can never tell I guess. Check your PM's!