[ewiki] ["handler_binary"][0] and plugins/lib/*.*

Hi @all,

I've added a "plugins/lib/" directory to further hold extension stuff,
that implements core functionality that is to be reused by plugins, but
to exotic to go into the main script (ewiki.php). A good example for this,
was a collection of admin functions, or handy utility functions like a
(hypothetical) "ewiki_remove_plugin('action or funcname')"

Parts of 'ewikictl' eventually go into there, as could the "Tar" class,
or the "anydb_*" functions. To not break the everything-mergeable-into-
one-file-idea, plugins that need one of these utility extensions should
require_once() these /lib/ scripts conditionally, like:

  #-- load ewiki+admin.php
  if (!function_exists("ewiki_extension_func")) {
     require_once(dirname(__FILE__)."../lib/ewiki+admin.php");
  }

(The relative "../lib/" here would depend upon, where the current plugin
script used to reside.)

Also we could just state in the README which plugins have pre-dependencies
in the extension /lib/ directory.


> Re: [ewiki] Re: Bug in binary hook

The ["action_binary"][] has now gone into "plugins/lib/protmode.php". The
new ["handler_binary"][0] now is in the main scripts' ewiki_page() to
chain to there. @Andy you're now free to change this whatever you like,
and add as much _auth() calls as you like...
Eventually you could also extend it to handle even _SYSTEM and _DISABLED
entries (instead of only _BINARY) if you like to.

> Ok I got some tracking on this bug, looks like the ewiki_auth is passing on
> as an admin ring.  Should ['perm_query'] plugins pay special attention to
> $ring===0 or would it be more appropriate to have them recheck the flags?

The login/[query] plugins should normally not authenticate admin users
differently from ordinary ones - and the requested-$ring-var isn't even
available to them.

> Also, I'm still trying to break down the original code, do the comments on
> this code explain it properly?  It's the original code with ands converted
> to nested ifs.

Added a bit more comment to there, but I left the if(..||..&&..||..||..)
unchanged.


btw, happy x-mas to all!
mario

Other related posts: