From 9f108dd1a969473375341d92a7b1252fa2cedc9a Mon Sep 17 00:00:00 2001 From: mszulecki Date: Thu, 14 Jun 2007 17:09:01 +0000 Subject: Initial import. git-svn-id: http://svn.sukimashita.com/repos/mailadmin/trunk@2 4281df72-ff29-0410-8fee-2d9ac0c5f5a7 --- apps/admin/lib/imap/IMAPManager.php | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 apps/admin/lib/imap/IMAPManager.php (limited to 'apps/admin/lib/imap/IMAPManager.php') diff --git a/apps/admin/lib/imap/IMAPManager.php b/apps/admin/lib/imap/IMAPManager.php new file mode 100644 index 0000000..0cac78a --- /dev/null +++ b/apps/admin/lib/imap/IMAPManager.php @@ -0,0 +1,48 @@ +openConnection( + $imap_settings['host'].":". + $imap_settings['port'] + ); + + $success = self::$adminclient->login( + $imap_settings['admin'], + $imap_settings['pass'] + ); + + if(!$success) + throw new Exception("Failed to authenticate on IMAP server."); + + } catch (Exception $e) { + LogEntryPeer::log($e->getMessage(), LogEntry::PRIO_ALERT); + } + + return self::$adminclient; + } + + public static function getAdminUsername() + { + $server_settings = sfConfig::get('app_server_default'); + $imap_settings = $server_settings['imap']; + return $imap_settings['admin']; + } +} + +?> -- cgit v1.1-32-gdbae