Skip to content

Commit

Permalink
v3.2.9 - Improve docs, improve quality, update KO language pack
Browse files Browse the repository at this point in the history
-v3.2.9.
-Happy Halloween!
  -I started this commit a couple months ago and just got around to finishing it.
  -The next commit will hopefully be a small quality commit / release v3.3.
-Fix missed translation in Arabic language pack (languageStrings.php) for Default GUI.
  -'Archive Formats'
-Fix spelling, consistency errors in comments of config.php.
  -No logical changes, just comments.
  -'fules' instead of 'files'.
  -Standardize some comments around the verbiage 'Provide users with the option to'. 
-Fix bug in verifyDocumentConversionEngine() function.
  -This bug would have prevented the verifyDocumentConversionEngine() function from starting anything.
  -This would cause document conversion errors in cases where the rc.local steps of the installation instructions were not implemented.
-Update it, ko, pt, ru, uk, zh language packs.
-Fix bug with displaying number of files that were uploaded.
  -Move logic that calculates this to before the languageStrings.php call.
-Fix bug in convertGui2.php where the download button would produce a 404 unless the share link had been generated already.
  -Missing ajax request type: post.
  • Loading branch information
zelon88 committed Oct 31, 2023
1 parent 92a1fa4 commit 09048d7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 24 deletions.
14 changes: 8 additions & 6 deletions config.php
@@ -1,7 +1,7 @@
<?php
// / -----------------------------------------------------------------------------------
// / APPLICATION INFORMATION ...
// / HRConvert2, Copyright on 5/3/2023 by Justin Grimes, www.github.com/zelon88
// / HRConvert2, Copyright on 10/30/2023 by Justin Grimes, www.github.com/zelon88
// /
// / LICENSE INFORMATION ...
// / This project is protected by the GNU GPLv3 Open-Source license.
Expand All @@ -12,7 +12,7 @@
// / on a server for users of any web browser without authentication.
// /
// / FILE INFORMATION ...
// / v3.2.8.
// / v3.2.9.
// / This file contains the configuration information for HRConvert2.
// / Fill out this file completely & accurately before running the application.
// / Serious filesystem damage could occur from incorrect directory settings.
Expand Down Expand Up @@ -64,7 +64,7 @@
// / Defalt is FALSE.
$VirusScan = FALSE;
// / --User Virus Scanning--
// / Give users the options to scan their uploaded files for viruses.
// / Provide users with options to scan their uploaded files for viruses.
// / Requires ClamAV to be installed on the server.
// / Set to TRUE to enable users to upload potentially infected files.
// / Set to FALSE to disable users uploading potentially infected files.
Expand All @@ -78,7 +78,7 @@
// / Default is TRUE.
$AllowUserVirusScan = TRUE;
// / --User Virus Scanning ScanCore Memory Limit--
// / The number of bytes of memory ScanCore is allowed to allocate to large fules during User Virus Scans.
// / The number of bytes of memory ScanCore is allowed to allocate to large files during User Virus Scans.
// / Files larger than this limit will be broken into chunks controlled by the --User Virus Scanning ScanCore Chunk Size-- config entry.
// / Default is 268435456.
$ScanCoreMemoryLimit = 268435456;
Expand Down Expand Up @@ -167,6 +167,7 @@
// / Default is Default.
$DefaultGui = 'Default';
// / --Allow User Selectable GUI--
// / Provide users with the option to adjust which GUI is displayed via appending a parameter to the URL.
// / Enable or disable dynamic GUI selection via the $_GET['gui'] variable.
// / If set to TRUE a user will be able to select different languages via $_GET['gui'].
// / If set to FALSE the $DefaultGui will always be used.
Expand All @@ -190,6 +191,7 @@
// / Default is en.
$DefaultLanguage = 'en';
// / --Allow User Selectable Language--
// / Provide users with the option to adjust which language is displayed via appending a parameter to the URL.
// / Enable or disable dynamic language selection via the $_GET['language'] variable.
// / If set to TRUE a user will be able to select different languages via $_GET['language'].
// / If set to FALSE the $DefaultLanguage will always be used.
Expand All @@ -199,7 +201,7 @@
// / Default is TRUE.
$AllowUserSelectableLanguage = TRUE;
// / --User Shareable File Links--
// / Allow users to generate shareable URLs for the files they upload or convert.
// / Provide users with the option to generate shareable URLs for the files they upload or convert.
// / If set to TRUE the user will be provided with buttons to create URLs to files that can be copied & pasted elsewhere.
// / If set to FALSE the user will not be provided with the buttons to create URLs to files.
// / Files with active links will be removed after the --File Deletion Age Threshold-- is met.
Expand All @@ -215,7 +217,7 @@
$SupportedConversionTypes = array('Document', 'Image', 'Model', 'Drawing', 'Video', 'Subtitle', 'Audio', 'Archive', 'Stream', 'OCR');
// / --File Deletion Age Theshold--
// / Age in minutes of files to be deleted.
// / Set to 0 to keep files indefinately.
// / Set to 0 to keep files forever.
// / Default is 30.
$DeleteThreshold = 30;
// / --Enhanced Logging Verbosity--
Expand Down
31 changes: 16 additions & 15 deletions convertCore.php
Expand Up @@ -2,7 +2,7 @@
<?php
// / -----------------------------------------------------------------------------------
// / APPLICATION INFORMATION ...
// / HRConvert2, Copyright on 5/3/2023 by Justin Grimes, www.github.com/zelon88
// / HRConvert2, Copyright on 10/30/2023 by Justin Grimes, www.github.com/zelon88
// /
// / LICENSE INFORMATION ...
// / This project is protected by the GNU GPLv3 Open-Source license.
Expand All @@ -13,7 +13,7 @@
// / on a server for users of any web browser without authentication.
// /
// / FILE INFORMATION ...
// / v3.2.8.
// / v3.2.9.
// / This file contains the core logic of the application.
// /
// / HARDWARE REQUIREMENTS ...
Expand Down Expand Up @@ -112,12 +112,11 @@ function verifyInstallation() {
else require_once ($ConfigFile);
if (!file_exists($VersionInfoFile)) die ('ERROR!!! HRConvert2-24000: Could not process the HRConvert2 Version Information file (versionInfo.php)!'.PHP_EOL.'<br />');
else require_once ($VersionInfoFile);

return array($InstallationIsVerified, $ConfigFile, $Version); }
// / -----------------------------------------------------------------------------------

