Răsfoiți Sursa

Merge remote-tracking branch 'origin/main' into feature/osal

Ernesto Nicolás Carrea 5 ani în urmă
părinte
comite
376ce44ef3
38 a modificat fișierele cu 118 adăugiri și 184 ștergeri
  1. 5 0
      CHANGELOG.md
  2. 12 4
      README.md
  3. 4 0
      bin/v-add-firewall-ban
  4. 4 0
      bin/v-add-firewall-chain
  5. 2 0
      bin/v-change-sys-config-value
  6. 1 1
      bin/v-delete-domain
  7. 4 0
      bin/v-delete-firewall-ban
  8. 4 0
      bin/v-delete-firewall-chain
  9. 4 0
      bin/v-stop-firewall
  10. 3 0
      bin/v-unsuspend-cron-job
  11. 3 0
      bin/v-unsuspend-cron-jobs
  12. 4 0
      bin/v-update-firewall
  13. 18 0
      func/firewall.sh
  14. 2 2
      func/upgrade.sh
  15. 0 8
      install/deb/nginx/nginx.conf
  16. 1 1
      install/deb/templates/web/nginx/caching.stpl
  17. 1 1
      install/deb/templates/web/nginx/caching.tpl
  18. 0 19
      install/deb/templates/web/nginx/php-fpm/caching.sh
  19. 0 63
      install/deb/templates/web/nginx/php-fpm/caching.stpl
  20. 0 58
      install/deb/templates/web/nginx/php-fpm/caching.tpl
  21. 1 1
      install/hst-install-debian.sh
  22. 1 1
      install/hst-install-ubuntu.sh
  23. 1 1
      src/hst_autocompile.sh
  24. 5 2
      web/add/user/index.php
  25. 6 2
      web/edit/server/index.php
  26. 5 1
      web/edit/user/index.php
  27. 11 1
      web/inc/i18n.php
  28. BIN
      web/locale/de/LC_MESSAGES/hestiacp.mo
  29. BIN
      web/locale/en/LC_MESSAGES/hestiacp.mo
  30. BIN
      web/locale/es/LC_MESSAGES/hestiacp.mo
  31. BIN
      web/locale/ko/LC_MESSAGES/hestiacp.mo
  32. 0 0
      web/locale/languages.json
  33. BIN
      web/locale/nl/LC_MESSAGES/hestiacp.mo
  34. BIN
      web/locale/tr/LC_MESSAGES/hestiacp.mo
  35. 3 4
      web/templates/admin/add_user.html
  36. 6 6
      web/templates/admin/edit_server.html
  37. 4 4
      web/templates/admin/edit_user.html
  38. 3 4
      web/templates/user/edit_user.html

+ 5 - 0
CHANGELOG.md

@@ -27,6 +27,11 @@ All notable changes to this project will be documented in this file.
 - Fixed an issue in the Control Panel UI which caused databases and additional FTP accounts to be named incorrectly if manually prefaced with the username.
 - Fixed an issue where custom document roots were not saved correctly.
 - Improved the visibility of service availability in the Control Panel UI.
+- Fixed an issue which let you unsuspend a cronjob on active demo mode.
+- Updated DE, EN, ES, KO, NL and TR languages, thanks to @Wibol, Blackjack, @emrahkayihan, areo and @hahagu!
+- Fixed an issue which let the auto compiler fail with local src builds.
+- Added turkish language to system installers, thanks to @emrahkayihan!
+- Fixed incorrect error message when using unknown domain with v-delete-domain.
 
 ## [1.3.0] - Major Release (Feature / Quality Update)
 ### Features

+ 12 - 4
README.md

