From 251225f671ce0d8d7da768c1862139af72c06d40 Mon Sep 17 00:00:00 2001
From: yogeshwar <yogeshwar.g@vtigersolutions.com>
Date: Thu, 6 Jun 2024 11:27:23 +0530
Subject: [PATCH] Settings_Modules

---
 include/utils/VtlibUtils.php     | 11 +++++++++++
 vtlib/thirdparty/dUnzip2.inc.php |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/include/utils/VtlibUtils.php b/include/utils/VtlibUtils.php
index 0ead91d7b..67b064cf5 100644
--- a/include/utils/VtlibUtils.php
+++ b/include/utils/VtlibUtils.php
@@ -1054,4 +1054,15 @@ function php7_htmlentities($str) {
 	return $str == null ? $str : htmlentities($str);
 }
 
+function vtlib_chmod($filepath,$mode){
+	$result = chmod($filepath, $mode);
+
+	if($result){
+		echo "Permission of $filepath have been changed";
+	}
+	else{
+		echo "Failed to change permission of $filepath";
+	}
+}
+
 
diff --git a/vtlib/thirdparty/dUnzip2.inc.php b/vtlib/thirdparty/dUnzip2.inc.php
index 24b3ab1f6..274d2a630 100644
--- a/vtlib/thirdparty/dUnzip2.inc.php
+++ b/vtlib/thirdparty/dUnzip2.inc.php
@@ -226,7 +226,7 @@ class dUnzip2{
 			);
 		if($applyChmod && $targetFileName) {
 			// TODO: check if this warning supression if its not working.
-			@chmod($targetFileName, $applyChmod == 0755? 0644 : $applyChmod);
+			vtlib_chmod($targetFileName, $applyChmod == 0755? 0644 : $applyChmod);
 		}
 		
 		return $ret;
-- 
GitLab