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,7 +151,13 @@ 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))
{
if ($infos['email'])
{
$names = explode('<br>',$infos['name']);
$emails = split('@|<br>',$infos['email']);
@ -168,6 +174,24 @@ function about_display($info)
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;
}
$s .= "</td></tr>\n";

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']);
?>