[Vtigercrm-commits] [vtiger-commits] r7635 - /vtigercrm/trunk/modules/Settings/Save.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Wed Jun 28 09:30:15 EDT 2006


Author: saraj
Date: Wed Jun 28 07:30:11 2006
New Revision: 7635

Log:
changes made to save proxy setting info

Modified:
    vtigercrm/trunk/modules/Settings/Save.php

Modified: vtigercrm/trunk/modules/Settings/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/Save.php (original)
+++ vtigercrm/trunk/modules/Settings/Save.php Wed Jun 28 07:30:11 2006
@@ -12,6 +12,7 @@
 require_once("include/database/PearDatabase.php");
 
 $server=$_REQUEST['server'];
+$port=$_REQUEST['port'];
 $server_username=$_REQUEST['server_username'];
 $server_password=$_REQUEST['server_password'];
 $server_type = $_REQUEST['server_type'];
@@ -28,10 +29,10 @@
 if($id=='')
 {
 	$id = $adb->getUniqueID("systems");
-	$sql="insert into vtiger_systems values(" .$id .",'".$server."','".$server_username."','".$server_password."','".$server_type."','".$smtp_auth."')";
+	$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."' where id = ".$id;
+	$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);
 if($server_type == 'backup')
@@ -54,8 +55,22 @@
 		ftp_close($conn_id);
 	}
 }
+
+if($server_type == 'proxy')
+{
+	$action = 'ProxyServerConfig&proxy_server_mode=edit';
+	if (!$sock = fsockopen($server, $port, $errno, $errstr, 30))
+	{
+	       $error_str = $errstr.' : '.$errno ;
+	}else
+	{
+	       $action = 'ProxyServerConfig';
+	        fclose($sock);
+	}
+}
+
 //Added code to send a test mail to the currently logged in user
-if($server_type != 'backup')
+if($server_type != 'backup' && $server_type != 'proxy')
 {
 	require_once("modules/Emails/mail.php");
 	global $current_user;





More information about the vtigercrm-commits mailing list