[ewiki] Re: auth in binary (Authmania continues)

Hi Andy,

I see the usefulness, but I'm not sure if it won't overcomplicate things
if we join binary support into ewiki_page() - on the other hand, a unified
interface like ?id=internal://md5md5md5md5 could look more professional.
But I believe this currently only raises incompatibilities, because not only
binary/image files are allowed to have the _BINARY flag (eventually we need
a _DATA for "pages" that carray some serialized() arrays but aren't _SYSTEM
nor _TEXT or _DISABLED???).

> I think I'd like to approach this by adding an
> $ewiki_plugins["action_binaryok"] action and allowing the replacement for

This array looks to me, to go into $ewiki_config[...] instead.
So this was the initial workaround (right before _{DISABLEDPAGE}):

if (($data["flags"] & EWIKI_DB_F_BINARY) && 
($ewiki_config["action_binaryok"][$action])) {
   ... #-- do nothing (fallthrough)
}
#-- stop here if disabled page
elseif (!empty($data["flags"]) && ...

But if you meant a real plugin hook, then we should better call it just
$ewiki_plugins["action_binary"] or $ewiki_plugins["handler_binary"] ?
Or we could introduce just one plugin hook ["page_binary"][0], which
then itself was responsible to dispatch to the ["action"] plugins, return
output or _{DISABLEDPAGE} message.

However any call to ewiki.php?binary=... will bypass the ewiki_page(),
so for binary _auth you could eventually be more succesful, if you you code
around the ["binary"][0] hook.

mario


>
> I have to introduce the auth calls into the binary system and I'd like to
> make some administrative plugins work the same way on binary and non-binary
> pages.  To wit I'll have to revise ewiki_page to allow actions on binary
> pages.  The relevant line is:
>
> if (!empty($data["flags"]) && (($data["flags"] & EWIKI_DB_F_TYPE) !=
> EWIKI_DB_F_TEXT) && ($ewiki_ring!==0)) {
>       return($o .= ewiki_t("DISABLEDPAGE"));
>    }
>
> I think I'd like to approach this by adding an
> $ewiki_plugins["action_binaryok"] action and allowing the replacement for
> this check to pass if the action exists in this array.  Is that ok?  Should
> we do this another way?
>
>

Other related posts: