Piotrek Karas wrote:
> Hi there,
> 
> I use a very bit of ezcAuthentication in my CAPTCHA extension for eZ4, 
> and decided to use my own wrapper function for encryption (instead of 
> directly calling sha1 or md5). Here it hoes:
> 
> --- code:
> $credentials = new ezcAuthenticationIdCredentials( $captcha );
> $authentication = new ezcAuthentication( $credentials );
> $authentication->addFilter(
>       new ezcAuthenticationTokenFilter(
>               $encryptedToken,
>               'eZHumanCAPTCHATools::encryptToken'
>       )
> );
> ---
> 
> eZHumanCAPTCHATools::encryptToken is a public static method in the very 
> same class, where this authentication is initiated.
> 
> On one system I have it working great, on another one (almost identical 
> when it comes to system, configuration, versions) I get eZ debugger message:
> 
> --- msg:
> call_user_func(eZHumanCAPTCHATools::encryptToken) [<a 
> href='function.call-user-func'>function.call-user-func</a>]: Unable to 
> call eZHumanCAPTCHATools::encryptToken(kecxw) in 
> /usr/share/php/ezc/Authentication/filters/token/token_filter.php on line 194
> ---
> 
> What could be the reason for such difference?
> Seems like a scope problem?

Hi Piotrek,

After PHP 5.2.3 you can specify a callback function as 
'eZHumanCAPTCHATools::encryptToken', but on older versions you must use 
array( 'eZHumanCAPTCHATools', 'encryptToken' ), otherwise you get the 
warning you got.

See http://php.net/manual/en/language.pseudo-types.php and 
http://www.php.net/manual/en/function.call-user-func.php for information 
about the callback type in PHP.

Hope this helps.

Cheers,
Alex.

-- 
Alexandru Stanoi
eZ Components System Developer
eZ Systems | http://ez.no
-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to