// / -----------------------------------------------------------------------------------
// / A function to attempt to detect the users IP so it can be used as a unique identifier for the session.
// / A function to attempt to detect the users IP so it can be used as an identifier for the session.
function verifySession() {
// / Set variables.
$IP = '';
Expand Down Expand Up @@ -222,7 +221,7 @@ function verifyEncryption() {
// / -----------------------------------------------------------------------------------

// / -----------------------------------------------------------------------------------
// / A function to set or validates a Token so it can be used as a unique identifier for the session.
// / A function to set or validate a Token so it can be used as a unique identifier for the session.
function verifyTokens($Token1, $Token2) {
// / Verify variables.
global $Salts1, $Salts2, $Salts3, $Salts4, $Salts5, $Salts6;
Expand Down Expand Up @@ -418,7 +417,7 @@ function verifyGlobals() {
// / Set global variables to be used through the entire application.
global $URL, $URLEcho, $HRConvertVersion, $Date, $Time, $SesHash, $SesHash2, $SesHash3, $SesHash4, $CoreLoaded, $ConvertDir, $InstLoc, $ConvertTemp, $ConvertTempDir, $ConvertGuiCounter1, $DefaultApps, $RequiredDirs, $RequiredIndexes, $DangerousFiles, $Allowed, $ArchiveArray, $DearchiveArray, $DocumentArray, $SpreadsheetArray, $PresentationArray, $ImageArray, $MediaArray, $VideoArray, $StreamArray, $DrawingArray, $ModelArray, $SubtitleArray, $PDFWorkArr, $ConvertLoc, $DirSep, $SupportedConversionTypes, $Lol, $Lolol, $Append, $PathExt, $ConsolidatedLogFileName, $ConsolidatedLogFile, $Alert, $Alert1, $Alert2, $Alert3, $FCPlural, $FCPlural1, $FCPlural2, $FCPlural3, $UserClamLogFile, $UserClamLogFileName, $UserScanCoreLogFile, $UserScanCoreFileName, $SpinnerStyle, $SpinnerColor, $FullURL, $ServerRootDir, $StopCounter, $SleepTimer, $PermissionLevels, $ApacheUser, $File, $HeaderDisplayed, $UIDisplayed, $FooterDisplayed, $LanguageStringsLoaded, $GUIDisplayed, $Version, $FaviconPath, $DropzonePath, $DropzoneStylesheetPath, $StylesheetPath, $JsLibraryPath, $JqueryPath, $GUIDirection, $SupportedFormatCount, $GUIAlignment, $GreenButtonCode, $BlueButtonCode, $RedButtonCode, $DefaultButtonCode;
// / Application related variables.
$HRConvertVersion = 'v3.2.8';
$HRConvertVersion = 'v3.2.9';
$GlobalsAreVerified = FALSE;
$CoreLoaded = TRUE;
$StopCounter = $SleepTimer = 0;
Expand Down Expand Up @@ -494,7 +493,7 @@ function verifyGlobals() {
// / -----------------------------------------------------------------------------------

// / -----------------------------------------------------------------------------------
// / A function to sanitize & verifies an array of files.
// / A function to sanitize & verifie an array of files.
function getFiles($pathToFiles) {
// / Set variables.
global $DangerousFiles, $DirSep, $PathExt;
Expand Down Expand Up @@ -730,7 +729,7 @@ function verifyDocumentConversionEngine() {
$DocEnginePID = shell_exec('pgrep soffice.bin');
if ($Verbose) logEntry('The document conversion engine PID is: '.str_replace($Lol, '', str_replace($Lolol, $Lol, str_replace($Lolol, $Lol, trim($DocEnginePID)))));
// / Determine if the document conversion engine is already running.
if ($DocEnginePID === 0 && $DocEnginePID === '' && $DocEnginePID === NULL && !$DocEnginePID) {
if ($DocEnginePID === 0 or $DocEnginePID === '' or $DocEnginePID === NULL or !$DocEnginePID) {
// / Try to start the document conversion engine.
if ($Verbose)logEntry('Starting the document conversion engine.');
$returnData = shell_exec('/usr/bin/unoconv -l &');
Expand Down Expand Up @@ -1226,24 +1225,26 @@ function buildGUI($guiType, $ButtonCode) {
// / Set variables.
global $GuiFiles, $LanguageFiles, $LanguageStringsFile, $GuiHeaderFile, $GuiFooterFile, $GuiUI1File, $GuiUI2File, $CoreLoaded, $ConvertDir, $ConvertTempDir, $Token1, $Token2, $SesHash, $SesHash2, $SesHash3, $SesHash4, $Date, $Time, $TOSURL, $PPURL, $ShowFinePrint, $PDFWorkArr, $ArchiveArray, $DearchiveArray, $DocumentArray, $SpreadsheetArray, $ImageArray, $ModelArray, $DrawingArray, $VideoArray, $SubtitleArray, $StreamArray, $MediaArray, $PresentationArray, $ConvertGuiCounter1, $ConsolidatedLogFileName, $Alert, $Alert1, $Alert2, $Alert3, $FCPlural, $FCPlural1, $FCPlural2, $FCPlural3, $File, $Files, $FileCount, $SpinnerStyle, $SpinnerColor, $PacmanLoc, $Allowed, $AllowUserVirusScan, $AllowUserShare, $SupportedConversionTypes, $FullURL, $LanguageDir, $FaviconPath, $DropzonePath, $DropzoneStylesheetPath, $StylesheetPath, $JsLibraryPath, $JqueryPath, $GUIDirection, $SupportedFormatCount, $GUIAlignment, $HeaderDisplayed, $UIDisplayed, $FooterDisplayed, $LanguageStringsLoaded, $GUIDisplayed;
$guiUIFile = $GuiUI1File;
$Files = array();
$FileCount = 0;
// / Make sure the $guiType is valid.
if (!is_numeric($guiType)) {
if ($guiType < 0) $guiType = 0;
if ($guiType > 0) $guiType = 1; }
// / Determine which loading indicator to use.
$PacmanLoc = 'Resources/pacman'.$SpinnerStyle.strtolower($SpinnerColor).'.gif';
if (!file_exists($PacmanLoc)) $PacmanLoc = 'Resources/pacman1grey.gif';
// / Gather a list of files.
if ($guiType === 2) {
$Files = getFiles($ConvertDir);
$FileCount = count($Files); }
// / Load language specific GUI elements, if there are any.
if (in_array($LanguageStringsFile, $LanguageFiles)) require_once($LanguageStringsFile);
// / Load the header.
if (in_array($GuiHeaderFile, $GuiFiles)) require_once($GuiHeaderFile);
// / Build and define the different GUI types that are available.
if ($guiType === 1) $guiUIFile = $GuiUI1File;
if ($guiType === 2) {
// / Gather a list of files.
$Files = getFiles($ConvertDir);
$FileCount = count($Files);
$guiUIFile = $GuiUI2File; }
if ($guiType === 2) $guiUIFile = $GuiUI2File;
// / Build the specified GUI.
if (in_array($guiUIFile, $GuiFiles)) require_once($guiUIFile);
// / Load the footer.
Expand Down Expand Up @@ -2029,7 +2030,7 @@ function userVirusScan($FilesToScan, $type) {
if (!$ConsolidatedLogsExist) $ScanComplete = FALSE;
// / Manually clean up sensitive memory. Helps to keep track of variable assignments.
$fileToScan = $returnData = $path = $type = $scan1Complete = $scan1Errors = $scan2Complete = $scan2Errors = NULL;
unset($fileToScan, $returnData ,$path, $type, $scan1Complete, $scan1Errors, $scan2Complete, $scan2Errors, $txt);
unset($fileToScan, $returnData ,$path, $type, $scan1Complete, $scan1Errors, $scan2Complete, $scan2Errors);
return array($ScanComplete, $ScanErrors, $UserVirusFound); }
// / -----------------------------------------------------------------------------------

Expand Down Expand Up @@ -2074,7 +2075,7 @@ function userVirusScan($FilesToScan, $type) {
if (!$GlobalsAreVerified) errorEntry('Could not verify globals!', 11, TRUE);
else if ($Verbose) logEntry('Verified globals.');

// / The following code creates & verifies that required directories exist.
// / The following code verifies that required directories exist & creates them where needed.
list ($RequiredDirsExist, $RequiredDirs) = verifyRequiredDirs();
if (!$RequiredDirsExist) errorEntry('Could not verify required directories!', 12, TRUE);
else if ($Verbose) logEntry('Verified required directories.');
Expand Down
6 changes: 3 additions & 3 deletions versionInfo.php
@@ -1,7 +1,7 @@
<?php
// / -----------------------------------------------------------------------------------
// / APPLICATION INFORMATION ...
// / HRConvert2, Copyright on 5/3/2023 by Justin Grimes, www.github.com/zelon88
// / HRConvert2, Copyright on 10/30/2023 by Justin Grimes, www.github.com/zelon88
// /
// / LICENSE INFORMATION ...
// / This project is protected by the GNU GPLv3 Open-Source license.
Expand All @@ -12,7 +12,7 @@
// / on a server for users of any web browser without authentication.
// /
// / FILE INFORMATION ...
// / v3.2.8.
// / v3.2.9.
// / This file contains the current HRConvert2 version for update verification purposes.
// /
// / HARDWARE REQUIREMENTS ...
Expand All @@ -30,5 +30,5 @@

// / -----------------------------------------------------------------------------------
// / The version of this HRConvert2 installation.
$Version = 'v3.2.8';
$Version = 'v3.2.9';
// / -----------------------------------------------------------------------------------

0 comments on commit 09048d7

Please sign in to comment.