From: "Kjetil Kjernsmo" <[EMAIL PROTECTED]>

> I'm working on modifying Axkit::XSP::Auth, I think it would be neat to
> true and false child elements of those tags that return a boolean
> value, so that <xsp:logic> would in many cases be unnecessary.
>
> But I'm not really getting very far...
>
> I've grabbed an something from one of the examples;
> <auth:password-matches encrypted="$1$jsdxRBEt$IzCeNthea4KqzkzNB7sT4/"
> clear="ficken"/>
> ....and with the unmodified sub, it all works fine. But once I start
> adding the smallest thing, it crashes. Now, I've reduced my sub to
> this:
>
> sub password_matches : attribOrChild(clear,encrypted) expr
> {
>     warn "ATTRs: " . $attr_clear;
> return << 'EOF';
> ($attr_clear && $attr_encrypted && crypt($attr_clear,$attr_encrypted) eq
> $attr_encrypted?1:0);
> EOF
> }
>
> i.e., I'm just adding a small warning that prints the value of the clear
> attribute.

The $attr_clear variable doesn't exist where you expect it to. It's
automagically generated in the XSP code that gets built (whereas you're
trying to use it in the XSP taglib module itself). The only way to see it
with warn would be:

sub password_matches : attribOrChild(clear,encrypted) expr
{
return << 'EOF';
warn "ATTRs: " . $attr_clear;
($attr_clear && $attr_encrypted && crypt($attr_clear,$attr_encrypted) eq
$attr_encrypted?1:0);
EOF
}

i.e. the warn() goes in the generated code, not in the module.

Matt.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to