Hello Everyone! I'm sorry! Is my mistake! I extracted headers from zope document only and I let PHP to render without headers (option -q)!! Double mistake! Download version 2.3 http://www.zope.org/Members/Ioan/PHPObject/ and tell me if is working! Yours, Ioan. --- Milos Prudek <milos.prudek@tiscali.cz> wrote:
You posted a question a couple weeks ago looking for a way for authenticated Zope users to access IMP without having to re-authenticate...I was sort of keeping an eye out for an answer to that, since I'd like to do either the same thing or the reverse (have an authenticated IMP user be able to access Zope (possibly management screens) without having to re-authenticate).
Did this PPHPDocument product allow for that sort of thing? and if so, do you have any tips or samples you could share?
I did get quite far with PHPDocument, but not far enough.
I was able to modify IMP's redirect.php to autologin. Then I made two very slight modifications to allow redirect.php to run from PHPDocument (see the source below, the lines marked as [mod for Zope]). It does not give any errors, but it also does not give any results. Just an empty page.
The reason, I believe, is because redirect.php writes raw http header and that is something that PHPDocument cannot handle.
I CC: this to PHPDocument author in case he would like to look at it.
THE SOURCE OF redirect.php:
<?php /* * $Horde: imp/redirect.php,v 1.23.2.3 2002/01/02 17:05:32 jan Exp $ * * Copyright 1999-2002 Charles J. Hagenbuch <chuck@horde.org> * Copyright 1999-2002 Jon Parise <jon@horde.org> * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. */
// [mod for Zope] /* define('IMP_BASE', dirname(__FILE__)); */ define('IMP_BASE', '/home/httpd/html/horde/imp');
require_once IMP_BASE . '/lib/base.php';
$HTTP_POST_VARS['imapuser'] = 'milos'; $HTTP_POST_VARS['pass'] = 'secretsecret'; $HTTP_POST_VARS['server'] = 'localhost'; $HTTP_POST_VARS['actionID'] = '105'; $HTTP_POST_VARS['mailbox'] = 'INBOX'; $HTTP_POST_VARS['port'] = '143'; $HTTP_POST_VARS['maildomain'] = 'example.com'; $HTTP_POST_VARS['protocol'] = 'imap'; $HTTP_POST_VARS['realm'] = 'example.com'; $HTTP_POST_VARS['folders'] = 'mail%2F'; $HTTP_POST_VARS['new_lang'] = 'cz_CZ'; $HTTP_POST_VARS['button'] = 'P%F8ihl%E1%B9en%ED+do+syst%E9mu';
$action = Horde::getFormData('action', ''); if ($action === 'compose') { $actionID = LOGIN_COMPOSE; } else { $actionID = Horde::getFormData('actionID', IMP_LOGIN); }
/* If we already have a session... */ if (isset($HTTP_SESSION_VARS['imp']) && is_array($HTTP_SESSION_VARS['imp'])) { /* Make sure that if a username was specified, it is the current username */ if ((!isset($HTTP_POST_VARS['imapuser']) || $HTTP_POST_VARS['imapuser'] == $HTTP_SESSION_VARS['imp']['user']) && (!isset($HTTP_POST_VARS['pass']) || $HTTP_POST_VARS['pass'] == Secret::read(Secret::getKey('imp'), $HTTP_SESSION_VARS['imp']['pass']))) {
if ($actionID == IMP_LOGIN) { $actionID = NO_ACTION; } header('Location: ' . Horde::applicationUrl('mailbox.php?actionID=' . $actionID, true)); exit; } else { /* Disable the old session. */ $imp = false; session_unregister('imp'); header('Location: ' . Horde::applicationUrl(IMP::logoutUrl('login.php', 'failed'), true)); exit; } }
/* Create a new session if we're given the proper parameters. */ if (isset($HTTP_POST_VARS['imapuser']) && isset($HTTP_POST_VARS['pass'])) { if (!isset($HTTP_POST_VARS['mailbox'])) { $HTTP_POST_VARS['mailbox'] = 'INBOX'; } if (($reason = IMP::createSession()) === true) { $imp['_login'] = true;
// [mod for Zope] $entry = sprintf('Login success for %s [%s] to {%s:%s}', $imp['user'], '<dtml-var REMOTE_ADDR>', $imp['server'], $imp['port']); Horde::logMessage($entry, __FILE__, __LINE__, LOG_NOTICE);
if (Horde::getFormData('redirect_url')) { header('Location: ' . Horde::getFormData('redirect_url')); exit; }
header('Location: ' . Horde::applicationUrl('mailbox.php?actionID=' . $actionID, true)); exit; } else { header('Location: ' . Horde::applicationUrl(IMP::logoutUrl('login.php', $reason), true)); exit; } }
/* No session, and no login attempt. Just go to the login page. */ $uri = 'login.php'; if (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) { $uri .= '?' . $HTTP_SERVER_VARS['QUERY_STRING']; } header('Location: ' . Horde::applicationUrl($uri, true)); exit;
?>
<dtml-var standard_html_footer>
-- Milos Prudek
__________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/