[pmwiki-users] Script to make a page private (instead of public)

Peter Bowers pbowers at pobox.com
Thu Aug 21 00:27:11 CDT 2008


On Wed, Aug 20, 2008 at 11:32 PM, Karl Schilke <schilkek at onid.orst.edu> wrote:
> Changing the test in CheckPassword() to 'if (!strstr($rpw, 'id:*'))
> ...' makes it come up checked every time. I gather that either the
> script is not correctly loading the read password, or there's
> something wrong with the string search in CheckPassword().
...
>     // If password contains "id:*", make private box checked
>     if (strstr($rpw, 'id:*')) {
>         SDV($InputTags['e_private']['checked'], 'checked');
>     }

Maybe somebody else will see an obvious problem.  For now I would
suggest sprinkling some "echo" statements around before and after that
statement, as I've done below, and then just see if things are
happening as you expect.  Usually a few debug tracing statements like
this shed a lot of light on an otherwise confusing situation...

     echo "Checking for 'id:*' in '$rpw'<br>\n";
     if (strstr($rpw, 'id:*')) {
         echo "Yep, found 'id:*'.  Before SDV
e_private=".$InputTags['e_provate']['checked']."<br>\n";
         SDV($InputTags['e_private']['checked'], 'checked');
         echo "After SDV
e_private=".$InputTags['e_provate']['checked']."<br>\n";
     } else echo "Nope, no 'id:*'<br>\n";

-Peter



More information about the pmwiki-users mailing list