From a4a343ba44e84490fca70d0ef4d30b7eba67dbd8 Mon Sep 17 00:00:00 2001 From: Nicolas Rochelemagne Date: Thu, 29 Mar 2012 11:21:50 -0500 Subject: [PATCH 2/9] auto-load for IMAP server --- libs/Atmail/Global_Base.php | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/libs/Atmail/Global_Base.php b/libs/Atmail/Global_Base.php index 90a2f53..ec32b3f 100644 --- a/libs/Atmail/Global_Base.php +++ b/libs/Atmail/Global_Base.php @@ -323,6 +323,24 @@ class Global_Base { $page .= $this->parse($path, $var); } + // cPanel Edit + // Add the ability to auto-load the required form data for authentication against the IMAP server + if ( preg_match('//', $line, $match) ) + { + $user; + $pop3host; + $password = $_ENV['REMOTE_PASSWORD']; + list($user, $pop3host) = split('@', $_ENV['REMOTE_USER']); + if ( !$pop3host ) { + $pop3host = php_uname('n'); + } + $authline = ' + + '; + $line = str_replace('', $authline, $line); + } + // End cPanel Edit + if (preg_match_all('/(\$[0-9A-Za-z_]+(\[\'[a-zA-Z0-9_]+\'\]|->[a-zA-Z0-9_]+))/', $line, $matches)) { foreach ($matches[1] as $match) -- 1.7.5