<div>Yay, solved! So for others reference, here is what I did. I combined <span style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">the last suggestion by jtankers from the </span><a href="http://www.pmwiki.org/wiki/Cookbook/SwitchToSSLMode" target="_blank" style="font-size:13px;color:rgb(17,85,204);font-family:arial,sans-serif;background-color:rgb(255,255,255)">http://www.<span class="il" style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">pmwiki</span>.org/wiki/Cookbook/SwitchToSSLMode</a><span style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)"> </span><span style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">web page and the hint from Patrick to get this (had to include all new path variables because of the way my site is set up, but this may not always be necessary):</span></div>
<div><span style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)"><br></span></div><div><span style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)"><div>
include_once("scripts/authuser.php"); </div><div> </div><div>##  Set URL to http or https, </div><div>##  Open Source 2007/09/13pm jtankers/PmWiki 2.2.0-beta63 </div><div>function ChangeUrlScheme($urlscheme) {  </div>
<div>  $url = array(); </div><div>  $query = ''; </div><div>  reset($_GET); </div><div>  while(list($name,$value) = each($_GET)) { </div><div>    if (!empty($value)) { </div><div>      $url[$name] = $name."=".urlencode($value); </div>
<div>      $query = '?'; </div><div>    } </div><div>  } </div><div>  header("Location: ".$urlscheme."://".$_SERVER['HTTP_HOST'] </div><div>         .$_SERVER['PHP_SELF'].$query.implode("&",$url)); </div>
<div>  exit; </div><div>} </div><div><br></div></span></div><div><span style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)"><div># check to see if logged in or attempting to login, if so switch to ssl </div>
<div>if (@$AuthId </div><div>    || substr_count($pagename, 'SiteAdmin') </div><div>    || substr_count($action, 'login')     </div><div>    ) { </div><div>  $ScriptUrl = '<a href="https://www.example.com/pmwiki/pmwiki.php">https://www.example.com/pmwiki/pmwiki.php</a>'; </div>
<div>  $PubDirUrl = '<a href="https://www.example.com/pmwiki/pub">https://www.example.com/pmwiki/pub</a>'; </div><div>  $UploadUrlFmt = "https:/<a href="http://www.example.com/uploads">www.example.com/uploads</a>"; </div>
<div>  $UploadDir = "pmwiki/uploads"; </div><div>  if (@$_SERVER['SERVER_PORT'] != '443') ChangeUrlScheme('https'); </div><div>    # ... other switch-to-ssl stuff here  </div><div> } else { </div>
<div>  if (@$_SERVER['SERVER_PORT'] == '443') ChangeUrlScheme('http'); </div><div> } </div></span></div><div><br></div><div>Thanks! I like the idea of everything being ssl as long as one is logged in. Seems cleaner than going back and forth depending on whether you are actually editing or not.</div>
<div><br></div><div>cheers,</div><div>maria</div><div><br></div>On Tue, Feb 26, 2013 at 6:58 AM, Patrick R. Michaud <span dir="ltr"><<a href="mailto:pmichaud@pobox.com" target="_blank">pmichaud@pobox.com</a>></span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Depending on what sort of authentication system you're using, it'd<br>
be something like:<br>
<br>
    include_once("scripts/authuser.php");<br>
    if (@$AuthId) {<br>
        $ScriptUrl = '<a href="https://www.example.com/pmwiki/pmwiki.php" target="_blank">https://www.example.com/pmwiki/pmwiki.php</a>';<br>
        $PubDirUrl = '<a href="https://www.example.com/pmwiki/pub" target="_blank">https://www.example.com/pmwiki/pub</a>';<br>
        # ... other switch-to-ssl stuff here<br>
    }<br>
<br>
Essentially, load the authentication system and let it do its<br>
thing, then check $AuthId to determine if the visitor has<br>
logged in yet.  If they have, then switch everything over to SSL.<br>
<span class="HOEnZb"><font color="#888888"><br>
Pm<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Sun, Feb 24, 2013 at 10:39:41PM -0800, Maria McKinley wrote:<br>
> Does anyone know if there is a way to detect from config.php if a user is<br>
> logged in or not? Most of the recipes in SwitchToSSLMode assume you just want<br>
> the login itself to use ssl, or at most just certain actions to use ssl. But it<br>
> seems that the way my wiki is set up, switching back and forth between ssl and<br>
> not causes the site to forget that someone is logged in. So, I'd like ssl<br>
> always on if you are logged in; so the logic in config.php would be that if the<br>
> action is login or if the user is already logged in, then pages are sent via<br>
> ssl, otherwise http.<br>
><br>
> thanks,<br>
> maria<br>
<br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> pmwiki-users mailing list<br>
> <a href="mailto:pmwiki-users@pmichaud.com">pmwiki-users@pmichaud.com</a><br>
> <a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users" target="_blank">http://www.pmichaud.com/mailman/listinfo/pmwiki-users<br clear="all"><div><br></div>-- <br>Maria Mckinley<br>Programmer and System Administrator


</a></div></div></blockquote></div>