ping returns notices and infos also to unlogged users

This commit is contained in:
Fabio Comuni 2011-09-28 09:30:22 +02:00
parent dccd2da356
commit 3ca3157e53

View file

@ -4,8 +4,11 @@ require_once("include/datetime.php");
function ping_init(&$a) {
if(! local_user())
xml_status(0);
header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<result>";
if(local_user()){
$comments = array();
@ -115,10 +118,8 @@ function ping_init(&$a) {
);
}
header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<result>
<intro>$intro</intro>
echo "<intro>$intro</intro>
<mail>$mail</mail>
<net>$network</net>
<home>$home</home>";
@ -166,20 +167,21 @@ function ping_init(&$a) {
echo " </notif>";
}
echo " <sysmsgs>";
if(x($_SESSION,'sysmsg')){
foreach ($_SESSION['sysmsg'] as $m){
echo "<notice>".($m)."</notice>";
}
$_SESSION['sysmsg']=array();
//$_SESSION['sysmsg']=array();
unset($_SESSION['sysmsg']);
}
if(x($_SESSION,'sysmsg_info')){
foreach ($_SESSION['sysmsg_info'] as $m){
echo "<info>".($m)."</info>";
}
$_SESSION['sysmsg_info']=array();
//$_SESSION['sysmsg_info']=array();
unset($_SESSION['sysmsg_info']);
}