Posted on: 01/31/05 10:50pm
By: Anonymous (jfade)
Hi everyone. I just moved to a new host and when I went to install geeklog, I was greeted by a message saying that register_globals needed to be on. Well, I couldn't enable it since I'm on shared hosting, so I installed anyway. The first problem I had was not being able to log in through the admin/moderation link. I found a way around by logging in through users.php. Once I was in I clicked on the stories section to make a new story and it wouldn't load. I tried loading it in a new window and that didn't work either. Then I tried clicking the edit link and it worked. I was able to edit and existing story. But I still wasn't able to make a new one. However, I later found by going to story.php?mode=edit I was able to make a new story. It seems to be the listing of the stories that's causing the problem. I contacted my host asking if they could enable register_globals, but they said they wouldn't for security reasons and gave me this snippet of code.
<?php
// Emulate register_globals on
if (!ini_get('register_globals')) {
$superglobals = array($_SERVER, $_ENV,
$_FILES, $_COOKIE, $_POST, $_GET);
if (isset($_SESSION)) {
array_unshift($superglobals, $_SESSION);
}
foreach ($superglobals as $superglobal) {
extract($superglobal, EXTR_SKIP);
}
ini_set('register_globals', true);
}
?>
I put this in the moderation.php file and I was now able to log in like normal in the admin section instead of using the users.php workaround. But even though I inserted this code into just about every php file I could find related to story.php, I still can't get a story list to come up, but it's a minor thing since I can edit existing ones by clicking the edit link in an existing story and by using the link to make a new one, but it's still something I'd like to fix, since everything else works fine. Any ideas anyone? Thanks in advance!
Work around to register_globals and stories?
Posted on: 02/01/05 01:35am
By: Anonymous (mach)
why not have that bit of code execute at the beginning of lib-common.php, which is included on every page anyway. just an idea.
Work around to register_globals and stories?
Posted on: 02/01/05 06:28am
By: LWC
Why hacking Geeklog's files when can just use
htaccess[*1] ?
Work around to register_globals and stories?
Posted on: 02/01/05 10:31am
By: vinny
That's funny. The code they gave you does the exact same thing as what happens when register globals is enabled. Hosting companies seem, in general, to be a little "funny" (and not "ha ha" funny, but "uh oh" funny).
Putting that snippet of code at the start of lib-common.php or else at the end of config.php would work just find (and you wouldn't have to edit 100s of php files).
The htaccess work around LWC linked to may not work for you depending on how the hosting company set things up (and from their response to you, I'm betting it probably will not work).
-Vinny
Work around to register_globals and stories?
Posted on: 02/02/05 10:51pm
By: Anonymous (jfade)
Thanks for your replies everyone, I'll try the htaccess file tomorrow when I have a bit more time. I did insert that code in lib-common and config, but it's still not listing properly. : But I will try some other files and see what happens and let you know. Thanks again for the help!
Work around to register_globals and stories?
Posted on: 02/03/05 08:35am
By: Anonymous (goodwebhost)
[QUOTE BY= vinny] That's funny. The code they gave you does the exact same thing as what happens when register globals is enabled. Hosting companies seem, in general, to be a little "funny" (and not "ha ha" funny, but "uh oh" funny).
Putting that snippet of code at the start of lib-common.php or else at the end of config.php would work just find (and you wouldn't have to edit 100s of php files).
The htaccess work around LWC linked to may not work for you depending on how the hosting company set things up (and from their response to you, I'm betting it probably will not work).
-Vinny[/QUOTE]
probably that way bad injections can be somewhat prevented .
Also is the fact that not all the clients will be using these snippet as all other messageboards and cms now work with reg glob off
so far as how funny the hosting companies are - they are just abiding by what php.net says and what recoomendations are there in the php.ini file
Work around to register_globals and stories?
Posted on: 02/07/05 05:43pm
By: Anonymous (jfade)
Sorry for taking so long to get back to you on the htaccess file, but it didn't work, nor did the code the host gave me, I still can't get to the story list, and it seems to have gotten worse as I can't edit stories normally via the link anymore, I have to use the SQL editor instead. Is there something else that could be causing the problems, or is there any other code I could use to help? Thanks in advance!