[pmwiki-users] Users not logged in get a blank page

Peter van Es vanes.peter at gmail.com
Thu Apr 2 08:50:50 PDT 2020


Dear all,

with Petko’s help I found that the latest version of SMF (2.0.17) has introduced some inconsistencies in files included by SSI.php
which created the problem I ran into. I’m also running php version 7.3.

I removed all the code from auth-smf.php which I did not use, and removed most of my cookbook recipies from config.php. That did not solve the problem. Petko suggested the following
fix to auth-smf.php but it did not help me.

diff -u auth-smf*
--- auth-smf.php	2020-03-31 21:15:06.683249468 +0200
+++ auth-smf-php72.php	2020-03-31 21:19:52.113400462 +0200
@@ -91,9 +91,12 @@
require_once ("$FarmD/scripts/authuser.php");

Markup('ssi_function','directives',
-  '/\\(:smf-(.*?)\\s*:\\)/e',
-  "Keep(ssiFunction(\$pagename, PSS('$1')))");
-function ssiFunction($pagename, $args) {
+  '/\\(:smf-(.*?)\\s*:\\)/',
+  "mu_ssiFunction");
+function mu_ssiFunction($m) {
+  return Keep(ssiFunction($m[1]));
+}
+function ssiFunction($args) {
	global $ScriptUrl;
	$args = ParseArgs($args, '(?>(\\w+)=)');
	$fn = array_shift($args['']);


Then I created a new, private version of SSI.php which I include in auth-smf.php in which I removed extraneous stuff so that I could narrow it down to a problem area…

Something has changed in the loadTheme call, which when initialised for a non-user, creates the blank page in certain situations. For a logged-in user it does need to be initialised in order to pass
the user details to auth-smf.php properly.

So I changed the code to:

// Load the current or SSI theme. (just use $ssi_theme = id_theme;)
// PvE... this is where it goes wrong with auth-smf.
// loadTheme(isset($ssi_theme) ? (int) $ssi_theme : 0);
// If we are logged in, we need to initialise the theme, otherwise, not...
if (isset($user_settings[‘id_member'])) {
	loadTheme(0, true); // initialise the theme
} else {
	loadTheme(0, false); // do NOT initialise the theme
}

Again, thanks to Petko for his patient help.

Peter van Es

> On 31 Mar 2020, at 21:10, Peter van Es <vanes.peter at gmail.com> wrote:
> 
> Hi Petko,
> 
> thanks for your suggestion. 
> 
> Engine and Main are Groups of Wiki pages. They do not have php code and do not make calls.
> I did check the troubleshooting page, but there are no error messages and no php errors (I set-up logging in php.ini)
> I disabled all the add-ons in local/config.php, but no difference, still blank pages.
> I also checked all the file and directory permissions and ownership of the files, Groups and upload directories.
> 
> I enabled diagnostics, and looked at the page using ?action=ruleset but it doesn’t tell me much  https://www.sl113.org/wiki/Engine/Start?action=ruleset <https://www.sl113.org/wiki/Engine/Start?action=ruleset> 
> 
> The page displays, but then there are no pictures on it.
> 
> I am using Auth-SMF and this has always worked well. Even now, when logged in, the Wiki works correctly. 
> 
> I’m thinking of a problem when $AuthId = ‘’; (i.e. blank) and there is a .jpg or .png picture meant to be shown on the page.
> 
> Peter
> 
>> On 31 Mar 2020, at 19:34, Petko Yotov <5ko at 5ko.fr <mailto:5ko at 5ko.fr>> wrote:
>> 
>> Let's say that we need to first try to fix the blank pages problem and then the SMF integration (unless it is the integration that causes the blank pages).
>> 
>> Also: there appear to be 3 addons for SimpleMachinesForum integration in the PmWiki cookbook, which one do you use?
>> 
>> Petko
>> 
>> On 31/03/2020 19:28, Petko Yotov wrote:
>>> Completely blank pages without any message often are caused by a call
>>> to a function that is not defined - either mis-typed or
>>> deprecated/removed.
>>> I'd review all files in the "local" directory if some of them, notably
>>> those starting with "Engine" and "Main", make some suspicions calls.
>>> Otherwise, see the page Troubleshooting in the documentation -- it can
>>> be an older addon that calls an undefined function, or that calls
>>> htmlspecialchars(). Troubleshooting contains instructions on how to
>>> track the cause:
>>>  https://www.pmwiki.org/wiki/PmWiki/Troubleshooting <https://www.pmwiki.org/wiki/PmWiki/Troubleshooting>
>>> First section for tracking, see also the section on blank pages near
>>> the middle of that page.
>>> Petko
>>> --
>>> If you upgrade :  http://www.pmwiki.org/Upgrades <http://www.pmwiki.org/Upgrades>
>>> On 31/03/2020 18:48, Peter van Es wrote:
>>>> I have a weird problem on my PmWiki, and it’s behaviour has recently
>>>> started changing.
>>>> I have a recent PMWiki installation (version 2.2.127) running on a
>>>> Ubuntu 16.04.4 LTS version, with a recent plesk update and php7.3
>>>> It coexists with a SimpleMachinesForum (SMF) installation which is
>>>> used for user authentication. That install was recently upgraded to
>>>> version 2.0.17
>>>> Users logged into the forum have no problem seeing all the content of
>>>> my Wiki (except for restricted pages) — even if they do not have
>>>> edit rights.
>>>> However users not logged into the forum, who used to be able to see
>>>> all non-restricted content, now get served a completely blank page.
>>>> I do not have a log in box, because most people log in via the forums.
>>>> Then their
>>>> 	* AuthId:
>>>> 	* Author:
>>>> are both blank (empty).
>>>> I have no php errors in my log.
>>>> The other weird thing: pages which show up blank have images (i.e.
>>>> uploads) on them. The file and directory access rights have all been
>>>> set correctly.
>>>> A page which shows up blank is:
>>>> https://www.sl113.org/wiki/Engine/Start <https://www.sl113.org/wiki/Engine/Start> but it should not
>>>> Whereas this page just shows: https://www.sl113.org/wiki/Brake/Start <https://www.sl113.org/wiki/Brake/Start>
>>>> Restricted pages show a login box:
>>>> https://www.sl113.org/wiki/Restricted/Start <https://www.sl113.org/wiki/Restricted/Start> and start with Group
>>>> Restricted
>>>> The startpage of my wiki is: https://www.sl113.org/wiki/ <https://www.sl113.org/wiki/> which has a
>>>> picture and shows just fine…
>>>> What I would like to achieve is that anonymous browsers can see all of
>>>> my non-restricted content on the Wiki again…
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20200402/f4a82d24/attachment.html>


More information about the pmwiki-users mailing list