It seems I have a bad pear configuration but can not discover why, I get 'Notice already defined'message when using this library.
On my php.ini I have:
.:/usr/share/php:/usr/share/php/libzend-framework-php
the command 'which pear' returns:
/usr/bin/pear
and the command 'pear config-get php_dir' returns:
/usr/share/php/
I do not why seems pear to be loading classes twice.
This is how I am using the code:
require_once ('Auth.php');//Pear Auth
$dns = 'mysql://'.USER.':'.Util::decodePass(PASSWORD).'@'.SERVER.'/'.DBNAME;
// All options:
// Use specific username and password columns.
// Use SHA1() to encrypt the passwords.
// Retrieve all fields.
$options = array(
'dsn' => $dns,
'table' => 'usuario',
'usernamecol' => 'login',
'passwordcol' => 'password',
'cryptType' => 'md5', //'sha1'
'db_fields' => '*'
);
// Create the Auth object:
$auth = new Auth('DB', $options, 'show_login_form');
// Start the authorization:
$auth->start();
// Confirm authorization:
if ($auth->checkAuth()) {
//Authorized
echo(javaScriptRedirect(true,$js));
} else { // Unauthorized.
echo(javaScriptRedirect(false,$js));
//no se valida la autenticacion
}