Re: [pmwiki-users] recognizing read protection
On Thu, Jun 07, 2007 at 11:55:42AM -0500, Tegan Dowling wrote: >On 6/7/07, Patrick R. Michaud <[EMAIL PROTECTED]> wrote: > > On Thu, Jun 07, 2007 at 11:38:10AM -0400, Ben Wilson wrote: > > Forgive me for not giving enough information, but I believe there's a > > Cookbook recipe that allows you to list pages with their permissions. > > Starting with 2.2.0-beta52 it's in the core, at the Site.AuthList page. > (This may change to SiteAdmin.AuthList soon, however.) > > Does the new AuthList provide a mechanism for displaying whether a page is > read-protected (or has any other attributes set) on that page? So one can > do > >(:if hasattribute read:) >Read-protected message >(:ifend:) At present there's not a way to do this, no. It is possible to specify a "passwd=?*" option to (:pagelist:) so that only those pages with passwords on them are displayed. Pm ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] recognizing read protection
Friday, June 8, 2007, 10:05:21 AM, Jabba Laci wrote: > I tried the code below, but it always displays that the page is read > protected, even if it is not. I don't know what I did wrong. >> (:if expr auth admin && pageattribute read :) >> page has read-protection >> (:if expr auth admin && ! pageattribute read:) >> page does not have read-protection >> (:ifend:) The conditional test 'pageattribute read' does not exist in pmwiki. Tegan was only asking if something like this would be what you want. A conditional for this still needs to be defined. See my last post for defining just such a conditional for if a read password is set in the page. ~Hans ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] recognizing read protection
Friday, June 8, 2007, 10:05:21 AM, Jabba Laci wrote: > Most of the pages are public, but some of them are made private. These > private pages have the following line in their source: > name= > passwdread=# here! > So what I want to catch is: if the page is read protected, i.e. if its > source contains the line "passwdread=...", then do something (display > a message for instance). You may try this custom conditional: add to config.php: # custom conditional (:if pwread:) $Conditions['pwread'] = 'IsPWRead($pagename)'; function IsPWRead($pagename) { $page = RetrieveAuthPage($pagename, 'read', false, READPAGE_CURRENT); if($page["passwdread"]) return true; else return false; } Use in wiki page: (:if pwread:)Page is read protected(:if:) ~Hans ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] recognizing read protection
Hi, I'll try to give some more details. All my pages are write protected, so I have the following lines in my config.php: $DefaultPasswords['admin'] = ... $DefaultPasswords['edit'] = ... Most of the pages are public, but some of them are made private. These private pages have the following line in their source: name= passwdread=# here! So what I want to catch is: if the page is read protected, i.e. if its source contains the line "passwdread=...", then do something (display a message for instance). I tried the code below, but it always displays that the page is read protected, even if it is not. I don't know what I did wrong. > (:if expr auth admin && pageattribute read :) > page has read-protection > (:if expr auth admin && ! pageattribute read:) > page does not have read-protection > (:ifend:) Thanks, Laszlo P.S.: I have a workaround idea. Until we find an elegant solution, I thought of writing a custom markup. I want to read the current page in wiki.d/ to test if it contains the "passwdread=..." line or not. My question: how to ask the full name (probably with path too) of the current file in an included function? That is: $readProtected = getReadProtectedInfo(); Markup('(:isReadProtected:)', '>','/\\(\\:isReadProtected\\:\\)/', "$readProtected"); function getReadProtectedInfo() { $fullname = ???; # help here ... } ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] recognizing read protection
On 6/7/07, Sandy <[EMAIL PROTECTED]> wrote: Tegan Dowling wrote: > I can't speak for Laszlo for sure -- but I know what he asked for > resembles what I want: does this page have a read-attribute set? > > Because if this page does not have a read attribute set (not on the > page's ?action=attr nor inherited from the group's > GroupAttributes?action=attr), then I want to know that at a glance, when > I'm on the page as an admin. > > Certainly, most of what I want to protect, I'll protect by placing in a > read-protected area. But sometimes I'll want to read-protect a page > within an unprotected group. OR sometimes I may unprotect > (read-attribute = nopass) a page within a read-protected group, and it > would be good for me, as an admin, to see something right on the page > that could alert me to the fact that I'm looking at / working on such a > page. > > I've lived without this, and I can continue to do so, but Laszlo has > asked if there's any kind of condition that can be inquired about from > within a page to determine it's read-protection-status. I'd use it if I > knew about it. Is there such a thing? > > Is there a variable that can be displayed in the sidebar, and surrounded by (:if:) to only show if you've admin privileges? Do you mean (:if auth admin:) ? I wasn't worrying about how to limit display of the information about whether a page has a read-protection attribute, figuring I'd deal with that once I know whether there even is a way to get the attribute-existence information on the page. But ... (:if expr auth admin && pageattribute read :) page has read-protection (:if expr auth admin && ! pageattribute read:) page does not have read-protection (:ifend:) Is that what you were getting at? ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] recognizing read protection
Tegan Dowling wrote: > I can't speak for Laszlo for sure -- but I know what he asked for > resembles what I want: does this page have a read-attribute set? > > Because if this page does not have a read attribute set (not on the > page's ?action=attr nor inherited from the group's > GroupAttributes?action=attr), then I want to know that at a glance, when > I'm on the page as an admin. > > Certainly, most of what I want to protect, I'll protect by placing in a > read-protected area. But sometimes I'll want to read-protect a page > within an unprotected group. OR sometimes I may unprotect > (read-attribute = nopass) a page within a read-protected group, and it > would be good for me, as an admin, to see something right on the page > that could alert me to the fact that I'm looking at / working on such a > page. > > I've lived without this, and I can continue to do so, but Laszlo has > asked if there's any kind of condition that can be inquired about from > within a page to determine it's read-protection-status. I'd use it if I > knew about it. Is there such a thing? > > Is there a variable that can be displayed in the sidebar, and surrounded by (:if:) to only show if you've admin privileges? Sandy ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] recognizing read protection
I can't speak for Laszlo for sure -- but I know what he asked for resembles what I want: does this page have a read-attribute set? Because if this page does not have a read attribute set (not on the page's ?action=attr nor inherited from the group's GroupAttributes?action=attr), then I want to know that at a glance, when I'm on the page as an admin. Certainly, most of what I want to protect, I'll protect by placing in a read-protected area. But sometimes I'll want to read-protect a page within an unprotected group. OR sometimes I may unprotect (read-attribute = nopass) a page within a read-protected group, and it would be good for me, as an admin, to see something right on the page that could alert me to the fact that I'm looking at / working on such a page. I've lived without this, and I can continue to do so, but Laszlo has asked if there's any kind of condition that can be inquired about from within a page to determine it's read-protection-status. I'd use it if I knew about it. Is there such a thing? ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] recognizing read protection
THere are two. AuthList in the core: http://www.pmwiki.org/wiki/Site/AuthList and the cookbook AuthTable http://www.pmwiki.org/wiki/Cookbook/AuthTable Seeing the list of everything might be more what you want. But what you asked for is I think (:if !auth read :) etc. Vince On Jun 7, 2007, at 11:38 AM, Ben Wilson wrote > Forgive me for not giving enough information, but I believe there's a > Cookbook recipe that allows you to list pages with their permissions. > > Ben Wilson > > On 6/7/07, Jabba Laci <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I use PmWiki to manage my personal homepage. Some pages that I don't >> want to share with everyone are password protected. The problem is >> that as more and more pages are created, it is more and more >> difficult >> to keep in mind which pages are protected. >> I would like to do the following. When a page is read protected, I >> want to print some warning message on the top of the page. This >> way it >> would be very easy to notice if I forgot to protect a private page. >> So my question is: how to ask whether the current page is read >> protected or not? I would imagine something like this: >> (:if isPageReadProtected:) >> (: printPageReadProtectedMessage :) >> (:endif:) >> >> Thanks, >> >> Laszlo >> >> ___ >> pmwiki-users mailing list >> pmwiki-users@pmichaud.com >> http://www.pmichaud.com/mailman/listinfo/pmwiki-users >> > > > -- > Ben Wilson > "Words are the only thing which will last forever" Churchill > > ___ > pmwiki-users mailing list > pmwiki-users@pmichaud.com > http://www.pmichaud.com/mailman/listinfo/pmwiki-users > ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] recognizing read protection
I think it's not so simple as you write. The question is "from who is the page read protected?" You can have users groups, members list etc. and assign the protection accordingly. Then the test (:if isPageReadProtected:) says nothing, as you as an admin are entitled to read all. You can use some PTV (page text variable) e.g. (:NotShared:yes:) to mark the documents (and make pagelist filtering this PTV) but it solves nothing as if you forget to set the attributes or set them incorrectly ... I thing the best way is to put the not shared documents into a special group and to protect the whole group. Then (:include ...:) or do a pagelist of this group in other groups -- the viewer not having the read permision for the special group will see nothing from that document not even will the pages will be listed in the pagelist. Hope this helps. Regards, Jiri Jabba Laci napsal(a): > Hi, > > Yes, I tried that recipe (AuthList), but it's not exactly what I want. > This recipe gives a long list, but it's very difficult to remember > which ones should be protected. So I would prefer to see this > information on the top of each page. This way it would be much easier > to recognize "hey, why is it not protected?". > > But thanks for the info. I'll check the source of AuthList too. > > Regards, > > Laszlo > >> Forgive me for not giving enough information, but I believe there's a >> Cookbook recipe that allows you to list pages with their permissions. >> >> Ben Wilson >> >> On 6/7/07, Jabba Laci <[EMAIL PROTECTED]> wrote: >>> Hi, >>> >>> I use PmWiki to manage my personal homepage. Some pages that I don't >>> want to share with everyone are password protected. The problem is >>> that as more and more pages are created, it is more and more difficult >>> to keep in mind which pages are protected. >>> I would like to do the following. When a page is read protected, I >>> want to print some warning message on the top of the page. This way it >>> would be very easy to notice if I forgot to protect a private page. >>> So my question is: how to ask whether the current page is read >>> protected or not? I would imagine something like this: >>> (:if isPageReadProtected:) >>> (: printPageReadProtectedMessage :) >>> (:endif:) > > ___ > pmwiki-users mailing list > pmwiki-users@pmichaud.com > http://www.pmichaud.com/mailman/listinfo/pmwiki-users > > __ Informacia od NOD32 2317 (20070607) __ > > Tato sprava bola preverena antivirusovym systemom NOD32. > http://www.eset.sk > > > ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] recognizing read protection
THere are two. AuthList in the core: http://www.pmwiki.org/wiki/Site/AuthList and the cookbook AuthTable http://www.pmwiki.org/wiki/Cookbook/AuthTable Vince On Jun 7, 2007, at 11:38 AM, Ben Wilson wrote > Forgive me for not giving enough information, but I believe there's a > Cookbook recipe that allows you to list pages with their permissions. > > Ben Wilson > > On 6/7/07, Jabba Laci <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I use PmWiki to manage my personal homepage. Some pages that I don't >> want to share with everyone are password protected. The problem is >> that as more and more pages are created, it is more and more >> difficult >> to keep in mind which pages are protected. >> I would like to do the following. When a page is read protected, I >> want to print some warning message on the top of the page. This >> way it >> would be very easy to notice if I forgot to protect a private page. >> So my question is: how to ask whether the current page is read >> protected or not? I would imagine something like this: >> (:if isPageReadProtected:) >> (: printPageReadProtectedMessage :) >> (:endif:) >> >> Thanks, >> >> Laszlo >> >> ___ >> pmwiki-users mailing list >> pmwiki-users@pmichaud.com >> http://www.pmichaud.com/mailman/listinfo/pmwiki-users >> > > > -- > Ben Wilson > "Words are the only thing which will last forever" Churchill > > ___ > pmwiki-users mailing list > pmwiki-users@pmichaud.com > http://www.pmichaud.com/mailman/listinfo/pmwiki-users > ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] recognizing read protection
Hi, Yes, I tried that recipe (AuthList), but it's not exactly what I want. This recipe gives a long list, but it's very difficult to remember which ones should be protected. So I would prefer to see this information on the top of each page. This way it would be much easier to recognize "hey, why is it not protected?". But thanks for the info. I'll check the source of AuthList too. Regards, Laszlo > Forgive me for not giving enough information, but I believe there's a > Cookbook recipe that allows you to list pages with their permissions. > > Ben Wilson > > On 6/7/07, Jabba Laci <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I use PmWiki to manage my personal homepage. Some pages that I don't > > want to share with everyone are password protected. The problem is > > that as more and more pages are created, it is more and more difficult > > to keep in mind which pages are protected. > > I would like to do the following. When a page is read protected, I > > want to print some warning message on the top of the page. This way it > > would be very easy to notice if I forgot to protect a private page. > > So my question is: how to ask whether the current page is read > > protected or not? I would imagine something like this: > > (:if isPageReadProtected:) > > (: printPageReadProtectedMessage :) > > (:endif:) ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] recognizing read protection
On 6/7/07, Patrick R. Michaud <[EMAIL PROTECTED]> wrote: On Thu, Jun 07, 2007 at 11:38:10AM -0400, Ben Wilson wrote: > Forgive me for not giving enough information, but I believe there's a > Cookbook recipe that allows you to list pages with their permissions. Starting with 2.2.0-beta52 it's in the core, at the Site.AuthList page. (This may change to SiteAdmin.AuthList soon, however.) Pm > On 6/7/07, Jabba Laci <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I use PmWiki to manage my personal homepage. Some pages that I don't > > want to share with everyone are password protected. The problem is > > that as more and more pages are created, it is more and more difficult > > to keep in mind which pages are protected. > > I would like to do the following. When a page is read protected, I > > want to print some warning message on the top of the page. This way it > > would be very easy to notice if I forgot to protect a private page. > > So my question is: how to ask whether the current page is read > > protected or not? I would imagine something like this: > > (:if isPageReadProtected:) > > (: printPageReadProtectedMessage :) > > (:endif:) Does the new AuthList provide a mechanism for displaying whether a page is read-protected (or has any other attributes set) on that page? So one can do (:if hasattribute read:) Read-protected message (:ifend:) ? ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] recognizing read protection
Patrick R. Michaud wrote: > On Thu, Jun 07, 2007 at 11:38:10AM -0400, Ben Wilson wrote: >> Forgive me for not giving enough information, but I believe there's a >> Cookbook recipe that allows you to list pages with their permissions. > > Starting with 2.2.0-beta52 it's in the core, at the Site.AuthList page. > (This may change to SiteAdmin.AuthList soon, however.) > > Pm > I've added a note to that effect to the documentation. One of these days I'll study (:pagelist:) properly. It's very powerful! Sandy ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] recognizing read protection
On Thu, Jun 07, 2007 at 11:38:10AM -0400, Ben Wilson wrote: > Forgive me for not giving enough information, but I believe there's a > Cookbook recipe that allows you to list pages with their permissions. Starting with 2.2.0-beta52 it's in the core, at the Site.AuthList page. (This may change to SiteAdmin.AuthList soon, however.) Pm > On 6/7/07, Jabba Laci <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I use PmWiki to manage my personal homepage. Some pages that I don't > > want to share with everyone are password protected. The problem is > > that as more and more pages are created, it is more and more difficult > > to keep in mind which pages are protected. > > I would like to do the following. When a page is read protected, I > > want to print some warning message on the top of the page. This way it > > would be very easy to notice if I forgot to protect a private page. > > So my question is: how to ask whether the current page is read > > protected or not? I would imagine something like this: > > (:if isPageReadProtected:) > > (: printPageReadProtectedMessage :) > > (:endif:) > > > > Thanks, > > > > Laszlo > > > > ___ > > pmwiki-users mailing list > > pmwiki-users@pmichaud.com > > http://www.pmichaud.com/mailman/listinfo/pmwiki-users > > > > > -- > Ben Wilson > "Words are the only thing which will last forever" Churchill > > ___ > pmwiki-users mailing list > pmwiki-users@pmichaud.com > http://www.pmichaud.com/mailman/listinfo/pmwiki-users ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] recognizing read protection
To see a summary of passwords for each page, try AuthTable http://pmwiki.org/wiki/Cookbook/AuthTable Worth looking at the second version at the bottom as well; the links go directly to the ?action=attr page. Cheers! Sandy Ben Wilson wrote: > Forgive me for not giving enough information, but I believe there's a > Cookbook recipe that allows you to list pages with their permissions. > > Ben Wilson > > On 6/7/07, Jabba Laci <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I use PmWiki to manage my personal homepage. Some pages that I don't >> want to share with everyone are password protected. The problem is >> that as more and more pages are created, it is more and more difficult >> to keep in mind which pages are protected. >> I would like to do the following. When a page is read protected, I >> want to print some warning message on the top of the page. This way it >> would be very easy to notice if I forgot to protect a private page. >> So my question is: how to ask whether the current page is read >> protected or not? I would imagine something like this: >> (:if isPageReadProtected:) >> (: printPageReadProtectedMessage :) >> (:endif:) >> >> Thanks, >> >> Laszlo >> >> ___ >> pmwiki-users mailing list >> pmwiki-users@pmichaud.com >> http://www.pmichaud.com/mailman/listinfo/pmwiki-users >> > > ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] recognizing read protection
Forgive me for not giving enough information, but I believe there's a Cookbook recipe that allows you to list pages with their permissions. Ben Wilson On 6/7/07, Jabba Laci <[EMAIL PROTECTED]> wrote: > Hi, > > I use PmWiki to manage my personal homepage. Some pages that I don't > want to share with everyone are password protected. The problem is > that as more and more pages are created, it is more and more difficult > to keep in mind which pages are protected. > I would like to do the following. When a page is read protected, I > want to print some warning message on the top of the page. This way it > would be very easy to notice if I forgot to protect a private page. > So my question is: how to ask whether the current page is read > protected or not? I would imagine something like this: > (:if isPageReadProtected:) > (: printPageReadProtectedMessage :) > (:endif:) > > Thanks, > > Laszlo > > ___ > pmwiki-users mailing list > pmwiki-users@pmichaud.com > http://www.pmichaud.com/mailman/listinfo/pmwiki-users > -- Ben Wilson "Words are the only thing which will last forever" Churchill ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users