CGI Error on Security 1.0.3 update

Support for IntegraMOD 140

Moderator: Integra Moderator

CGI Error on Security 1.0.3 update

PostAuthor: Jason Sanborn » Thu Apr 13, 2006 4:19 pm

Here's the situation:

Dev Computer: Windows XP Pro // IIS 5.1 // PHP 4.4.2 Running as CGI
IntegraMOD 1.4.0 // phpBB 2.0.19 // phpBB Security 1.0.3

Live Server: Windows 2003 // IIS 6 // PHP 4.4.2 Running as ISAPI
IntegraMOD 1.4.0 // phpBB 2.0.19 // phpBB Security 1.0.2

When I updated my Dev Computer to phpBB Security 1.0.3, the CGI module for PHP crashed and the ACP Panel returned a CGI Error. I haven't updated my live site for obvious reasons.

Now, when reading through information relating to this, I have tracked the error down to the following location:

File: admin/index.php
Line Number: Around 77
Line Value: $secfile = @file('http://phpbb-tweaks.com/secver.txt');

When I comment out the above line, the module no longer crashes, and I can open my ACP. Only problem is the feature for alerting me to if an update is needed for phpBB Security always says that it can't get the version data.

Now, the obvious work-around would be to comment out the entire section that was added to that file:

Code: Select all
/*#======================================================================= |#==== Start];     $this_ver   = $board_config['phpBBSecurity_version'];             if ($newest_ver == $this_ver)             $msg .= 'The newest release is <b>'. $newest_ver .'</b>. The version you are using is             <b>'. $this_ver .'</b>. So I would have to say you are up to date!';         else             $msg .= 'The newest release is <b>'. $newest_ver .'</b>. The version you are using is             <b>'. $this_ver .'</b>. So I would have to say you need to upgrade ASAP!';         }             $msg .= '             </span>';     $msg .= '         </td>';     $msg .= '    </tr>';     $msg .= '    <tr>';     $msg .= '         <th> </th>';     $msg .= '    </tr>';     $msg .= '</table>';     echo $msg;#====#==== Author: aUsTiN [austin@phpbb-amod.com] [http://phpbb-tweaks.com] = |#==== End: ==== phpBB Security ========================================= |   #======================================================================= |*/


The problem with doing that is that the feature goes away. The thing is, the same feature works fine for phpBB and for IntegraMOD, and the update information is displayed as expected. So I know there is a way to get that to work without using @file to the remote site. Unfortunately, my knowledge of PHP is quite limited. That is why I post this issue here. Perhaps one of the PHP gurus here might be able to restructure this code to still work, so that users on Windows based systems won't have this issue.
Last edited by Jason Sanborn on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 10:40 am
Cash on hand: 0.00
Location: Marina, CA

PostAuthor: Jason Sanborn » Mon May 22, 2006 6:38 pm

I found a solution to this problem.

OPEN: adminindex.php

FIND:
Code: Select all
#======================================================================= |#==== Start];     $this_ver   = $board_config['phpBBSecurity_version'];             if ($newest_ver == $this_ver)             $msg .= 'The newest release is <b>'. $newest_ver .'</b>. The version you are using is             <b>'. $this_ver .'</b>. So I would have to say you are up to date!';         else             $msg .= 'The newest release is <b>'. $newest_ver .'</b>. The version you are using is             <b>'. $this_ver .'</b>. So I would have to say you need to upgrade ASAP!';         }             $msg .= '             </span>';     $msg .= '         </td>';     $msg .= '    </tr>';     $msg .= '    <tr>';     $msg .= '         <th> </th>';     $msg .= '    </tr>';     $msg .= '</table>';     echo $msg;#====#==== Author: aUsTiN [austin@phpbb-amod.com] [http://phpbb-tweaks.com] = |#==== End: ==== phpBB Security ========================================= |   #======================================================================= |


REPLACE WITH:
Code: Select all
#======================================================================= |#==== Start];                 if ($newest_ver == $this_ver)         {             $msg .= 'The newest release is <b>'. $newest_ver .'</b>. The version you are using is             <b>'. $this_ver .'</b>. So I would have to say you are up to date!';         }         else         {             $msg .= 'The newest release is <b>'. $newest_ver .'</b>. The version you are using is             <b>'. $this_ver .'</b>. So I would have to say you need to upgrade ASAP!';         }     }     else     {         if ($errstr)         {             $msg .= '<p>Sorry, I was unable to get version data at this time. Please try later.<br>'. $errstr . '</p>';         }         else         {             $msg .= '<p>' . $lang['Socket_functions_disabled'] . '</p>';         }     }       $msg .= '             </span>';     $msg .= '         </td>';     $msg .= '    </tr>';     $msg .= '    <tr>';     $msg .= '         <th> </th>';     $msg .= '    </tr>';     $msg .= '</table>';     echo $msg;#====#==== Author: aUsTiN [austin@phpbb-amod.com] [http://phpbb-tweaks.com] = |#==== End: ==== phpBB Security ========================================= |   #======================================================================= |
Last edited by Jason Sanborn on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 10:40 am
Cash on hand: 0.00
Location: Marina, CA

