XMLRPC: included support for on-browser xmlrpc authentication

About Screen: support for image and url in description
This commit is contained in:
viniciuscb 2005-06-18 20:29:17 +00:00
parent c0714ea214
commit e66d26d0c1
2 changed files with 51 additions and 11 deletions

View File

@ -151,21 +151,45 @@ function about_display($info)
{
$infos = array('email' => $info[$key.'_email'],'name' => $infos);
}
elseif(!is_array($infos) && isset($info[$key.'_url']))
{
$infos = array('url' => $info[$key.'_url'],'name' => $infos);
}
if (is_array($infos))
{
$names = explode('<br>',$infos['name']);
$emails = split('@|<br>',$infos['email']);
if (count($names) < count($emails)/2)
if ($infos['email'])
{
$names = '';
$names = explode('<br>',$infos['name']);
$emails = split('@|<br>',$infos['email']);
if (count($names) < count($emails)/2)
{
$names = '';
}
$infos = '';
while (list($user,$domain) = $emails)
{
if ($infos) $infos .= '<br>';
$name = $names ? array_shift($names) : $user;
$infos .= "<a href='mailto:$user at $domain'><span onClick=\"document.location='mailto:$user'+'@'+'$domain'; return false;\">$name</span></a>";
array_shift($emails); array_shift($emails);
}
}
$infos = '';
while (list($user,$domain) = $emails)
{
if ($infos) $infos .= '<br>';
$name = $names ? array_shift($names) : $user;
$infos .= "<a href='mailto:$user at $domain'><span onClick=\"document.location='mailto:$user'+'@'+'$domain'; return false;\">$name</span></a>";
array_shift($emails); array_shift($emails);
elseif($infos['url'])
{
$img = $info[$key.'_img'];
if ($img)
{
$img_url = $GLOBALS['phpgw']->common->image('phpgwapi',$img);
if (!$img_url)
{
$img_url = $GLOBALS['phpgw']->common->image($info['name'],$img);
}
$infos = '<table border="0"><tr><td style="text-align:center;"><a href="'.$infos['url'].'"><img src="'.$img_url.'" border="0"><br>'.$infos['name'].'</a></td></tr></table>';
}
else
{
$infos = '<a href="'.$infos['url'].'">'.$infos['name'].'</a>';
}
}
}
$s .= ($n ? '<br>' : '') . $infos;

View File

@ -12,6 +12,8 @@
/* $Id$ */
/* $Source$ */
/*list($usec, $sec) = explode(" ", microtime());
$GLOBALS['concisus']['script_start'] = ((float)$usec + (float)$sec);*/
$GLOBALS['phpgw_info'] = array();
$GLOBALS['phpgw_info']['flags'] = array(
@ -21,7 +23,11 @@
);
include('header.inc.php');
//viniciuscb: a secure way to know if we're in a xmlrpc call...
$GLOBALS['phpgw_info']['server']['xmlrpc'] = true;
$server = CreateObject('phpgwapi.xmlrpc_server');
/* uncomment here if you want to show all of the testing functions for compatibility */
//include(PHPGW_API_INC . '/xmlrpc.interop.php');
@ -42,5 +48,15 @@
}
$server->authed = $GLOBALS['phpgw']->session->verify($sessionid,$kp3);
if (!$server->authed and isset($_SERVER['PHP_AUTH_USER']) and isset($_SERVER['PHP_AUTH_PW']))
{
$authed = $GLOBALS['phpgw']->session->create($login.'@'.$domain, $_SERVER['PHP_AUTH_PW'], 'text');
if ($authed)
{
$server->authed = true;
}
}
$server->service($_SERVER['HTTP_RAW_POST_DATA']);
?>