From 7635d21b4c128e383e61b27981872200c13bf4d5 Mon Sep 17 00:00:00 2001
From: till <till@php.net>
Date: Sun, 23 Mar 2008 16:42:24 -0400
Subject: [PATCH] * fixing bug where people got: Call to undefined function decrypt_passwd()  (The form fields for smtp and imap test shared names and imap test overwrote smtp test fields (obviously).)

---
 installer/test.php |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/installer/test.php b/installer/test.php
index 2e0637f..04259dd 100644
--- a/installer/test.php
+++ b/installer/test.php
@@ -164,11 +164,11 @@
   $pass = $RCI->getprop('smtp_pass', '(none)');
   
   if ($user == '%u') {
-    $user_field = new textfield(array('name' => '_user'));
-    $user = $user_field->show($_POST['_user']);
+    $user_field = new textfield(array('name' => '_smtp_user'));
+    $user = $user_field->show($_POST['_smtp_user']);
   }
   if ($pass == '%p') {
-    $pass_field = new passwordfield(array('name' => '_pass'));
+    $pass_field = new passwordfield(array('name' => '_smtp_pass'));
     $pass = $pass_field->show();
   }
   
@@ -195,8 +195,8 @@
       preg_match('/^' . $RCI->email_pattern . '$/i', trim($_POST['_to']))) {
   
     $headers = array(
-      'From' => trim($_POST['_from']),
-      'To'  => trim($_POST['_to']),
+      'From'    => trim($_POST['_from']),
+      'To'      => trim($_POST['_to']),
       'Subject' => 'Test message from RoundCube',
     );
 
@@ -207,11 +207,13 @@
     if ($RCI->getprop('smtp_server')) {
       $CONFIG = $RCI->config;
       
-      if (!empty($_POST['_user']))
-        $CONFIG['smtp_user'] = $_POST['_user'];
-      if (!empty($_POST['_pass']))
-        $CONFIG['smtp_pass'] = $_POST['_pass'];
-      
+      if (!empty($_POST['_smtp_user'])) {
+        $CONFIG['smtp_user'] = $_POST['_smtp_user'];
+      }
+      if (!empty($_POST['_smtp_pass'])) {
+        $CONFIG['smtp_pass'] = $_POST['_smtp_pass'];
+      }
+
       $mail_object  = new rc_mail_mime();
       $send_headers = $mail_object->headers($headers);
       

--
Gitblit v1.9.1