[horde] how to by pass login page of imp

Patrick DUBAU patrick.dubau at alsace.iufm.fr
Mon Dec 17 10:26:32 UTC 2007


Torsten Homberger a écrit :
> Patrick DUBAU wrote:
>   
>> we want our users to launch horde/imp through  our portal (only one identification
>> needed), so i want to by pass the login page from imp. 
>> Is there any solution ?
>>     
>
> Try these lines of code:
>
> --------8<---------8<----------
> <?php
> @define('AUTH_HANDLER', true);
> @define('HORDE_BASE', '/path/to/your/horde');
> require_once HORDE_BASE . '/lib/base.php';
> require_once HORDE_BASE . '/imp/lib/api.php';
>
> function countUnseenMails() {
>         require_once IMP_BASE . '/lib/Mailbox.php';
>         $GLOBALS['horde_api']['stream'] =_imp_getStream();
>         $imp_mailbox = &IMP_Mailbox::singleton();
>         $unseenMessages = $imp_mailbox->unseenMessages();
>         return count($unseenMessages);
> }
>
> function sso($user, $pass, $server='localhost') {
>         return _imp_authenticate($user, array('password' => $pass),
> array('server' => $server));
> }
> --------8<---------8<----------
>
>
> Now you should be able to authenticate with
> sso($user, $pass);
>
> The function countUnseenMails() should return the amount of unseen mails.
>
> Good luck,
> Torsten Homberger
>
>   
Hi Torsten,

thank you for your replay, but i don't understand everything

- does i have to create a file like toto.php with the code above in 
/usr/share/horde3/imp and then call it with 
http://x.x.x.x/horde3/imp/toto.php?user=firstname.name&pass=password ?
thar's what i did but i get only a blank page

I missed something, can you please help me further more ?
Thx




More information about the horde mailing list