elgg-gitbot / test2

0 stars 0 forks source link

Problem with the message board (Trac #1409) #100

Closed elgg-gitbot closed 11 years ago

elgg-gitbot commented 11 years ago

_Original ticket http://trac.elgg.org/ticket/1409 on 2009-12-11 by trac user avinashzena, assigned to unknown.

Elgg version: 1.7

Hi,

This is a very rare kind of problem i feel and could not find similar posts any where.

I did my elgg installations and was working fine but in the past few days i noticed an error where If User 'A' is posting a message on the messageboard widget of User 'B' then the message actually gets posted as User B wrote on User B's message board. Which is actually User A who is writing the message.

This error was not existing until few days.

PLEASE HELP!

URL: club.projectguru.in

elgg-gitbot commented 11 years ago

cash wrote on 2009-12-11

You are probably running PHP as CGI. This is not officially supported by Elgg and can cause some strange problems.

elgg-gitbot commented 11 years ago

cash wrote on 2010-02-01

works for me

elgg-gitbot commented 11 years ago

trac user djSupport wrote on 2010-10-14

This is still an issue I dont know much about coding or why CGI would make a difference can they not write the code so it works both ways? The information given here no longer applies : http://community.elgg.org/pg/plugins/release/9999/developer/fuhrmaramysnc.de/fixed-messageboardplugin-04

Due to code changes!

Im using Release - 1.7.4, Version - 2010071002 I Guess this is how I know Im running CGI? Server API : CGI/FastCGI Could this be fixed in some way so it works from the get go? Where not all experienced coders! But If I was I'd love to help the Elgg Community! Regards, djSupport (Adam Collins)

elgg-gitbot commented 11 years ago

cash wrote on 2010-10-14

I have tried to reproduce this with PHP running as a FastCGI process and I can't. It's not like every CGI user has this problem so there has to be some sort of variability in the server configuration. There may be a way to write the code to work around this, but without being able to reproduce it, there's not a lot we can do.

Can you provide the configuration information on your server: Apache version, Apache configuration files, PHP output from phpinfo()?

elgg-gitbot commented 11 years ago

Milestone changed to Unscheduled by cash on 2010-10-14

elgg-gitbot commented 11 years ago

trac user djSupport wrote on 2010-10-14

Like this? Like I said Im a virgin to coding ;) [http://www.photographyfriends.co.uk/data.php]

elgg-gitbot commented 11 years ago

cash wrote on 2010-10-14

That's a good start!

Here is your server info: Server: Apache mod_fcgid/2.3.5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635

I'm guessing this is a cheap shared hosting site and you don't have access to php.ini, http.conf or other configuration files. Is that correct?

elgg-gitbot commented 11 years ago

trac user djSupport wrote on 2010-10-14

Its Reseller hosting from Godaddy and I run the whole of it ;) I believe you can set php settings with php.ini

elgg-gitbot commented 11 years ago

cash wrote on 2010-10-14

Do you have shell access then?

elgg-gitbot commented 11 years ago

trac user djSupport wrote on 2010-10-14

No but I have previously used php.ini to turn register_globals off

I do have a virtual dedicated server used as a game server at the moment with shell access but havent got a clue on how to get that setup for a website...

Its easier just to pump out websites on this reseller hosting account...

elgg-gitbot commented 11 years ago

cash wrote on 2010-10-14

Would you be able to hook me up with a website on your reseller account with ftp access? I'd need it for a few days to try to debug this. I've tried on servers that I have access to and have never been able to reproduce it. If so, you could send me the info on the Elgg community site through private messaging. I just followed you on there.

elgg-gitbot commented 11 years ago

trac user djSupport wrote on 2010-10-14

No problem its 1am in england so Im off to bed I'll setup the account now...

elgg-gitbot commented 11 years ago

cash wrote on 2010-10-15

Turns out it is not due to CGI, it's just that lame hosters tend to use CGI and have register_globals turned on. The register_globals is the issue. Another reason it only shows up for CGI is that CGI does not take php directives from the .htaccess. I tried using ini_set() and it wouldn't take. Looks like the administrator of the server must correct it.

For those who do not want to find a better hosting solution, check mod/messageboard/ajax_endpoint/load.php and change the $user variable to $ineedtofindbetterhosting so that the code looks like this:

$ineedtofindbetterhosting = get_entity(get_input('pageOwner'));

$u = get_loggedin_user();

//stage one - if a message was posted, add it as an annotation    
if ($message) {

    if (!messageboard_add(get_loggedin_user(), $ineedtofindbetterhosting, $message, $ineedtofindbetterhosting->access_id)) {
        echo elgg_echo("messageboard:failure");
    }

} else {
    echo elgg_echo('messageboard:somethingwentwrong');
}

$contents = $ineedtofindbetterhosting->getAnnotations('messageboard', $numToDisplay, 0, 'desc');
elgg-gitbot commented 11 years ago

trac user djSupport wrote on 2010-10-15

Ok I have solved my issue by dropping a plain text file saved as php.ini which contains the following :

register_globals = OFF

and dropping it in all the directorys under /mod/messageboard/