[Vtigercrm-commits] [vtiger-commits] r10069 - in /vtigercrm/branches/5.0.3/modules/Settings: language/en_us.lang.php savewordtemplate.php upload.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Jan 16 08:28:57 EST 2007
Author: richie
Date: Tue Jan 16 06:28:52 2007
New Revision: 10069
Log:
MailMerge template validation fix
Modified:
vtigercrm/branches/5.0.3/modules/Settings/language/en_us.lang.php
vtigercrm/branches/5.0.3/modules/Settings/savewordtemplate.php
vtigercrm/branches/5.0.3/modules/Settings/upload.php
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 Tue Jan 16 06:28:52 2007
@@ -878,6 +878,7 @@
'LBL_SELECT_ENTITY'=>'Select an entity below',
'LBL_CAN_BE_ACCESSED_BY'=>'Can be accessed by',
'LBL_PERMISSIONS'=>'Permissions',
-
+'LBL_DOC_MSWORD'=>'File has to be a Document of type doc/msword',
+'LBL_NODOC'=>'No doc File in this directory.Please try again!',
);
?>
Modified: vtigercrm/branches/5.0.3/modules/Settings/savewordtemplate.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Settings/savewordtemplate.php (original)
+++ vtigercrm/branches/5.0.3/modules/Settings/savewordtemplate.php Tue Jan 16 06:28:52 2007
@@ -26,8 +26,8 @@
$binFile .= ".txt";
}
$_FILES["binFile"]["name"] = $binFile;
+$strDescription = urlencode(addslashes($_REQUEST['txtDescription']));
// Vulnerability fix ends
-
if(move_uploaded_file($_FILES["binFile"]["tmp_name"],$uploaddir.$_FILES["binFile"]["name"]))
{
$binFile = $_FILES['binFile']['name'];
@@ -57,8 +57,7 @@
$data = base64_encode(fread(fopen($uploaddir.$binFile, "r"), $filesize));
//$data = addslashes(fread(fopen($uploaddir.$binFile, "r"), $filesize));
- $textDesc = $_REQUEST['txtDescription'];
- $strDescription = addslashes($textDesc);
+ //$textDesc = $_REQUEST['txtDescription'];
// $fileid = create_guid();
$date_entered = date('YmdHis');
//Retreiving the return module and setting the parent type
@@ -117,7 +116,15 @@
include "upload.php";
}
}
- }
+ }
+ //Added for Invaild file path
+ else
+ {
+ $module = $_REQUEST['target_module'];
+ header("Location: index.php?action=upload&module=Settings&parenttab=Settings&flag=2&description=".$strDescription."&tempModule=".$module);
+
+ }
+
}
else
{
Modified: vtigercrm/branches/5.0.3/modules/Settings/upload.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Settings/upload.php (original)
+++ vtigercrm/branches/5.0.3/modules/Settings/upload.php Tue Jan 16 06:28:52 2007
@@ -13,7 +13,7 @@
require_once('Smarty_setup.php');
require_once('include/database/PearDatabase.php');
require_once('include/utils/utils.php');
-require_once('modules/Users/add2db.php');
+require_once('modules/Settings/savewordtemplate.php');
global $app_strings;
global $mod_strings;
@@ -35,10 +35,14 @@
switch($flag)
{
case 1:
- $smarty->assign("ERRORFLAG","<font color='red'><B>File has to be a Document of type doc/msword</B></font>");
+ $smarty->assign("ERRORFLAG","<font color='red'>".$mod_strings['LBL_DOC_MSWORD']."</B></font>");
+ break;
+ case 2:
+ $smarty->assign("ERRORFLAG","<font color='red'>".$mod_strings['LBL_NODOC']."</B></font>");
break;
default:
$smarty->assign("ERRORFLAG","");
+ break;
}
}
More information about the vtigercrm-commits
mailing list