-
-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
file manager languages - #4275 #4382
base: main
Are you sure you want to change the base?
Conversation
missing the optional include on file if(file_exists("../file_manager_languages.php")){
include_once("../file_manager_languages.php");
} before return $dist_config; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should move this function to
./web/fm/configuration.php
I don't see any reason to make it optional...
web/file_manager_languages.php
Outdated
* | ||
* @see https://docs.filegator.io/translations/default.html#rtl-support | ||
*/ | ||
switch (get_language_from_system()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SESSION['language'] is fine we should prefer the user language above server language...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that function exists solely to see if the session language is defined and if not, use "en"
it's optional because many systems don't have it yet, I'm just preventing future problems. I didn't saw where is the modified configuration on the install so I've put it there, with a direct include of |
… if session language is defined
where is the modified script of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think with the explanation inside the function, of the function, it should be easier to understand
web/file_manager_languages.php
Outdated
* - check if the session language exists | ||
* - check if language is supported by hestia, | ||
* - return default if both are false | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think with the explanation inside the function, of the function, it should be easier to understand,
Quote on quote:
/* I don't think I need to explain this */
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
/**
* Get all supported language
*/
exec(HESTIA_CMD . "v-list-sys-languages json", $output, $return_var);
$languages = json_decode(implode("", $output), true);
/**
* - check if the session language exists
* - check if language is supported by hestia,
* - return default if both are false
*/
return isset($_SESSION["language"]) && in_array($_SESSION["language"], $languages)
? $_SESSION["language"]
: "en";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$_SESSION language is always set if not they ar not logged into Hestia ....
All languages in $_SESSION['language'] is supported by Hestia as it is loaded from hestia.conf and if not it falls back to English anyway...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i can pentest for a non-existing language. but that function does what it needs to be done to prevent rouge authors from altering the language to an non-existing one.
All servers that have support if the have Filegator installed so it should not matter.. I don't see an reason to keep it optional...
/install/common/filegator/ if I am right |
I don't see that file there |
On /* 67 - 88 */ rm --recursive --force "$FM_INSTALL_DIR"
mkdir -p "$FM_INSTALL_DIR"
cd "$FM_INSTALL_DIR"
[ ! -f "${FM_INSTALL_DIR}/${FM_FILE}" ] && wget "$FM_URL" --quiet -O "${FM_INSTALL_DIR}/${FM_FILE}.zip"
unzip -qq "${FM_INSTALL_DIR}/${FM_FILE}.zip"
mv --force ${FM_INSTALL_DIR}/filegator/* "${FM_INSTALL_DIR}"
rm --recursive --force ${FM_INSTALL_DIR}/${FM_FILE}
[[ -f "${FM_INSTALL_DIR}/${FM_FILE}" ]] && rm "${FM_INSTALL_DIR}/${FM_FILE}"
cp --recursive --force ${HESTIA_INSTALL_DIR}/filemanager/filegator/* "${FM_INSTALL_DIR}"
chown $user: -R "${FM_INSTALL_DIR}"
if [ -z "$openssl_installed" ]; then
COMPOSER_HOME="$HOMEDIR/$user/.config/composer" user_exec /usr/bin/php $COMPOSER_BIN --quiet --no-dev install
else
COMPOSER_HOME="$HOMEDIR/$user/.config/composer" user_exec /usr/local/hestia/php/bin/php $COMPOSER_BIN --quiet --no-dev install
fi
/* 102 - 103 */ # Add configuration file
cp -f $HESTIA_INSTALL_DIR/filemanager/filegator/configuration.php $HESTIA/web/fm/configuration.php |
… file `file_manager_language.php` is removed
just a quick reminder, this pull request I think the user wants to sponsor #### Describe the feature or change in detail
Is it possible to do something so that Filegator follows the same language as HestiaCP?
#### Would you like to sponsor this feature to have it implemented?
Yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User wants to sponsor this feature. it's in the issue 4275
this file will tell the file manager what language to use, missing include in web/fm/configuration.php