summaryrefslogtreecommitdiff
path: root/src/plugins/maildir.php
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-01-07 08:21:00 -0800
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-01-07 10:20:28 -0800
commit464f4d3497617fadb9d7752868f1175849cfa6d2 (patch)
tree0771bd935b30971bf2c244b6f158ed7496b644e5 /src/plugins/maildir.php
parent3d64793a1ee45857856be1cd71c3a0a040a3e869 (diff)
Refactor to separate the framework from the app; drop message stuff, this app is just user management. Add a json view for individual usersHEADmaster
Diffstat (limited to 'src/plugins/maildir.php')
-rw-r--r--src/plugins/maildir.php58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/plugins/maildir.php b/src/plugins/maildir.php
deleted file mode 100644
index 28211b5..0000000
--- a/src/plugins/maildir.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-require_once('Getter.class.php');
-////////////////////////////////////////////////////////////////////////////////
-class Maildir implements Getter {
- private $config = array('dir'=>'');
-
- public function configList() {
- return array('dir'=>'text');
- }
-
- public function init() {}
-
- public function get() {
- $this->handle_new();
- $this->handle_cur();
- $this->handle_tmp();
- }
-
- private function handle_new() {
- // move files in new to cur
- $new = $this->config['dir'].'/new';
- $cur = $this->config['dir'].'/cur';
- $dh = opendir($new);
-
- while (($file = readdir($dh)) !== false) {
- if (substr($file,0,1)!='.' && is_file($new.'/'.$file)) {
- rename($new.'/'.$file,
- $cur.'/'.$file.':');
- }
- }
- }
- private function handle_cur() {
- $cur = $this->config['dir'].'/cur';
- $dh = opendir($cur);
-
- while (($file = readdir($dh)) !== false) {
- if (substr($file,0,1)!='.' && is_file($cur.'/'.$file)) {
-
- }
- }
- }
- private function handle_tmp() {
- // Clean up files that haven't been accessed for 36 hours
- $tmp = $this->config['dir'].'/tmp';
- $dh = opendir($cur);
-
- while (($file = readdir($dh)) !== false) {
- if (is_file($tmp.'/'.$file)) {
- $atime = fileatime($tmp.'/'.$file);
- $time = time();
- if (($time-$atime)>(36*60*60)) {
- unlink($tmp.'/'.$file);
- }
- }
- }
- }
-
-}