[Vtigercrm-commits] [vtiger-commits] r10849 - in /vtigercrm/branches/5.0.3: Smarty/templates/Settings/ include/js/ modules/Emails/ modules/Settings/ modules/Settings/language/
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu May 10 19:24:49 EDT 2007
Author: richie
Date: Thu May 10 17:24:32 2007
New Revision: 10849
Log:
* Fixed the issues in mail server config, proxy server config, Fixed #3769#3771#3773
Modified:
vtigercrm/branches/5.0.3/Smarty/templates/Settings/EmailConfig.tpl
vtigercrm/branches/5.0.3/Smarty/templates/Settings/ProxyServer.tpl
vtigercrm/branches/5.0.3/include/js/en_us.lang.js
vtigercrm/branches/5.0.3/modules/Emails/Save.php
vtigercrm/branches/5.0.3/modules/Emails/mail.php
vtigercrm/branches/5.0.3/modules/Settings/EmailConfig.php
vtigercrm/branches/5.0.3/modules/Settings/ProxyServerConfig.php
vtigercrm/branches/5.0.3/modules/Settings/Save.php
vtigercrm/branches/5.0.3/modules/Settings/language/en_us.lang.php
Modified: vtigercrm/branches/5.0.3/Smarty/templates/Settings/EmailConfig.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/Settings/EmailConfig.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/Settings/EmailConfig.tpl Thu May 10 17:24:32 2007
@@ -51,7 +51,7 @@
<table border=0 cellspacing=0 cellpadding=5 width=100% class="tableHeading">
<tr>
- <td class="big"><strong>{$MOD.LBL_MAIL_SERVER_SMTP}</strong> <br>{$ERROR_MSG}</td>
+ <td class="big"><strong>{$MOD.LBL_MAIL_SERVER_SMTP}</strong></td>
{if $EMAILCONFIG_MODE neq 'edit'}
<td class="small" align=right>
<input class="crmButton small edit" title="{$APP.LBL_EDIT_BUTTON_TITLE}" accessKey="{$APP.LBL_EDIT_BUTTON_KEY}" onclick="this.form.action.value='EmailConfig';this.form.emailconfig_mode.value='edit'" type="submit" name="Edit" value="{$APP.LBL_EDIT_BUTTON_LABEL}">
@@ -63,6 +63,11 @@
</td>
{/if}
</tr>
+ {if $ERROR_MSG neq ''}
+ <tr>
+ {$ERROR_MSG}
+ </tr>
+ {/if}
</table>
{if $EMAILCONFIG_MODE neq 'edit'}
Modified: vtigercrm/branches/5.0.3/Smarty/templates/Settings/ProxyServer.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/Settings/ProxyServer.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/Settings/ProxyServer.tpl Thu May 10 17:24:32 2007
@@ -157,9 +157,13 @@
<script>
function validate() {
if (!emptyCheck("server","Proxy Server Name","text")) return false
- if (!emptyCheck("port","Port Number","text")) return false
- if (!emptyCheck("server_username","Proxy User Name","text")) return false
- if (!emptyCheck("server_password","Proxy Password","text")) return false
+ if (!emptyCheck("port","Port Number","text")) return false
+ if(isNaN(document.tandc.port.value)){
+ alert(alert_arr.LBL_ENTER_VALID_PORT);
+ return false;
+ }
+ if (!emptyCheck("server_username","Proxy User Name","text")) return false
+ if (!emptyCheck("server_password","Proxy Password","text")) return false
return true;
}
Modified: vtigercrm/branches/5.0.3/include/js/en_us.lang.js
==============================================================================
--- vtigercrm/branches/5.0.3/include/js/en_us.lang.js (original)
+++ vtigercrm/branches/5.0.3/include/js/en_us.lang.js Thu May 10 17:24:32 2007
@@ -121,6 +121,7 @@
START_TIME : 'Start Time',
DATE_SHOULDNOT_PAST :'Current date & time for Activities with status as Planned',
TIME_SHOULDNOT_PAST :'Current Time for Activities with status as Planned',
- LBL_AND : 'And'
+ LBL_AND : 'And',
+ LBL_ENTER_VALID_PORT: 'Please enter valid port number'
};
Modified: vtigercrm/branches/5.0.3/modules/Emails/Save.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Emails/Save.php (original)
+++ vtigercrm/branches/5.0.3/modules/Emails/Save.php Thu May 10 17:24:32 2007
@@ -249,7 +249,7 @@
$local_log->debug("Saved record with id of ".$return_id);
$str = $_REQUEST['parent_id'];
-if($_REQUEST['parent_id'] == '' || substr($str,strlen($str)-4) == '@-1|'){
+if(isset($_REQUEST['send_mail']) && $_REQUEST['send_mail'] && $_REQUEST['parent_id'] == '' || substr($str,strlen($str)-4) == '@-1|'){
if($_REQUEST["parent_name"] != '' && isset($_REQUEST["parent_name"])) {
include("modules/Emails/webmailsend.php");
}
Modified: vtigercrm/branches/5.0.3/modules/Emails/mail.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Emails/mail.php (original)
+++ vtigercrm/branches/5.0.3/modules/Emails/mail.php Thu May 10 17:24:32 2007
@@ -197,9 +197,18 @@
$adb->println("Inside the function setMailServerProperties");
$res = $adb->query("select * from vtiger_systems where server_type='email'");
- $server = $adb->query_result($res,0,'server');
- $username = $adb->query_result($res,0,'server_username');
- $password = $adb->query_result($res,0,'server_password');
+ if(isset($_REQUEST['server']))
+ $server = $_REQUEST['server'];
+ else
+ $server = $adb->query_result($res,0,'server');
+ if(isset($_REQUEST['server_username']))
+ $username = $_REQUEST['server_username'];
+ else
+ $username = $adb->query_result($res,0,'server_username');
+ if(isset($_REQUEST['server_password']))
+ $password = $_REQUEST['server_password'];
+ else
+ $password = $adb->query_result($res,0,'server_password');
$smtp_auth = $adb->query_result($res,0,'smtp_auth');
$adb->println("Mail server name,username & password => '".$server."','".$username."','".$password."'");
Modified: vtigercrm/branches/5.0.3/modules/Settings/EmailConfig.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Settings/EmailConfig.php (original)
+++ vtigercrm/branches/5.0.3/modules/Settings/EmailConfig.php Thu May 10 17:24:32 2007
@@ -20,9 +20,9 @@
require_once("modules/Emails/mail.php");
$error_msg = strip_tags(parseEmailErrorString($_REQUEST['mail_error']));
//if(strstr($error_msg,"Please check the assigned to user email id"))
- if(strstr($error_msg,$mod_strings['LBL_CHECK_ASSIGNEDTO_MAILID']))
- $error_msg = $mod_strings['LBL.MAILSENDERROR'];
- $smarty->assign("ERROR_MSG",$mod_strings['LBL_TESTMAILSTATUS'].' <b><font color=red> '.$error_msg.'</font></b>');
+ //if(strstr($error_msg,$mod_strings['LBL_CHECK_ASSIGNEDTO_MAILID']))
+ $error_msg = $mod_strings['LBL_MAILSENDERROR'];
+ $smarty->assign("ERROR_MSG",$mod_strings['LBL_TESTMAILSTATUS'].' <b><font color=red>'.$error_msg.'</font></b>');
}
global $adb;
@@ -37,14 +37,24 @@
$mail_server_username = $adb->query_result($result,0,'server_username');
$mail_server_password = $adb->query_result($result,0,'server_password');
$smtp_auth = $adb->query_result($result,0,'smtp_auth');
-
-if (isset($mail_server))
+if(isset($_REQUEST['server_name']))
+ $smarty->assign("MAILSERVER",$_REQUEST['server_name']);
+elseif(isset($mail_server))
$smarty->assign("MAILSERVER",$mail_server);
-if (isset($mail_server_username))
+if(isset($_REQUEST['server_user']))
+ $smarty->assign("USERNAME",$_REQUEST['server_user']);
+elseif(isset($mail_server_username))
$smarty->assign("USERNAME",$mail_server_username);
if (isset($mail_server_password))
$smarty->assign("PASSWORD",$mail_server_password);
-if (isset($smtp_auth))
+if(isset($_REQUEST['auth_check']))
+{
+ if($_REQUEST['auth_check'] == 'on')
+ $smarty->assign("SMTP_AUTH",'checked');
+ else
+ $smarty->assign("SMTP_AUTH",'');
+}
+elseif (isset($smtp_auth))
{
if($smtp_auth == 'true')
$smarty->assign("SMTP_AUTH",'checked');
Modified: vtigercrm/branches/5.0.3/modules/Settings/ProxyServerConfig.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Settings/ProxyServerConfig.php (original)
+++ vtigercrm/branches/5.0.3/modules/Settings/ProxyServerConfig.php Thu May 10 17:24:32 2007
@@ -21,7 +21,10 @@
$smarty = new vtigerCRM_Smarty;
if($_REQUEST['error'] != '')
{
+ if($_REQUEST["error"] == 'LBL_PROXY_AUTHENTICATION_REQUIRED')
$smarty->assign("ERROR_MSG",'<b><font color="red">'.$mod_strings[$_REQUEST["error"]].'</font></b>');
+ else
+ $smarty->assign("ERROR_MSG",'<b><font color="red">'.$_REQUEST["error"].'</font></b>');
}
$sql="select * from vtiger_systems where server_type = 'proxy'";
$result = $adb->query($sql);
@@ -34,13 +37,18 @@
$smarty->assign("PROXY_SERVER_MODE",$_REQUEST['proxy_server_mode']);
else
$smarty->assign("PROXY_SERVER_MODE",'view');
-
-if (isset($server))
+if(isset($_REQUEST['server']))
+ $smarty->assign("PROXYSERVER",$_REQUEST['server']);
+elseif (isset($server))
$smarty->assign("PROXYSERVER",$server);
-if (isset($server_port))
+if (isset($_REQUEST['port']))
+ $smarty->assign("PROXYPORT",$_REQUEST['port']);
+elseif (isset($server_port))
$smarty->assign("PROXYPORT",$server_port);
-if (isset($server_username))
- $smarty->assign("PROXYUSER",$server_username);
+if (isset($_REQUEST['server_user']))
+ $smarty->assign("PROXYUSER",$_REQUEST['server_user']);
+elseif (isset($server_username))
+ $smarty->assign("PROXYUSER",$server_username);
if (isset($server_password))
$smarty->assign("PROXYPASSWORD",$server_password);
Modified: vtigercrm/branches/5.0.3/modules/Settings/Save.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Settings/Save.php (original)
+++ vtigercrm/branches/5.0.3/modules/Settings/Save.php Thu May 10 17:24:32 2007
@@ -31,7 +31,7 @@
$action = 'ProxyServerConfig&proxy_server_mode=edit';
if (!$sock =@fsockopen($server, $port, $errno, $errstr, 30))
{
- $error_str = 'error=Unable connect to "'.$server.':'.$port.'"';
+ $error_str = 'error=Unable to connect "'.$server.':'.$port.'"';
$db_update = false;
}else
{
@@ -79,20 +79,21 @@
ftp_close($conn_id);
}
}
+if($server_type == 'proxy' || $server_type == 'backup')
+{
+ if($db_update)
+ {
+ if($id=='')
+ {
+ $id = $adb->getUniqueID("vtiger_systems");
+ $sql="insert into vtiger_systems values(" .$id .",'".$server."','".$port."','".$server_username."','".$server_password."','".$server_type."','".$smtp_auth."')";
+ }
+ else
+ $sql="update vtiger_systems set server = '".$server."', server_username = '".$server_username."', server_password = '".$server_password."', smtp_auth='".$smtp_auth."', server_type = '".$server_type."',server_port='".$port."' where id = ".$id;
-if($db_update)
-{
- if($id=='')
- {
- $id = $adb->getUniqueID("vtiger_systems");
- $sql="insert into vtiger_systems values(" .$id .",'".$server."','".$port."','".$server_username."','".$server_password."','".$server_type."','".$smtp_auth."')";
+ $adb->query($sql);
}
- else
- $sql="update vtiger_systems set server = '".$server."', server_username = '".$server_username."', server_password = '".$server_password."', smtp_auth='".$smtp_auth."', server_type = '".$server_type."',server_port='".$port."' where id = ".$id;
-
- $adb->query($sql);
}
-
//Added code to send a test mail to the currently logged in user
if($server_type != 'backup' && $server_type != 'proxy')
{
@@ -115,10 +116,23 @@
$error_str = getMailErrorString($mail_status_str);
$action = 'EmailConfig';
if($mail_status != 1)
- $action = 'EmailConfig&emailconfig_mode=edit';
+ $action = 'EmailConfig&emailconfig_mode=edit&server_name='.$_REQUEST['server'].'&server_user='.$_REQUEST['server_username'].'&auth_check='.$_REQUEST['smtp_auth'];
+ else{
+ if($db_update)
+ {
+ if($id=='')
+ {
+ $id = $adb->getUniqueID("vtiger_systems");
+ $sql="insert into vtiger_systems values(" .$id .",'".$server."','".$port."','".$server_username."','".$server_password."','".$server_type."','".$smtp_auth."')";
+ }
+ else
+ $sql="update vtiger_systems set server = '".$server."', server_username = '".$server_username."', server_password = '".$server_password."', smtp_auth='".$smtp_auth."', server_type = '".$server_type."',server_port='".$port."' where id = ".$id;
+ $adb->query($sql);
+ }
+ }
}
//While configuring Proxy settings, the submitted values will be retained when exception is thrown - dina
-if($server_type == 'proxy' && $error_str == 'error=LBL_PROXY_AUTHENTICATION_REQUIRED')
+if($server_type == 'proxy' && $error_str != '')
{
header("Location: index.php?module=Settings&parenttab=Settings&action=$action&server=$server&port=$port&server_username=$server_username&$error_str");
}
Modified: vtigercrm/branches/5.0.3/modules/Settings/language/en_us.lang.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Settings/language/en_us.lang.php (original)
+++ vtigercrm/branches/5.0.3/modules/Settings/language/en_us.lang.php Thu May 10 17:24:32 2007
@@ -895,7 +895,7 @@
//5.0.3 fixes
'LBL_TESTMAILSTATUS'=>'Test Mail Status : ',
'LBL_CHECK_ASSIGNEDTO_MAILID'=>'Please check the assigned-to emailid',
-'LBL_MAILSENDERROR'=>'Mail could not be sent to the admin user. Please check the admin emailid',
+'LBL_MAILSENDERROR'=>'Mail could not be sent to the admin user. Please check the admin emailid/Server settings',
'LBL_RECORD_NOEXIST'=>'Record not present',
'LBL_ENTER_PROFILE'=>'Enter Profile Name',
'LBL_ENABLE'=>'Enable',
More information about the vtigercrm-commits
mailing list