summaryrefslogtreecommitdiff
path: root/manager/application/controllers/MailController.php
diff options
context:
space:
mode:
authorMarkus Warg <mw@it-sls.de>2010-04-14 16:29:09 +0200
committerMarkus Warg <mw@it-sls.de>2010-04-14 16:29:09 +0200
commit2597013887cfb5b2a9c7b0210b4deb0a0276e595 (patch)
tree53fb36b4d7d7900063a6e62c9ab160a5808d5185 /manager/application/controllers/MailController.php
parentae053ad0371d46f529a26c2a18953189620b88e4 (diff)
downloadcacert-mgr-2597013887cfb5b2a9c7b0210b4deb0a0276e595.tar.gz
cacert-mgr-2597013887cfb5b2a9c7b0210b4deb0a0276e595.tar.xz
cacert-mgr-2597013887cfb5b2a9c7b0210b4deb0a0276e595.zip
list mails, read mails
fix smaller issues in imap class mail controller list contents of mailbox read mails
Diffstat (limited to 'manager/application/controllers/MailController.php')
-rw-r--r--manager/application/controllers/MailController.php30
1 files changed, 28 insertions, 2 deletions
diff --git a/manager/application/controllers/MailController.php b/manager/application/controllers/MailController.php
index afe902b..5ee84d4 100644
--- a/manager/application/controllers/MailController.php
+++ b/manager/application/controllers/MailController.php
@@ -16,9 +16,35 @@ class MailController extends Zend_Controller_Action
public function indexAction()
{
- // action body
+ $config = Zend_Registry::get('config');
+ $imap_config = $config->imap;
+ $imap = imapConnection::getInstance('cacert', $imap_config);
+ $imap->imapSwitchMbox('INBOX');
+
+ $ck = $imap->imapCheck();
+
+ $headers = array();
+ for ($i=0; $i < $ck->Nmsgs; $i++) {
+ $header = $imap->imapHeader($i+1);
+ $header->uid = $imap->imapUID($i+1);
+ $header->detailslink = $this->view->url(array('controller' => 'mail', 'action' => 'read', 'uid' => $header->uid), 'default', true);
+ $headers[] = $header;
+ }
+
+ $this->view->headers = $headers;
}
+ public function readAction()
+ {
+ $config = Zend_Registry::get('config');
+ $imap_config = $config->imap;
+ $imap = imapConnection::getInstance('cacert', $imap_config);
+ $imap->imapSwitchMbox('INBOX');
+
+ $uid = $this->getRequest()->getParam('uid');
-}
+ $body = $imap->imapBodyByUID($uid);
+ $this->view->mail_body = $body;
+ }
+}