> -----Original Message----- > From: Mario Salzer [mailto:mario@xxxxxxxxxxxxx] > Sent: Thursday, March 04, 2004 9:50 AM > To: ewiki@xxxxxxxxxxxxx > Subject: [ewiki] Re: auth plugins: new page access (was Re: Re: > auth_perm_unix: new pages access) > > > > > [...] > > creating and maintaining these plugins. Currently my plugins regard a > > page as new if: > > > > * the ["id"] is present in $data > > * the ["content"] is not > > * it is not a page plugin > > I'd recommend just checking for $data["version"] now, because it was > always 0 (or NULL more exactly) for not-existent pages as version > counting starts at one. Ah, but I still need to check for the presence of ["id"] to find out if the $data array was populated and passed or just passed empty. If I checked only for version I could never accomplish PROTECTED_MODE_HIDING. > > If the other plugins are having similar problems maybe it is time to add > > a "create" action(probably "binary-create" too) that would check for the > > existance of the page in the ewiki_page() function just as the AUTO_EDIT > > check does presently and sets the action to "create." This would also > > This would only add complexity IMHO. If there was a "create" action, > a few things (only eventually) would be become more explicit, but on > the other handm, plugins needed to check for both "create" and "edit". > And especially the edit/ plugin needed to register twice, for little > or no benefit. I don't think that many plugins look at the action to see if it is edit, which did you have in mind? I grepped through all the ones I use and found only that I'd need to add a new action in auth_ plugins--which I do frequently anyway. > However if this was really that important, we could add a plugin hook > from within edit/, which signalised page creation to a few plugins(?) This does not work nearly as well, one of the significant benefits is to have the auth main auth call authenticate for creation. > > allow plugins to change behavior as in an aedit_ plugin to display pages > > that the user may want to edit rather than creating a new page. What do > > you think Milky? > > I've recently had the idea of a PageTemplateList plugin (aedit), where > it doesn't look like much overhead of not having a special "create" > action. - The check for {version} currently seems to do the trick. That's a great plugin that I probably will use, but the plugin I was considering was a search-based plugin to prevent people from creating new pages that duplicate existing pages. Andy