[pmwiki-users] SwitchToSSLMode

Patrick R. Michaud pmichaud at pobox.com
Tue Feb 26 08:58:07 CST 2013


Depending on what sort of authentication system you're using, it'd
be something like:

    include_once("scripts/authuser.php");
    if (@$AuthId) {
        $ScriptUrl = 'https://www.example.com/pmwiki/pmwiki.php';
        $PubDirUrl = 'https://www.example.com/pmwiki/pub';
        # ... other switch-to-ssl stuff here
    }

Essentially, load the authentication system and let it do its
thing, then check $AuthId to determine if the visitor has
logged in yet.  If they have, then switch everything over to SSL.

Pm


On Sun, Feb 24, 2013 at 10:39:41PM -0800, Maria McKinley wrote:
> Does anyone know if there is a way to detect from config.php if a user is
> logged in or not? Most of the recipes in SwitchToSSLMode assume you just want
> the login itself to use ssl, or at most just certain actions to use ssl. But it
> seems that the way my wiki is set up, switching back and forth between ssl and
> not causes the site to forget that someone is logged in. So, I'd like ssl
> always on if you are logged in; so the logic in config.php would be that if the
> action is login or if the user is already logged in, then pages are sent via
> ssl, otherwise http.
> 
> thanks,
> maria

> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users




More information about the pmwiki-users mailing list