[dev] getting a user's prefs without loggin the user

Jon Parise jon@horde.org
Tue, 10 Jul 2001 17:17:43 -0400


On Tue, Jul 10, 2001 at 01:49:13PM -0400, Chuck Hagenbuch wrote:

> > So is it possible to call $prefs->getValue("something") without logging
> > in as that user?
> 
> You can put whatever username you like in the Prefs::factory() call.

Right.  Atif's example could look like this:

<?
define('HOMEPAGE_BASE', dirname(__FILE__));
require HOMEPAGE_BASE . '/../config/horde.php';
require HOMEPAGE_BASE . '/../lib/Horde.php';
require HOMEPAGE_BASE . '/../lib/Prefs.php';

$_server_name=preg_replace("/www\./", "", $SERVER_NAME);
$_user_name=str_replace('.', "_", $_server_name);

$prefs = Prefs::factory($conf['prefs']['driver'] , "" ,
                        $_user_name, "", $conf['prefs']['params']); 
?>

-- 
Jon Parise (jon@csh.rit.edu)  .  Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/  :  Computer Science House Member