On Monday 27 January 2003 18:41, J�rg Walter wrote:
> Try to make your expression less complex for a start. It should make
> debugging easier. Try "my $foo = <user:...>...</user:...>;" and use
> $foo inside the <auth:password-matches/>.

Yup, did that, and it worked.

However, the very reason why I came here is that I think mixing markup 
and logic makes the whole thing unbearably complex, so I don't like 
it... :-) 

Anyway, you're right, it is a useful starting point when you're 
debugging. 

Well, back to removing the logic, I've done another thing to simplify, 
that is, rather than taking the username from the DB, I hardcode it:
        <auth:encrypted>
          <user:get-passwd username="kjetil"/>
        </auth:encrypted> 

Then, I insert a debug statement in the taglib, to get the following 
XSP:
do { $attr_encrypted = "".q%
         %.. do {my ($attr_username); 
                 $attr_username = q%kjetil%;  
                 my @_res = do {    
                     my $dbh = Skepsis::XSP::User::db_connect;
                     my $sth = $dbh->prepare("SELECT passwd FROM contributors WHERE 
username=?");
                     $sth->execute($attr_username); 
                     my @data = $sth->fetchrow_array;
                     $sth->finish;
                   AxKit::Debug(9, "Userinfo: $attr_username  " . join('', @data));
                     @data;
                 }; eval{if (wantarray) { @_res; } else { join("",@_res); }} }.q%
          %.q%    
%.q%
    %; ;  };
 
Here, I've broken some lines and inserted some tabs to make the code 
easier to read. 

However, "Userinfo" is nowhere to be found in my logs, so the 
Debug-statement is apparently not executed, and by extension, it is 
reasonable to assume that the rest of this is not executed either. 

I haven't tried to rewrite my taglib to use TaglibHelper, but I'll 
probably try. But I tend to like SimpleTaglib now that I've (finally) 
understood that the code must be quoted. 

Is there anything to go on here? All I can say looks suspecious is a 
couple of redundant . and ; but they should be just that... :-) 

Is there a way I can manipulate the XSP code itself, BTW? 

Best,

Kjetil
-- 
Kjetil Kjernsmo
Astrophysicist/IT Consultant/Skeptic/Ski-orienteer/Orienteer/Mountaineer
[EMAIL PROTECTED]  [EMAIL PROTECTED]  [EMAIL PROTECTED]
Homepage: http://www.kjetil.kjernsmo.net/        OpenPGP KeyID: 6A6A0BBC


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

Reply via email to