[ewiki] How-To binary hook?

> You initially told me to use that ["binary_action"] hook for specialized
> plugins - and I think it would therefore be easy to move your relaxed
> ewiki_auth() call into one of these instead. Ordinary page plugins are not
> to be registered here, you'll need a wrapper for this.

Actually my original request was for "an $ewiki_plugins["action_binaryok"]"
hook for "some administrative plugins [that] work the same way on binary and
non-binary pages."--though I see how that could be complicated to code in.

> Finally, I rethought about the _TEXT and _BINARY thingi, and came to the
> conclusion, that it could be (for some extensions) desireable to let
> {flags}==_TEXT|_BINARY pages pass (but that being the only exception).
> - But this gets first a concern, when the first serialized()-{content}
> plugin arrives.

I think this kind of combination is the way to move forward, perhaps we
could schedule this for a future version?  Maybe the 1.1 series can have
integrated binary capable plugins and the rearranged plugin directory we
were discussing in another thread?

Andy

> > I only got a few minute; to work on this today so I re-wrote the flags
> > check, could you tell me if this code correctly handles
> EWIKI_DB_F_DISABLED
> > and EWIKI_DB_F_SYSTEM?  When I have longer to work on it I'll look
> somewhat
> > closer at what is really going on here, perhaps consolidate all the
> > ewiki_auth calls in ewiki_page.
> >
> >     #-- stop here if disabled page
> >     if (   !empty($data["flags"])) {
> >         switch($data["flags"] & EWIKI_DB_F_TYPE){
> >             case EWIKI_DB_F_DISABLED:
> >             case EWIKI_DB_F_SYSTEM:
> >                 if(!EWIKI_PROTECTED_MODE || !ewiki_auth($id, $data,
> $action,
> > 0, 1) ){
> >                     return(ewiki_t("DISABLEDPAGE"));
> >                 }
> >                 break;
> >             case EWIKI_DB_F_BINARY:
> >                 if ($pf = $ewiki_plugins["action_binary"][$action]){
> >                     if(EWIKI_PROTECTED_MODE && ewiki_auth($id, $data,
> > $action, false, 1) ){
> >                         return($pf($id, $data, $action));
> >
> >                     }else{
> >                         return($ewiki_errmsg);
> >                     }
> >                 }else{
> >                     return(ewiki_t("DISABLEDPAGE"));
> >                 }
> >         }
> >     }
> >
> > Andy
> >
> > > > Just an early report that I'm seeing a bug in the new binary hook, I
> > > added
> > > > $ewiki_plugins["action_binary"]["info"] = "ewiki_page_info"; to my
> > > config
> > > > file and now all actions are allowed to run on the page.  I have to
> > > leave
> > >
> > > Haven't seen this happen. Have you forgotten to logout (if you were
> admin
> > > during page flag setting).
> 
> 
> 
> _________________________________________________
> Scanned on 19 Dec 2003 16:40:30
> Scanning by http://erado.com

Other related posts: