[ewiki] Re: Postgresql support, protected mode

Hey Daniel,

> The init code was not able to create the table in Postgresql.  Below is
> the how I did it manually.

Had you also figure out, what syntax Postgres complained about - I had
no problems with my database, but I'm using an older version and after
all aren't very experienced with it.
Whatever, I also received reports, the old CREATE TABLE worked with the
latest Progres versions.

I've now rearranged NOT NULL and DEFAULT statements as in your snippet, but
I left INTEGER untouched as my Postgres manual suggested, BIGINT was still
poorly supported ("8 byte INTs don't work reliable in WHERE clauses..." or
so) - and bigint is probably overkill for the ewiki table.

>  ALTER TABLE ONLY ewiki
>     ADD CONSTRAINT id PRIMARY KEY (pagename, "version");

It was ok for me to leave the PRIMARY KEY thing out of the CREATE TABLE,
but I guess this would break compatibility with poor old MySQL - what I'd
like to keep as long as possible (to eventually replace ewiki_db_mysql()
with the _anydb() one).

But why did you quote "version" - is it a reserved keyword in your version?


> In the most recent update, define("EWIKI_PROTECTED_MODE", 1) seems to
> forbid even viewing a page to everyone, without regard to $ewiki_ring. 
> Even when adding $ewiki_ring = 0, the page is forbidden.

I've reasearched this, and in fact the ewiki_auth() function did not work
anymore without an ["auth_perm"] plugin being active.
The bug lies in around line 2800 (CVS version), the line  "  $ok = "
misses a "!isset($ring) || " as first expression.

But to use _PROTECTED_MODE without plugin, you further need to set this
constant to 2 - else "edit/" won't be protected.

Thanks for note, it's fixed now in CVS.

mario

Other related posts: