Possible bug in log_into_moodle() function?

  • Ian Wild
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 7 months ago #1 by Ian Wild
Hi,

I've just been investigating an issue with redirectless sso and see there is a potential issue in the log_into_moodle() function. To get the tmp_path variable on lines 163 and 164 of /plugins/user/joomdlehooks/joomdlehooks.php (R0.92) you have:

$temppath = $mainframe->getCfg( 'config.tmp_path' );
$temppath = '/tmp';

The first line is wrong and should read:

$temppath = $mainframe->getCfg( 'tmp_path' );

... and the second shouldn't be there at all as it simply overwrites the actual temporary path.

I just wanted to check that this is right :unsure: ?

Thanks in advance,

Ian.

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #2 by Antonio Durán
Replied by Antonio Durán on topic Possible bug in log_into_moodle() function?
Thanks for the bug report, I think you are totally right.
I will include the fix in next release.

Please Log in or Create an account to join the conversation.

  • Ian Wild
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 7 months ago #3 by Ian Wild
Replied by Ian Wild on topic Possible bug in log_into_moodle() function?
Hi Antonio,

Thanks for your response. I think there is another issue on line 188 in the same function. If fopen() fails and returns an invalid file pointer (e.g. a permission problem) then you can get stuck in the while loop and never return... see the warnings here:

www.php.net/manual/en/function.feof.php

Hope this helps,

Ian.

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #4 by Antonio Durán
Replied by Antonio Durán on topic Possible bug in log_into_moodle() function?
Hi Ian. Thanks for your feedback. You are right: we should be doing proper return check after fopen. Will fix it for next release.

Thank you!

Please Log in or Create an account to join the conversation.