@@ -2,7 +2,7 @@
 
 [Hestia Control Panel](https://www.hestiacp.com/)
 ==================================================
-**Latest stable release:** Version 1.3.0 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md)<br>
+**Latest stable release:** Version 1.3.1 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md)<br>
 
 **Web:** [www.hestiacp.com](https://www.hestiacp.com/)<br>
 **Documentation:** [docs.hestiacp.com](https://docs.hestiacp.com/)<br>
@@ -19,7 +19,7 @@ Hestia Control Panel is designed to provide administrators an easy to use web an
 Features and Services
 ----------------------------
 * Apache2 and NGINX with PHP-FPM
-* Multiple PHP versions (5.6 - 7.4, 7.3 as default for optimal compatibility)
+* Multiple PHP versions (5.6 - 7.4, 7.4 as default)
 * DNS Server (Bind) with clustering capabilities
 * POP/IMAP/SMTP mail services with Anti-Virus, Anti-Spam, and Webmail (ClamAV, SpamAssassin, and Roundcube)
 * MariaDB or PostgreSQL databases
@@ -28,8 +28,8 @@ Features and Services
 
 Supported operating systems
 ----------------------------
-* Debian 10, 9
-* Ubuntu 20.04 LTS, 18.04 LTS, or 16.04 LTS
+* Debian 10, 9 (amd64 only)
+* Ubuntu 20.04 LTS, 18.04 LTS, or 16.04 LTS (amd64 only)
 * **NOTE:** Hestia Control Panel must be installed on top of a fresh operating system installation to ensure proper functionality.
 
 Installing Hestia Control Panel
@@ -65,6 +65,14 @@ bash hst-install.sh -h
 ```
 Alternatively, @gabizz has made available a command-line script generator at https://gabizz.github.io/hestiacp-scriptline-generator/ which allows you to easily generate the installation command via GUI.
 
+Installing Hestia Control Panel
+============================
+Updates of existing installations are performed by the Auto Updater. If you want to do this manually, you can do it via the apt package manager;
+```bash
+apt-get update
+apt-get upgrade
+```
+
 Issues
 =============================
 If you've run into a problem, [file a new issue report via GitHub](https://github.com/hestiacp/hestiacp/issues) so that we may investigate further.

+ 4 - 0
bin/v-add-firewall-ban

@@ -24,6 +24,7 @@ iptables="/sbin/iptables"
 
 # Includes
 source $HESTIA/func/main.sh
+source $HESTIA/func/firewall.sh
 source $HESTIA/conf/hestia.conf
 
 
@@ -43,6 +44,9 @@ check_hestia_demo_mode
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Self heal iptables links
+heal_iptables_links
+
 # Checking server ip
 if [ -e "$HESTIA/data/ips/$ip" ] || [ "$ip" = '127.0.0.1' ]; then
     exit

+ 4 - 0
bin/v-add-firewall-chain

@@ -32,6 +32,7 @@ fi
 
 # Includes
 source $HESTIA/func/main.sh
+source $HESTIA/func/firewall.sh
 source $HESTIA/conf/hestia.conf
 
 
@@ -50,6 +51,9 @@ check_hestia_demo_mode
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Self heal iptables links
+heal_iptables_links
+
 # Checking known chains
 case $chain in
     SSH)        # Get ssh port by reading ssh config file.

+ 2 - 0
bin/v-change-sys-config-value

@@ -23,6 +23,8 @@ source $HESTIA/conf/hestia.conf
 
 PATH="$PATH:/usr/local/sbin:/sbin:/usr/sbin:/root/bin"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                    Verifications                         #

+ 1 - 1
bin/v-delete-domain

@@ -71,7 +71,7 @@ fi
 
 # Checking domain search result
 if [ -z "$domain_found" ]; then
-    check_result $E_NOTEXISTS "domain $domain doesn't exist"
+    check_result $E_NOTEXIST "domain $domain doesn't exist"
 fi
 
 # Restarting services

+ 4 - 0
bin/v-delete-firewall-ban

@@ -24,6 +24,7 @@ iptables="/sbin/iptables"
 
 # Includes
 source $HESTIA/func/main.sh
+source $HESTIA/func/firewall.sh
 source $HESTIA/conf/hestia.conf
 
 
@@ -43,6 +44,9 @@ check_hestia_demo_mode
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Self heal iptables links
+heal_iptables_links
+
 # Checking ip in banlist
 conf="$HESTIA/data/firewall/banlist.conf"
 check_ip=$(grep "IP='$ip' CHAIN='$chain'" $conf 2>/dev/null)

+ 4 - 0
bin/v-delete-firewall-chain

@@ -23,6 +23,7 @@ iptables="/sbin/iptables"
 
 # Includes
 source $HESTIA/func/main.sh
+source $HESTIA/func/firewall.sh
 source $HESTIA/conf/hestia.conf
 
 
@@ -42,6 +43,9 @@ check_hestia_demo_mode
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Self heal iptables links
+heal_iptables_links
+
 # Deleting chain
 chains=$HESTIA/data/firewall/chains.conf
 banlist=$HESTIA/data/firewall/banlist.conf

+ 4 - 0
bin/v-stop-firewall

@@ -19,6 +19,7 @@ modprobe="/sbin/modprobe"
 # Includes
 source /etc/profile.d/hestia.sh
 source $HESTIA/func/main.sh
+source $HESTIA/func/firewall.sh
 source $HESTIA/conf/hestia.conf
 
 
@@ -36,6 +37,9 @@ check_hestia_demo_mode
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Self heal iptables links
+heal_iptables_links
+
 # Creating temporary file
 tmp=$(mktemp)
 

+ 3 - 0
bin/v-unsuspend-cron-job

@@ -32,6 +32,9 @@ is_object_valid 'user' 'USER' "$user"
 is_object_valid 'cron' 'JOB' "$job"
 is_object_suspended 'cron' 'JOB' "$job"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 3 - 0
bin/v-unsuspend-cron-jobs

@@ -29,6 +29,9 @@ check_args '1' "$#" 'USER [RESTART]'
 is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 4 - 0
bin/v-update-firewall

@@ -20,6 +20,7 @@ sysctl="/sbin/sysctl"
 # Includes
 source /etc/profile.d/hestia.sh
 source $HESTIA/func/main.sh
+source $HESTIA/func/firewall.sh
 source $HESTIA/conf/hestia.conf
 
 
@@ -34,6 +35,9 @@ is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Self heal iptables links
+heal_iptables_links
+
 # Checking local IPv4 rules
 rules="$HESTIA/data/firewall/rules.conf"
 

+ 18 - 0
func/firewall.sh

@@ -0,0 +1,18 @@
+
+heal_iptables_links() {
+    packages="iptables iptables-save iptables-restore"
+    for package in $packages; do
+        if [ ! -e "/sbin/${package}" ]; then
+            if which ${package}; then
+                ln -s "$(which ${package})" /sbin/${package}
+            elif [ -e "/usr/sbin/${package}" ]; then
+                ln -s /usr/sbin/${package} /sbin/${package}
+            elif whereis -B /bin /sbin /usr/bin /usr/sbin -f -b ${package}; then
+                autoiptables=$(whereis -B /bin /sbin /usr/bin /usr/sbin -f -b ${package} | cut -d '' -f 2)
+                if [ -x "$autoiptables" ]; then
+                    ln -s "$autoiptables" /sbin/${package}
+                fi
+            fi
+        fi
+    done
+}

+ 2 - 2
func/upgrade.sh

@@ -292,7 +292,7 @@ upgrade_send_notification_to_email () {
 
 upgrade_send_log_to_email() {
     if [ "$UPGRADE_SEND_EMAIL_LOG" = "true" ]; then
-        admin_email=$(v-list-user admin json | grep "CONTACT" | cut -d'"' -f4)
+        admin_email=$($BIN/v-list-user admin json | grep "CONTACT" | cut -d'"' -f4)
         send_mail="$HESTIA/web/inc/mail-wrapper.php"
         cat $LOG | $send_mail -s "Update Installation Log - v${new_version}" $admin_email
     fi
@@ -764,4 +764,4 @@ upgrade_restart_services() {
 upgrade_perform_cleanup() {
     # Remove upgrade configuration file as it's not needed
     rm -f $HESTIA_INSTALL_DIR/upgrade/upgrade.conf
-}
+}

+ 0 - 8
install/deb/nginx/nginx.conf

@@ -131,14 +131,6 @@ http {
     proxy_cache_use_stale error timeout invalid_header http_502;
     proxy_cache_valid any 1d;
 
-    # FastCGI Cache settings
-    fastcgi_cache_path /var/cache/nginx/php-fpm levels=2 keys_zone=cache:10m inactive=60m max_size=1024m;
-    fastcgi_cache_key "$host$request_uri $cookie_user";
-    fastcgi_temp_path  /var/cache/nginx/temp;
-    fastcgi_ignore_headers Expires Cache-Control;
-    fastcgi_cache_use_stale error timeout invalid_header;
-    fastcgi_cache_valid any 1d;
-
     # Cache bypass
     map $http_cookie $no_cache {
         default 0;

+ 1 - 1
install/deb/templates/web/nginx/caching.stpl

@@ -17,7 +17,7 @@ server {
     location / {
         proxy_pass      https://%ip%:%web_ssl_port%;
 
-        proxy_cache %domain%;
+        proxy_cache cache;
         proxy_cache_valid 15m;
         proxy_cache_valid 404 1m;
         proxy_no_cache $no_cache;

+ 1 - 1
install/deb/templates/web/nginx/caching.tpl

@@ -12,7 +12,7 @@ server {
     location / {
         proxy_pass      http://%ip%:%web_port%;
 
-        proxy_cache %domain%;
+        proxy_cache cache;
         proxy_cache_valid 15m;
         proxy_cache_valid 404 1m;
         proxy_no_cache $no_cache;

+ 0 - 19
install/deb/templates/web/nginx/php-fpm/caching.sh

@@ -1,19 +0,0 @@
-#!/bin/bash
-
-user=$1
-domain=$2
-ip=$3
-home=$4
-docroot=$5
-
-str="fastcgi_cache_path /var/cache/nginx/php-fpm/$domain levels=2" 
-str="$str keys_zone=$domain:10m inactive=60m max_size=512m;" 
-conf='/etc/nginx/conf.d/01_caching_pool.conf'
-if [ -e "$conf" ]; then
-    if [ -z "$(grep "=${domain}:" $conf)" ]; then
-        echo "$str" >> $conf
-    fi
-else
-    echo "$str" >> $conf
-fi
-

+ 0 - 63
install/deb/templates/web/nginx/php-fpm/caching.stpl

@@ -1,63 +0,0 @@
-#=======================================================================#
-# Default Web Domain Template                                           #
-# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
-#=======================================================================#
-
-server {
-    listen      %ip%:%web_ssl_port% ssl http2;
-    server_name %domain_idn% %alias_idn%;
-    root        %sdocroot%;
-    index       index.php index.html index.htm;
-    access_log  /var/log/nginx/domains/%domain%.log combined;
-    access_log  /var/log/nginx/domains/%domain%.bytes bytes;
-    error_log   /var/log/nginx/domains/%domain%.error.log error;
-
-    ssl_certificate      %ssl_pem%;
-    ssl_certificate_key  %ssl_key%;
-    ssl_stapling on;
-    ssl_stapling_verify on;
-
-    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
-
-    location / {
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-            fastcgi_hide_header "Set-Cookie";
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            include         /etc/nginx/fastcgi_params;
-
-            fastcgi_cache %domain%;
-            fastcgi_no_cache $no_cache;
-            fastcgi_cache_bypass $no_cache;
-            fastcgi_cache_bypass $cookie_session $http_x_update;
-        }
-    }
-
-    location /error/ {
-        alias   %home%/%user%/web/%domain%/document_errors/;
-    }
-
-    location ~* "/\.(htaccess|htpasswd)$" {
-        deny    all;
-        return  404;
-    }
-
-    location /vstats/ {
-        alias   %home%/%user%/web/%domain%/stats/;
-        include %home%/%user%/web/%domain%/stats/auth.conf*;
-    }
-
-    include     /etc/nginx/conf.d/phpmyadmin.inc*;
-    include     /etc/nginx/conf.d/phppgadmin.inc*;
-    include     %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
-}

+ 0 - 58
install/deb/templates/web/nginx/php-fpm/caching.tpl

@@ -1,58 +0,0 @@
-#=======================================================================#
-# Default Web Domain Template                                           #
-# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
-#=======================================================================#
-
-server {
-    listen      %ip%:%web_port%;
-    server_name %domain_idn% %alias_idn%;
-    root        %docroot%;
-    index       index.php index.html index.htm;
-    access_log  /var/log/nginx/domains/%domain%.log combined;
-    access_log  /var/log/nginx/domains/%domain%.bytes bytes;
-    error_log   /var/log/nginx/domains/%domain%.error.log error;
-        
-    include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
-
-    location / {
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-            fastcgi_hide_header "Set-Cookie";
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            include         /etc/nginx/fastcgi_params;
-
-            fastcgi_cache %domain%;
-            fastcgi_no_cache $no_cache;
-            fastcgi_cache_bypass $no_cache;
-            fastcgi_cache_bypass $cookie_session $http_x_update;
-        }
-    }
-
-    location /error/ {
-        alias   %home%/%user%/web/%domain%/document_errors/;
-    }
-
-    location ~* "/\.(htaccess|htpasswd)$" {
-        deny    all;
-        return  404;
-    }
-
-    location /vstats/ {
-        alias   %home%/%user%/web/%domain%/stats/;
-        include %home%/%user%/web/%domain%/stats/auth.conf*;
-    }
-
-    include     /etc/nginx/conf.d/phpmyadmin.inc*;
-    include     /etc/nginx/conf.d/phppgadmin.inc*;
-    include     %home%/%user%/conf/web/%domain%/nginx.conf_*;
-}

+ 1 - 1
install/hst-install-debian.sh

@@ -135,7 +135,7 @@ set_default_lang() {
         eval lang=$1
     fi
     lang_list="ar az bg bs cs da de el en es fa fi fr hr hu id it ja ka ko nl no pl pt pt-br ro
-        ru sr sv th uk ur vi zh-cn zh-tw"
+        ru sr sv th tr uk ur vi zh-cn zh-tw"
     if !(echo $lang_list |grep -w $lang > /dev/null 2>&1); then
         eval lang=$1
     fi

+ 1 - 1
install/hst-install-ubuntu.sh

@@ -117,7 +117,7 @@ set_default_lang() {
         eval lang=$1
     fi
     lang_list="ar az bg bs cs da de el en es fa fi fr hr hu id it ja ka ko nl no pl pt pt-br ro
-        ru sr sv th uk ur vi zh-cn zh-tw"
+        ru sr sv th tr uk ur vi zh-cn zh-tw"
     if !(echo $lang_list |grep -w $lang > /dev/null 2>&1); then
         eval lang=$1
     fi

+ 1 - 1
src/hst_autocompile.sh

@@ -276,7 +276,7 @@ NGINX='https://nginx.org/download/nginx-'$(echo $NGINX_V |cut -d"~" -f1)'.tar.gz
 OPENSSL='https://www.openssl.org/source/openssl-'$OPENSSL_V'.tar.gz'
 PCRE='https://ftp.pcre.org/pub/pcre/pcre-'$PCRE_V'.tar.gz'
 ZLIB='https://www.zlib.net/zlib-'$ZLIB_V'.tar.gz'
-PHP='http://de2.php.net/distributions/php-'$(echo $PHP_V |cut -d"-" -f1)'.tar.gz'
+PHP='http://de2.php.net/distributions/php-'$(echo $PHP_V |cut -d"~" -f1)'.tar.gz'
 
 # Forward slashes in branchname are replaced with dashes to match foldername in github archive.
 branch_dash=$(echo "$branch" |sed 's/\//-/g');

+ 5 - 2
web/add/user/index.php

@@ -123,8 +123,11 @@ unset($output);
 
 // List languages
 exec (HESTIA_CMD."v-list-sys-languages json", $output, $return_var);
-$languages = json_decode(implode('', $output), true);
-unset($output);
+$language = json_decode(implode('', $output), true);
+foreach($language as $lang){
+    $languages[$lang] = translate_json($lang);
+}
+asort($languages);
 
 // Render page
 render_page($user, $TAB, 'add_user');

+ 6 - 2
web/edit/server/index.php

@@ -91,9 +91,13 @@ $v_php_versions = array_map(function($php_version) use ($backend_templates, $bac
     return $phpinfo;
 }, $v_php_versions);
 
-// List supported languages
+// List languages
 exec (HESTIA_CMD."v-list-sys-languages json", $output, $return_var);
-$languages = json_decode(implode('', $output), true);
+$language = json_decode(implode('', $output), true);
+foreach($language as $lang){
+    $languages[$lang] = translate_json($lang);
+}
+asort($languages);
 unset($output);
 
 // List themes

+ 5 - 1
web/edit/user/index.php

@@ -70,7 +70,11 @@ unset($output);
 
 // List languages
 exec (HESTIA_CMD."v-list-sys-languages json", $output, $return_var);
-$languages = json_decode(implode('', $output), true);
+$language = json_decode(implode('', $output), true);
+foreach($language as $lang){
+    $languages[$lang] = translate_json($lang);
+}
+asort($languages);
 unset($output);
 
 // List shells

+ 11 - 1
web/inc/i18n.php

@@ -25,7 +25,17 @@ function detect_user_language() {
        return 'en';
    }
 }
-
+/**
+ * Translate ISO2 to "Language" 
+ * nl = Dutch, de = German
+ * @param string iso2 code
+ * @return string Language
+ */
+function translate_json($string){
+    $json = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/locale/languages.json');
+    $json_a = json_decode($json, true);
+    return $json_a[$string][0] .' ('.$json_a[$string.'_locale'][0].')';
+}
 /**
  * Detects user language .
  * @param string Fallback language (default: 'en')

BIN
web/locale/de/LC_MESSAGES/hestiacp.mo


BIN
web/locale/en/LC_MESSAGES/hestiacp.mo


BIN
web/locale/es/LC_MESSAGES/hestiacp.mo


BIN
web/locale/ko/LC_MESSAGES/hestiacp.mo


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
web/locale/languages.json


BIN
web/locale/nl/LC_MESSAGES/hestiacp.mo


BIN
web/locale/tr/LC_MESSAGES/hestiacp.mo


+ 3 - 4
web/templates/admin/add_user.html

@@ -154,13 +154,12 @@
                                     <select class="vst-list" name="v_language" tabindex="7" >
                                         <?php
                                             foreach ($languages as $key => $value) {
-                                                echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                $svalue = "'".$value."'";
-                                                if (( $value == $_SESSION['LANGUAGE'] ) && (empty($v_language))){
+                                                echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($key)."\"";
+                                                if (( $key == $_SESSION['LANGUAGE'] ) && (empty($v_language))){
                                                     echo ' selected' ;
                                                 }
                                                 if (isset($v_language)){
-                                                    if (( $value == $v_language ) || ( $svalue == $v_language)){
+                                                    if ( $key == $v_language ){
                                                         echo ' selected' ;
                                                     }
                                                 }

+ 6 - 6
web/templates/admin/edit_server.html

@@ -131,14 +131,14 @@
                                                 <select class="vst-list" name="v_language">
                                                     <?php
                                                         foreach ($languages as $key => $value) {
-                                                            echo "\t\t\t\t<option value=\"".$value."\"";
-                                                            if ((!empty($_SESSION['LANGUAGE'])) && ( $value == $_SESSION['LANGUAGE'])){
-                                                                echo ' selected' ;
+                                                            echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".$key."\"";
+                                                            if ( $key == $v_language ){
+                                                                echo 'selected' ;
                                                             }
-                                                            if ((!empty($_SESSION['LANGUAGE'])) && ( $value == $_POST['v_language'])){
-                                                                echo ' selected' ;
+                                                            if (( $key == detect_user_language() ) && (empty($v_language))){
+                                                                echo 'selected' ;
                                                             }
-                                                            echo ">".$value."</option>\n";
+                                                            echo ">".htmlentities($value)."</option>\n";
                                                         }
                                                     ?>
                                                 </select>

+ 4 - 4
web/templates/admin/edit_user.html

@@ -163,12 +163,12 @@
                                     <select class="vst-list" name="v_language">
                                         <?php
                                             foreach ($languages as $key => $value) {
-                                                echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".$value."\"";
-                                                $svalue = "'".$value."'";
-                                                if (( $value == $v_language ) || ( $svalue == $v_language)){
+                                                echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".$key."\"";
+                                                $skey = "'".$key."'";
+                                                if (( $key == $v_language ) || ( $skey == $v_language)){
                                                     echo 'selected' ;
                                                 }
-                                                if (( $value == detect_user_language() ) && (empty($v_language))){
+                                                if (( $key == detect_user_language() ) && (empty($v_language))){
                                                     echo 'selected' ;
                                                 }
                                                 echo ">".htmlentities($value)."</option>\n";

+ 3 - 4
web/templates/user/edit_user.html

@@ -127,12 +127,11 @@
                                     <select class="vst-list" name="v_language">
                                         <?php
                                             foreach ($languages as $key => $value) {
-                                                echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".$value."\"";
-                                                $svalue = "'".$value."'";
-                                                if (( $value == $v_language ) || ( $svalue == $v_language)){
+                                                echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".$key."\"";
+                                                if ( $key == $v_language ){
                                                     echo 'selected' ;
                                                 }
-                                                if (( $value == detect_user_language() ) && (empty($v_language))){
+                                                if (( $key == detect_user_language() ) && (empty($v_language))){
                                                     echo 'selected' ;
                                                 }
                                                 echo ">".htmlentities($value)."</option>\n";

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff