2 require '../api/functions.php';
5 header('Location: ../login.html');
9 <?php include '../i18n.class.php'; $i18n = new i18n('../lang/lang_{LANGUAGE}.ini'); $i18n->init();?>
12 <link type='text/css' rel='stylesheet' href='../css/all.css'/>
13 <link type='text/css' rel='stylesheet' href='../css/mailbox.css'/>
16 <h1>Mail Box <?php if(isset($_GET['box'])==true){echo $_GET['box'];}?></h1>
18 if (isset($_GET['info'])){
19 echo str_replace('_',' ',$_GET['info']);
22 function scan_dir($dir) {
23 $ignored = array('.', '..', '.htaccess','mailb.php','getmail.php');
25 foreach (scandir($dir) as $file) {
26 if (in_array($file, $ignored)) continue;
27 $files[$file] = filemtime($dir . '/' . $file);
30 $files = array_keys($files);
31 return ($files) ? $files : false;
34 if (isset($_GET['box'])){
35 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){
36 $dirs=scan_dir(getcwd().'/'.preg_split('/@/',$_SESSION['m_user'])[0].'/'.$_GET['box']);
37 if (($dirs==false)==false){
38 foreach ($dirs as $i){
40 include preg_split('/@/',$_SESSION['m_user'])[0].'/mails/'.$i;
41 echo '<span class="mail"><a href="getmail.php?box='.$_GET['box'].'&id='.$i.'">'.$sender.'</a> <text>'.$date.'</text> <a href="getmail.php?delthem='.$i.'">Delete</a></span><br>
48 $dirs=scan_dir(getcwd().'/'.preg_split('/@/',$_SESSION['m_user'])[0].'/mails/');
49 if (($dirs==false)==false){
50 foreach ($dirs as $i){
52 include preg_split('/@/',$_SESSION['m_user'])[0].'/mails/'.$i;
53 echo '<span class="mail"><a href="getmail.php?id='.$i.'">'.$sender.'</a> <text>'.$date.'</text> <a href="getmail.php?delthem='.$i.'">Delete</a></span><br>
58 echo '<text>'.L::mbox_dhave.'<br></text>';
63 http_response_code(404);
67 <text><?php echo L::mbox_note;?></text>
68 <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>