ping returns notices and infos also to unlogged users

pull/1/head
Fabio Comuni 2011-09-28 09:30:22 +02:00
rodzic dccd2da356
commit 3ca3157e53
1 zmienionych plików z 162 dodań i 160 usunięć

Wyświetl plik

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