PostAuthor: Jason Sanborn » Mon May 22, 2006 6:39 pm

This changes the way that the version file is read from the phpbb-tweaks.com site so that it functions in much the same way as the phpbb version and the IntegraMod news files are read. This should work on Windows and *nix servers.
Last edited by Jason Sanborn on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 10:40 am
Cash on hand: 0.00
Location: Marina, CA

PostAuthor: Adrian Rea » Tue May 23, 2006 9:02 pm

Well done Jason [flash=,:1amo5wwr]http://integramod.com/forum/images/icon/icon14.gif[/flash:1amo5wwr]


Have you considered relaying this to Austin, the Mod's creator?

Thanks again, good diagnosis and treatment <img>

A
Last edited by Adrian Rea on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Adrian Rea
Sr Integra Member
Sr Integra Member
 
Posts: 1263
Likes: 0 post
Liked in: 0 post
Joined: Sun Mar 12, 2006 12:59 am
Cash on hand: 0.00

PostAuthor: Jason Sanborn » Tue May 23, 2006 9:20 pm

I would, but it doesn't seem to allow me to post. I joined but his security settings say I can't post. <img>

Maybe someone who's been a member over there can give more feedback on the situation?
Last edited by Jason Sanborn on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 10:40 am
Cash on hand: 0.00
Location: Marina, CA

Re: CGI Error on Security 1.0.3 update

PostAuthor: Adrian Rea » Thu May 25, 2006 4:27 am

I did pm Austin myself, and he has replied
I'm not going to create a username there to post once, so if you like you can relay this.

My way works fine if the site is online, if you have a test site on your PC using EasyPHP or similar, then naturally its going to crash out because its on your local on not the net.

None the less, i will consider when i update it, changing it to something more similar using fsocket instead of file.
I am happy to return any productive comments from this.

A
Last edited by Adrian Rea on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Adrian Rea
Sr Integra Member
Sr Integra Member
 
Posts: 1263
Likes: 0 post
Liked in: 0 post
Joined: Sun Mar 12, 2006 12:59 am
Cash on hand: 0.00

PostAuthor: Jason Sanborn » Thu May 25, 2006 7:42 am

Thanks, A. I will double check on my live server to verify, but I think it happened there as well. I have a dedicated Windows 2003 server, so can create a test site without affecting any of my live sites.

This issue seems to be involving Windows and IIS running php either as a CGI plugin (which is what I do locally) or as an ISAPI filter (which is what my server runs).

As an additional FYI, when I wasn't connected to the net, it gave no error at all. It simply stated that it couldn't retrieve the information (as expected).
Last edited by Jason Sanborn on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 10:40 am
Cash on hand: 0.00
Location: Marina, CA

PostAuthor: Adrian Rea » Thu May 25, 2006 11:39 pm

Do you think it could be some wierd firewall issue?

Also I note that once on old integraMOD there was one person who could never get the Integramod info link in ACP.

A
Last edited by Adrian Rea on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Adrian Rea
Sr Integra Member
Sr Integra Member
 
Posts: 1263
Likes: 0 post
Liked in: 0 post
Joined: Sun Mar 12, 2006 12:59 am
Cash on hand: 0.00

PostAuthor: Jason Sanborn » Fri May 26, 2006 7:13 am

I wouldn't think so, but I suppose it could be possible. Another possibility could be server configuration with regards to DNS resolution. These issues shouldn't cause crashes, though.

I haven't had a chance to create a test site on my server yet. Plan on doing that later today.
Last edited by Jason Sanborn on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 10:40 am
Cash on hand: 0.00
Location: Marina, CA

PostAuthor: Jason Sanborn » Fri May 26, 2006 4:53 pm

Ok. I checked on my web server directly and the error didn't appear. Therefore the problem appears to only exist if the user is hosted on a Windows server that has PHP installed as CGI instead of ISAPI.

I still think the fix would be good to have, simply because it does affect some people (probably a very small group).
Last edited by Jason Sanborn on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 10:40 am
Cash on hand: 0.00
Location: Marina, CA

Re: CGI Error on Security 1.0.3 update

PostAuthor: davidgreen73 » Wed Aug 30, 2006 2:37 pm

I am one of those few that the fix worked for. (Just a heads up)
Last edited by davidgreen73 on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

davidgreen73
Newbie
Newbie
 
Posts: 7
Likes: 0 post
Liked in: 0 post
Joined: Fri Aug 25, 2006 10:42 am
Cash on hand: 0.00


Return to IntegraMOD 140

Who is online

Registered users: App360MonitorBot, Bing [Bot], Google [Bot]