[horde] Current logged in user

Peter Øgaard Meyland peter at meyland.dk
Fri Jul 23 20:52:17 UTC 2010


Citat af Michael Rubinsky <mrubinsk at horde.org>:

>
> Quoting Peter Øgaard Meyland <peter at meyland.dk>:
>
>> Citat af Michael Rubinsky <mrubinsk at horde.org>:
>>
>>>
>>>
>>> On Jul 23, 2010, at 8:54 AM, Peter Øgaard Meyland <peter at meyland.dk> wrote:
>>>
>>>> Hi list
>>>>
>>>> I'm working on my own intranet with user specific settings, i.e.  
>>>> a book database and movie database. The intranet is displayed in  
>>>> a Horde Block on the main portal screen. I need to get the  
>>>> current logged in Horde user, so I can display the right intranet  
>>>> page for the user. I have the latest Horde Webmail Edition and  
>>>> I'm working with PHP as my server side language.
>>>>
>>>> Can anyone show me the PHP code to get current logged in user?
>>>
>>>
>>> Auth::getAuth();
>>>
>>>>
>>>> TIA
>>>> Peter
>>>> --
>>>> Horde mailing list - Join the hunt: http://horde.org/bounties/#horde
>>>> Frequently Asked Questions: http://horde.org/faq/
>>>> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
>>> --
>>> Horde mailing list - Join the hunt: http://horde.org/bounties/#horde
>>> Frequently Asked Questions: http://horde.org/faq/
>>> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
>>>
>>
>> Could you please give me a code example? I've tried Auth::getAuth()  
>> but it gave me nothing:
>>
>> define('HORDE_BASE',  '/var/www/html/horde');
>> require_once(HORDE_BASE . "/lib/core.php");
>> $current  = Auth::getAuth();
>> echo "Horde says this user is on: <span style='color: blue;'>" .  
>> $current . "</span><br>";
>
>
> You need to bring in base.php, not core.php.
> -- 
> Mike
>
> --
> The Horde Project (www.horde.org)
> mrubinsk at horde.org
>
> "Reality is merely an illusion, albeit a very persistent one." - A. Einstein
>
> -- 
> Horde mailing list - Join the hunt: http://horde.org/bounties/#horde
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
>
>

Thanks a lot, but it did not work well.

My Horde are installed in /var/www/html/horde and my intranet are  
installed in /var/www/html/intra and every time I go to getauth.php in  
the intranet folder I get a 404 error but if I copy getauth.php into  
the Horde root folder (/var/www/html/horde) it works, strange... In my  
Apache error_log I get this error:
[Fri Jul 23 22:44:43 2010] [error] [client xxx.xxx.xxx.xxx] script  
'/var/www/html/intra/horde.php' not found or unable to stat, referer:  
http://htpc.privat.home/horde/login.php

getauth.oho looks like this:
<?php
define('HORDE_BASE',  '/var/www/html/horde');
require_once(HORDE_BASE . "/lib/base.php");
$current  = (Auth::getAuth());
echo "Horde says this user is on: <span style='color: blue;'>" .  
$current . "</span><br>";
?>

/Peter



More information about the horde mailing list