2 ini_set('display_errors',1);
3 ini_set('display_initial_errors',1);
4 error_reporting(E_ALL);
5 require '../api/functions.php';
8 header('Location: ../login.php');
12 <?php include '../i18n.class.php'; $i18n = new i18n('../lang/lang_{LANGUAGE}.ini'); $i18n->init();?>
15 <link type='text/css' rel='stylesheet' href='../css/all.css'/>
16 <link type='text/css' rel='stylesheet' href='../css/mailbox.css?v=1'/>
19 <h1><?php if (isset($_GET['channel'])){?>Mail Box - Special<?php } else{ ?>Mail Box<?php } ?> <?php if(isset($_GET['box'])==true){echo $_GET['box'];}?></h1>
21 if (isset($_GET['info'])){
22 echo str_replace('_',' ',$_GET['info']);
25 function scan_dir($dir) {
26 $ignored = array('.', '..', '.htaccess','mailb.php','getmail.php');
28 foreach (scandir($dir) as $file) {
29 if (in_array($file, $ignored)) continue;
30 $files[$file] = filemtime($dir . '/' . $file);
33 $files = array_keys($files);
34 return ($files) ? $files : false;
37 if (isset($_GET['channel'])){
38 if (is_dir($_GET['channel']) and strpos($_GET['channel'],'/')==false and strpos($_GET['channel'],'..')==false or strpos($_GET['channel'],'\\')==false){
39 $dirs=scan_dir(getcwd().'/'.$_GET['channel'].'/mails/');
40 if (($dirs==false)==false){
41 foreach ($dirs as $files){
42 include getcwd().'/'.$_GET['channel'].'/mails/'.$files;
43 echo '<span class="mail"><a href="'.$_GET['channel'].'/mails/'.$files.'">'.substr($content,0,20).'...</a> <text>'.str_replace('-','/',$date).'</text> </span><br>
49 elseif (isset($_GET['box'])){
50 if (is_dir(preg_split('/@/',$_SESSION['m_user'])[0].'/'.$_GET['box']) and strpos($_GET['box'],'/')==false and strpos($_GET['box'],'..')==false or strpos($_GET['box'],'\\')==false){
51 $dirs=scan_dir(getcwd().'/'.preg_split('/@/',$_SESSION['m_user'])[0].'/'.$_GET['box']);
52 if (($dirs==false)==false){
53 foreach ($dirs as $i){
55 include preg_split('/@/',$_SESSION['m_user'])[0].'/mails/'.$i;
56 echo '<span class="mail"><a href="getmail.php?box='.$_GET['box'].'&id='.$i.'">'.$sender.'</a> <text>'.str_replace('-','/',$date).'</text> <a href="getmail.php?delthem='.$i.'">Delete</a></span><br>
63 $dirs=scan_dir(getcwd().'/'.preg_split('/@/',$_SESSION['m_user'])[0].'/mails/');
64 if (($dirs==false)==false){
65 foreach ($dirs as $i){
67 include preg_split('/@/',$_SESSION['m_user'])[0].'/mails/'.$i;
68 echo '<span class="mail"><a href="getmail.php?id='.$i.'">'.$sender.'</a> <div class="go"><text>'.str_replace('-','/',$date).'</text> <a href="getmail.php?delthem='.$i.'">Delete</a></div></span><br>
73 echo '<text>'.L::mbox_dhave.'<br></text>';
78 http_response_code(404);
82 <text><?php echo L::mbox_note;?></text>
83 <br><a href='../send_m.php'><?php echo L::mbox_send;?></a><text> <?php echo L::mbox_or;?> </text><a href='../ch_p.php'><?php echo L::mbox_change;?></a>