forked from extern/egroupware
XMLRPC: included support for on-browser xmlrpc authentication
About Screen: support for image and url in description
This commit is contained in:
parent
c0714ea214
commit
e66d26d0c1
46
about.php
46
about.php
@ -151,21 +151,45 @@ function about_display($info)
|
|||||||
{
|
{
|
||||||
$infos = array('email' => $info[$key.'_email'],'name' => $infos);
|
$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 (is_array($infos))
|
||||||
{
|
{
|
||||||
$names = explode('<br>',$infos['name']);
|
if ($infos['email'])
|
||||||
$emails = split('@|<br>',$infos['email']);
|
|
||||||
if (count($names) < count($emails)/2)
|
|
||||||
{
|
{
|
||||||
$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 = '';
|
elseif($infos['url'])
|
||||||
while (list($user,$domain) = $emails)
|
{
|
||||||
{
|
$img = $info[$key.'_img'];
|
||||||
if ($infos) $infos .= '<br>';
|
if ($img)
|
||||||
$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>";
|
$img_url = $GLOBALS['phpgw']->common->image('phpgwapi',$img);
|
||||||
array_shift($emails); array_shift($emails);
|
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 .= ($n ? '<br>' : '') . $infos;
|
||||||
|
16
xmlrpc.php
16
xmlrpc.php
@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
/* $Source$ */
|
/* $Source$ */
|
||||||
|
/*list($usec, $sec) = explode(" ", microtime());
|
||||||
|
$GLOBALS['concisus']['script_start'] = ((float)$usec + (float)$sec);*/
|
||||||
|
|
||||||
$GLOBALS['phpgw_info'] = array();
|
$GLOBALS['phpgw_info'] = array();
|
||||||
$GLOBALS['phpgw_info']['flags'] = array(
|
$GLOBALS['phpgw_info']['flags'] = array(
|
||||||
@ -21,7 +23,11 @@
|
|||||||
);
|
);
|
||||||
include('header.inc.php');
|
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');
|
$server = CreateObject('phpgwapi.xmlrpc_server');
|
||||||
|
|
||||||
/* uncomment here if you want to show all of the testing functions for compatibility */
|
/* uncomment here if you want to show all of the testing functions for compatibility */
|
||||||
//include(PHPGW_API_INC . '/xmlrpc.interop.php');
|
//include(PHPGW_API_INC . '/xmlrpc.interop.php');
|
||||||
|
|
||||||
@ -42,5 +48,15 @@
|
|||||||
}
|
}
|
||||||
$server->authed = $GLOBALS['phpgw']->session->verify($sessionid,$kp3);
|
$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']);
|
$server->service($_SERVER['HTTP_RAW_POST_DATA']);
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user