On 09/06/06, Ken McDonald <ken(a)pixologic.com> wrote:
Someone (Rob, I think, many thanks) advised me a while
ago that probably
the best way to bulk protect pages was to update the page_protections
column in the page table. The intent is to have a core set of pages that
anonymous or standard logged in users can read but not edit. So I'll
have a statement that looks something like this, I think:
That's one approach. The other might be to hook the
Title::userCanEdit() function and have a coded blacklist of pages
somewhere (or even keep it as a wiki page or message).
1) Does anyone know of any builtin pages in the main
namespace that
might get messed up from having their protection changed?
There are no such pages as far as I am aware.
2) More importantly, what goes into ???, or in
general, where do I find
what constitutes valid values for 'page_restrictions', and how do I
apply them. phpMyAdmin lists the type of this column as a tinyblob, I
can't read or manipulate directly in phpMyAdmin (so I can't inspect the
values currently set for pages), and which I have no idea how to
manipulate with straight SQL. Nor do I know allowed values or their
meanings for this field.
Briefly; the blob field might look something like this:
edit=sysop:move=sysop
A colon is used to delimit individual permissions settings, which are
then in the format action=group. At present, valid actions are "edit"
and "move".
Is there documentation anywhere for this? Is this even
the correct
column to do just simple page protection?
I suspect the "documentation" is in the form of comments in the Title code.
P.S. The list of namespaces on Meta gives the value of
the Main
namespace as {{ns:-0}}. Does the - sign have any significance?
No. The main namespace is 0.
Rob Church