Compare commits

...

1 Commits

Author SHA1 Message Date
ljm42
b19ea66bcb Fix: error 500 on login 2024-05-13 10:11:17 -07:00

View File

@@ -311,6 +311,7 @@ if [ -e /etc/rc.d/rc.unraid-api ]; then
# restore stock files
FILE=/usr/local/emhttp/plugins/dynamix/DisplaySettings.page && [[ -f "$FILE-" ]] && mv -f "$FILE-" "$FILE"
FILE=/usr/local/emhttp/plugins/dynamix/Registration.page && [[ -f "$FILE-" ]] && mv -f "$FILE-" "$FILE"
FILE=/usr/local/emhttp/plugins/dynamix/include/.login.php && [[ -f "$FILE-" ]] && mv -f "$FILE-" "$FILE"
FILE=/usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php && [[ -f "$FILE-" ]] && mv -f "$FILE-" "$FILE"
FILE=/usr/local/emhttp/plugins/dynamix/include/UpdateDNS.php && [[ -f "$FILE-" ]] && mv -f "$FILE-" "$FILE"
FILE=/usr/local/emhttp/plugins/dynamix/include/Wrappers.php && [[ -f "$FILE-" ]] && mv -f "$FILE-" "$FILE"
@@ -728,6 +729,17 @@ if [[ "${CHANGED}" == "yes" ]]; then
fi
fi
# Fix long standing bug in login script
FILE=/usr/local/emhttp/plugins/dynamix/include/.login.php
if test -f "${FILE}" && grep -q 'if (file_exists($file)) {' "${FILE}" &>/dev/null; then
cp "$FILE" "$FILE-"
# Find this text: if (file_exists($file)) {
OLD='if \(file_exists\(\$file\)\) \{'
# Replace with: if (file_exists($file) && filesize($file) > 0) {
NEW='if \(file_exists\(\$file\) \&\& filesize\(\$file\) > 0\) \{'
sed -Ei "s#${OLD}#${NEW}#" "${FILE}"
fi
# Prevent web component file downgrade if the webgui version is newer than the plugin version
# Function to extract "ts" value from JSON file
extract_ts() {