[horde] Current logged in user
Michael Rubinsky
mrubinsk at horde.org
Fri Jul 23 15:51:24 UTC 2010
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
More information about the horde
mailing list