Q: PHP auth in 2.2.0 vs. 2.2.1

Albrecht Dreß albrecht.dress at lios-tech.com
Sun Apr 12 18:28:22 CEST 2009


Hi,

sorry, this is a somewhat long and off-topic question, by someone not  
having php experiences at all...

I'm trying to write scripts as to convert the 2.2.0 Horde prefs to  
2.2.1.  I meanwhile have a simple php script, running from the command  
line, which extracts all 2.2.0 prefs into files (serialized php  
array).  Although these files look somewhat like the 2.2.1 prefs at  
first glance, a simple copy doesn't work, so I need a second script for  
re-importing the data into 2.2.1.  Unfortunately, I cannot auth to the  
system, e.g. using the following simple script

<snip>
#!/kolab/bin/php -n

<?php

@define('AUTH_HANDLER', true);
@define('HORDE_BASE', '/kolab/var/kolab/www/horde');
require_once HORDE_BASE . '/lib/core.php';
require_once HORDE_BASE . '/lib/base.php';

$auth = &Auth::singleton('kolab');
$auth->setAuth('test', array());
var_dump($auth);

?>
</snip>

works nicely on Kolab 2.2.0 (and lets me read the Horde prefs), but  
(after replacing the path /kolab/var/kolab/www/horde by  
/kolab/var/kolab/www/client) on 2.2.1 spits out the following fatal  
error:

<snip>
A fatal error has occurred

Session cookies will not work without a FQDN and with a non-empty  
cookie domain. Either use a fully qualified domain name like  
"http://www.example.com" instead of  
"http://example" only, or set the cookie domain in the Horde  
configuration to an empty value, or enable non-cookie (url-based)  
sessions in the Horde configuration.

Details have been logged for the administrator.
</snip>

Before digging through tons of code, maybe some of the gurus can give  
me an example how a command line php script can authenticate as some  
user (which write access to the prefs system, but without knowing the  
password, btw.) in Kolab 2.2.1.

Thanks in advance,
Albrecht.




More information about the users mailing list