Răsfoiți Sursa

Merge branch 'main' into feature/logging

Kristan Kenney 5 ani în urmă
părinte
comite
11c0fbe603

+ 0 - 98
bin/v-add-sys-theme

@@ -1,98 +0,0 @@
-#!/bin/bash
-# info: install theme from local source or GitHub.
-# options: THEME [MODE] [ACTIVE]
-# labels: hestia
-#
-# example: v-add-sys-theme myTheme local 
-#
-# The function for installing a custom theme or downloading one
-# from the HestiaCP theme repository.
-# For more info see https://docs.hestiacp.com/customize_hestia.html
-
-
-#----------------------------------------------------------#
-#                    Variable&Function                     #
-#----------------------------------------------------------#
-
-# Argument definition
-theme=$1
-mode=$2
-active=$3
-
-# Includes
-source $HESTIA/func/main.sh
-source $HESTIA/conf/hestia.conf
-
-# Define themes repository URL format
-HESTIA_THEMES_REPO="$HESTIA_GIT_REPO/$RELEASE_BRANCH/install/deb/themes"
-
-# Perform verification if read-only mode is enabled
-check_hestia_demo_mode
-
-#----------------------------------------------------------#
-#                       Action                             #
-#----------------------------------------------------------#
-
-# Fallback to downloading from GitHub if no mode specified
-if [ -z "$mode" ]; then
-    mode="git"
-fi
-
-# Initialize local directory if it does not exist
-if [ ! -d "$HESTIA_THEMES_CUSTOM" ]; then
-    mkdir -p $HESTIA_THEMES_CUSTOM
-fi
-
-# Abort if no theme name specified
-if [ -z "$theme" ]; then
-    echo "ERROR: No theme name specified."
-    echo "Usage: v-add-sys-theme theme [GIT | LOCAL] [ACTIVE]"
-    echo "       theme: name of the theme to install."
-    echo "       active: Set downloaded theme as active (optional)"
-
-    exit 1
-fi
-
-# Check if theme name already exists as system theme
-if [ -e $HESTIA_THEMES/$theme.css ]; then
-    echo "ERROR: System theme with the same name already exists: $theme."
-    exit 1
-fi
-
-# Prompt to replace existing theme if detected
-if [ -e $HESTIA_THEMES_CUSTOM/$theme.css ]; then
-    echo "WARNING: Theme file $theme.css already exists."
-    read -p "Would you like to replace it? [Y/N] " replace_theme
-
-    if [ "$replace_theme" = "N" ] || [ "$replace_theme" = "n" ]; then
-        exit 1
-    fi
-fi
-
-# Install theme from GitHub repository
-if [ "$mode" = "git" ]; then
-    # Check if it's a valid file first
-    theme_check=$(curl -s --head -w %{http_code} $HESTIA_THEMES_REPO/$theme.css -o /dev/null)
-    if [ $theme_check -ne "200" ]; then
-        echo "Error: invalid theme name specified."
-        exit 1
-    fi
-
-    # Download the theme file from Git
-    echo "Downloading and installing theme: $theme..."
-    wget $HESTIA_THEMES_REPO/$theme.css -O $HESTIA_THEMES_CUSTOM/$theme.css > /dev/null 2>&1
-fi
-
-if [ "$mode" = "local" ]; then
-    read -p "Please enter the full path to the CSS file to import: " theme_path
-    cp -f $theme_path $HESTIA_THEMES_CUSTOM/
-fi
-
-# Set active theme
-$BIN/v-change-sys-theme $theme
-
-#----------------------------------------------------------#
-#                       Hestia                             #
-#----------------------------------------------------------#
-
-exit

+ 1 - 0
bin/v-change-sys-api

@@ -44,6 +44,7 @@ if [ "$status" = "enable" ]; then
 else
 else
     if [ $API = "yes" ]; then
     if [ $API = "yes" ]; then
         $HESTIA/bin/v-change-sys-config-value "API" "no"
         $HESTIA/bin/v-change-sys-config-value "API" "no"
+        $HESTIA/bin/v-change-sys-config-value "API_ALLOWED_IP" ""
         sed -i 's|//die("Error: Disabled");|die("Error: Disabled");|g' $HESTIA/web/api/index.php
         sed -i 's|//die("Error: Disabled");|die("Error: Disabled");|g' $HESTIA/web/api/index.php
     fi
     fi
 fi
 fi

+ 0 - 63
bin/v-change-sys-theme

@@ -1,63 +0,0 @@
-#!/bin/bash
-# info: update web templates
-# options: THEME
-# labels: hestia
-#
-# The function for changing the currently active system theme.
-
-#----------------------------------------------------------#
-#                    Variable&Function                     #
-#----------------------------------------------------------#
-
-# Argument definition
-theme=$1
-
-# Includes
-source $HESTIA/func/main.sh
-source $HESTIA/conf/hestia.conf
-
-
-#----------------------------------------------------------#
-#                    Verifications                         #
-#----------------------------------------------------------#
-
-# Perform verification if read-only mode is enabled
-check_hestia_demo_mode
-
-
-#----------------------------------------------------------#
-#                       Action                             #
-#----------------------------------------------------------#
-
-# Initialize local directory if it does not exist
-if [ ! -d "$HESTIA_THEMES_CUSTOM" ]; then
-    mkdir -p $HESTIA_THEMES_CUSTOM
-fi
-
-# Theme argument and file detection
-if [ -z "$theme" ]; then
-    echo "ERROR: No theme specified."
-    exit 1
-else
-    if [ -e "$HESTIA_THEMES/$theme.css" ]; then
-        theme_conf="$HESTIA_THEMES/$theme.css"
-    elif [ -e "$HESTIA_THEMES_CUSTOM/$theme.css" ]; then
-        theme_conf="$HESTIA_THEMES_CUSTOM/$theme.css"
-    else
-        echo "ERROR: Unable to locate specified theme."
-        exit 1
-    fi
-
-    # Replace theme override file
-    rm -f $HESTIA/web/css/active-theme.css
-    cp -f $theme_conf $HESTIA/web/css/active-theme.css
-
-    # Set default theme in configuration file
-    $BIN/v-change-sys-config-value 'THEME' $theme
-fi
-
-#----------------------------------------------------------#
-#                       Hestia                             #
-#----------------------------------------------------------#
-$BIN/v-log-action "system" "Info" "System" "System theme changed (Theme: $theme)."
-exit

+ 0 - 64
bin/v-delete-sys-theme

@@ -1,64 +0,0 @@
-#!/bin/bash
-# info: removes a theme from the custom theme library
-# options: theme
-# labels: hestia
-#
-# example: v-delete-sys-theme dark
-#
-# The function removes a theme from the custom theme library. 
-# Please note "default" theme can't be deleted due to dependencies for other themes
-
-
-#----------------------------------------------------------#
-#                    Variable&Function                     #
-#----------------------------------------------------------#
-
-# Argument definition
-theme=$1
-
-# Includes
-source $HESTIA/func/main.sh
-source $HESTIA/conf/hestia.conf
-
-#----------------------------------------------------------#
-#                    Verifications                         #
-#----------------------------------------------------------#
-
-# Perform verification if read-only mode is enabled
-check_hestia_demo_mode
-#----------------------------------------------------------#
-#                       Action                             #
-#----------------------------------------------------------#
-
-if [ -z "$theme" ]; then
-    # Theme not specified, throw an error.
-    echo "ERROR: No theme specified."
-    exit 1
-else
-    if [ -e $HESTIA_THEMES/$theme.css ]; then
-        # Protect system themes from deletion
-        # Users can use the terminal to work around this if really desired.
-        echo "ERROR: Unable to delete system theme: $theme."
-        exit 1
-    fi
-    if [ -e $HESTIA_THEMES_CUSTOM/$theme.css ]; then
-        # Remove theme if it exists.
-        echo "Deleting $theme..."
-        rm -f $HESTIA_THEMES_CUSTOM/$theme.css > /dev/null 2&>1
-    else
-        # Theme doesn't exist, throw an error.
-        echo "ERROR: Theme $theme does not exist."
-    fi
-fi
-
-# Set default theme in configuration file if deleted theme was active
-if [ "$THEME" = "$theme" ]; then
-    rm -f $HESTIA/web/css/active-theme.css
-    $BIN/v-change-sys-config-value 'THEME' default
-fi
-
-#----------------------------------------------------------#
-#                       Hestia                             #
-#----------------------------------------------------------#
-
-exit

+ 21 - 41
bin/v-list-sys-themes

@@ -22,63 +22,40 @@ source $HESTIA/conf/hestia.conf
 
 
 # JSON list function
 # JSON list function
 json_list() {
 json_list() {
-    object1=$(echo "$themes" |wc -w)
-    object2=$(echo "$themes_custom" |wc -w)
     i=1
     i=1
     echo '['
     echo '['
-    for theme in $themes; do
-        if [ "$i" -lt "$object1" ]; then
+    for theme in "${available_themes[@]}"; do
+        if [ "$i" -lt "$theme_count" ]; then
             echo -e  "\t\"$theme\","
             echo -e  "\t\"$theme\","
         else
         else
-            if [ $object2 -gt 0 ]; then
-                echo -e  "\t\"$theme\","
-            else
-                echo -e  "\t\"$theme\""            
-            fi
+            echo -e  "\t\"$theme\""
         fi
         fi
         (( ++i))
         (( ++i))
     done
     done
-    for custom_theme in $themes_custom; do
-        if [ "$i" -lt "$object2" ]; then
-            echo -e  "\t\"$custom_theme\","
-        else
-            echo -e  "\t\"$custom_theme\""
-        fi
-        (( ++i))
-    done
-    echo "]"
+    echo ']'
 }
 }
 
 
 # SHELL list function
 # SHELL list function
 shell_list() {
 shell_list() {
     echo "THEME"
     echo "THEME"
-    echo "------"
-    for theme in $themes; do
-        echo "$theme"
-    done
-    for custom_theme in $themes_custom; do
-        echo "$custom_theme"
+    echo "-----"
+    for theme in "${available_themes[@]}"; do
+        echo $theme
     done
     done
 }
 }
 
 
 # PLAIN list function
 # PLAIN list function
 plain_list() {
 plain_list() {
-    for theme in $themes; do
-        echo "$theme"
-    done
-    for custom_theme in $themes_custom; do
-        echo "$custom_theme"
+    for theme in "${available_themes[@]}"; do
+        echo $theme
     done
     done
 }
 }
 
 
 # CSV list function
 # CSV list function
 csv_list() {
 csv_list() {
     echo "THEME"
     echo "THEME"
-    for theme in $themes; do
-        echo "$theme"
-    done
-    for custom_theme in $themes_custom; do
-        echo "$custom_theme"
+    for theme in "${available_themes[@]}"; do
+        echo $theme
     done
     done
 }
 }
 
 
@@ -87,16 +64,19 @@ csv_list() {
 #                       Action                             #
 #                       Action                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
-# Parsing templates
+# Parse system provided themes
+provided_themes=$(ls -v $HESTIA/web/css/themes | grep '\.min.css' | sed 's/\.min.css$//')
 
 
-# System provided themes
-themes=$(ls -v $HESTIA_THEMES/)
-themes=$(echo "$themes" | grep '\.css' | sed 's/\.css$//')
+# Parse custom themes
+custom_themes=$(ls -v $HESTIA/web/css/themes/custom/ | grep '\.css' | sed 's/\.css$//')
 
 
-# Custom themes
-themes_custom=$(ls -v $HESTIA_THEMES_CUSTOM/)
-themes_custom=$(echo "$themes_custom" | grep '\.css' | sed 's/\.css$//')
+# Create array with all available themes
+for theme in $provided_themes $custom_themes; do
+    available_themes=(${available_themes[@]} $theme)
+done
 
 
+# Get count of themes (for proper JSON formatting)
+theme_count="${#available_themes[@]}"
 
 
 # Listing data
 # Listing data
 case $format in
 case $format in

+ 2 - 2
func/main.sh

@@ -16,8 +16,8 @@ DNSTPL=$HESTIA/data/templates/dns
 RRD=$HESTIA/web/rrd
 RRD=$HESTIA/web/rrd
 SENDMAIL="$HESTIA/web/inc/mail-wrapper.php"
 SENDMAIL="$HESTIA/web/inc/mail-wrapper.php"
 HESTIA_GIT_REPO="https://raw.githubusercontent.com/hestiacp/hestiacp"
 HESTIA_GIT_REPO="https://raw.githubusercontent.com/hestiacp/hestiacp"
-HESTIA_THEMES="$HESTIA_INSTALL_DIR/themes"
-HESTIA_THEMES_CUSTOM="$HESTIA/data/templates/themes"
+HESTIA_THEMES="$HESTIA/web/css/themes"
+HESTIA_THEMES_CUSTOM="$HESTIA/web/css/themes/custom"
 SCRIPT="$(basename $0)"
 SCRIPT="$(basename $0)"
 
 
 # Return codes
 # Return codes

+ 4 - 11
func/upgrade.sh

@@ -69,7 +69,7 @@ upgrade_health_check() {
     # Theme
     # Theme
     if [ -z "$THEME" ]; then 
     if [ -z "$THEME" ]; then 
         echo "[ ! ] Adding missing variable to hestia.conf: THEME ('default')"
         echo "[ ! ] Adding missing variable to hestia.conf: THEME ('default')"
-        $BIN/v-change-sys-theme 'default'
+        $BIN/v-change-sys-config-value 'THEME' 'default'
     fi
     fi
 
 
     # Default language
     # Default language
@@ -151,8 +151,8 @@ upgrade_health_check() {
     fi    
     fi    
     # API Allowed IP
     # API Allowed IP
     if [ -z "$API_ALLOWED_IP" ]; then
     if [ -z "$API_ALLOWED_IP" ]; then
-        echo "[ ! ] Adding missing variable to hestia.conf: API_ALLOWED_IP ('')"        
-        $BIN/v-change-sys-config-value "API_ALLOWED_IP" "127.0.0.1"
+        echo "[ ! ] Adding missing variable to hestia.conf: API_ALLOWED_IP ('allow-all')"        
+        $BIN/v-change-sys-config-value "API_ALLOWED_IP" "allow-all"
     fi  
     fi  
     
     
     echo "[ * ] Health check complete. Starting upgrade from $VERSION to $new_version..."
     echo "[ * ] Health check complete. Starting upgrade from $VERSION to $new_version..."
@@ -690,6 +690,7 @@ disable_api(){
     if [ "$API" = "no" ]; then
     if [ "$API" = "no" ]; then
         echo "[ ! ] Disable Api..."
         echo "[ ! ] Disable Api..."
         sed -i 's|//die("Error: Disabled");|die("Error: Disabled");|g' $HESTIA/web/api/index.php
         sed -i 's|//die("Error: Disabled");|die("Error: Disabled");|g' $HESTIA/web/api/index.php
+        $HESTIA/bin/v-change-sys-config-value "API_ALLOWED_IP" ""
     fi
     fi
 }
 }
 upgrade_rebuild_web_templates() {
 upgrade_rebuild_web_templates() {
@@ -762,14 +763,6 @@ upgrade_rebuild_users() {
 }
 }
 
 
 upgrade_restart_services() {
 upgrade_restart_services() {
-    # Refresh user interface theme
-    if [ "$THEME" ]; then
-        if [ "$THEME" != "default" ]; then
-            echo "[ * ] Applying user interface updates..."
-            $BIN/v-change-sys-theme $THEME
-        fi
-    fi
-
     if [ "$UPGRADE_RESTART_SERVICES" = "true" ]; then
     if [ "$UPGRADE_RESTART_SERVICES" = "true" ]; then
         echo "[ * ] Restarting services..."
         echo "[ * ] Restarting services..."
         export restart="yes"
         export restart="yes"

+ 0 - 1
install/deb/themes/default.css

@@ -1 +0,0 @@
-/* This file left intentionally blank -- no overrides */

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

@@ -1091,6 +1091,9 @@ echo "LANGUAGE='$lang'" >> $HESTIA/conf/hestia.conf
 # Login in screen
 # Login in screen
 echo "LOGIN_STYLE='default'" >> $HESTIA/conf/hestia.conf
 echo "LOGIN_STYLE='default'" >> $HESTIA/conf/hestia.conf
 
 
+# Theme
+echo "THEME='dark'" >> $HESTIA/conf/hestia.conf
+
 # Inactive session timeout
 # Inactive session timeout
 echo "INACTIVE_SESSION_TIMEOUT='60'" >> $HESTIA/conf/hestia.conf
 echo "INACTIVE_SESSION_TIMEOUT='60'" >> $HESTIA/conf/hestia.conf
 
 
@@ -1773,9 +1776,6 @@ fi
 # Set backend port
 # Set backend port
 $HESTIA/bin/v-change-sys-port $port > /dev/null 2>&1
 $HESTIA/bin/v-change-sys-port $port > /dev/null 2>&1
 
 
-# Set default theme
-$HESTIA/bin/v-change-sys-theme 'dark'
-
 # Update remaining packages since repositories have changed
 # Update remaining packages since repositories have changed
 echo -ne "[ * ] Installing remaining software updates..."
 echo -ne "[ * ] Installing remaining software updates..."
 apt-get -qq update
 apt-get -qq update

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

@@ -1124,6 +1124,9 @@ echo "LANGUAGE='$lang'" >> $HESTIA/conf/hestia.conf
 # Login in screen
 # Login in screen
 echo "LOGIN_STYLE='default'" >> $HESTIA/conf/hestia.conf
 echo "LOGIN_STYLE='default'" >> $HESTIA/conf/hestia.conf
 
 
+# Theme
+echo "THEME='dark'" >> $HESTIA/conf/hestia.conf
+
 # Inactive session timeout
 # Inactive session timeout
 echo "INACTIVE_SESSION_TIMEOUT='60'" >> $HESTIA/conf/hestia.conf
 echo "INACTIVE_SESSION_TIMEOUT='60'" >> $HESTIA/conf/hestia.conf
 
 
@@ -1804,9 +1807,6 @@ fi
 # Set backend port
 # Set backend port
 $HESTIA/bin/v-change-sys-port $port > /dev/null 2>&1
 $HESTIA/bin/v-change-sys-port $port > /dev/null 2>&1
 
 
-# Set default theme
-$HESTIA/bin/v-change-sys-theme 'dark'
-
 # Update remaining packages since repositories have changed
 # Update remaining packages since repositories have changed
 echo -ne "[ * ] Installing remaining software updates..."
 echo -ne "[ * ] Installing remaining software updates..."
 apt-get -qq update
 apt-get -qq update

+ 2 - 1
web/api/index.php

@@ -45,8 +45,9 @@ function api($hst_hash, $hst_user, $hst_password, $hst_returncode, $hst_cmd, $hs
         echo 'Error: authentication failed';
         echo 'Error: authentication failed';
         exit;
         exit;
     }
     }
-    if ( $settings['config']['API_ALLOWED_IP'] != '' ){
+    if ( $settings['config']['API_ALLOWED_IP'] != 'allow-all' ){
         $ip_list = explode(',',$settings['config']['API_ALLOWED_IP']);
         $ip_list = explode(',',$settings['config']['API_ALLOWED_IP']);
+        $ip_list[] = '127.0.0.1';
         if ( !in_array(get_real_user_ip(), $ip_list)){
         if ( !in_array(get_real_user_ip(), $ip_list)){
            echo 'Error: authentication failed';
            echo 'Error: authentication failed';
            exit; 
            exit; 

+ 0 - 1
web/css/active-theme.css

@@ -1 +0,0 @@
-/* Theme override file -- will be replaced when theme is changed from default. */

+ 0 - 0
web/css/animate.min.css → web/css/dependencies/animate.min.css


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
web/css/dependencies/fontawesome.min.css


+ 0 - 0
web/css/jquery-custom-dialogs.css → web/css/dependencies/jquery-custom-dialogs.css


+ 0 - 0
web/css/src/animate.css → web/css/src/dependencies/animate.css


+ 0 - 0
install/deb/themes/dark.css → web/css/src/themes/dark.css


+ 28 - 24
web/css/src/styles.css → web/css/src/themes/default.css

@@ -8,8 +8,8 @@
   font-style: normal;
   font-style: normal;
   font-weight: 300;
   font-weight: 300;
   src: local('Exo Light'), local('Exo-Light'),
   src: local('Exo Light'), local('Exo-Light'),
-       url('../webfonts/exo-v8-latin-ext_latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
-       url('../webfonts/exo-v8-latin-ext_latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 }
 
 
 /* exo-300italic - latin-ext_latin */
 /* exo-300italic - latin-ext_latin */
@@ -18,8 +18,8 @@
   font-style: italic;
   font-style: italic;
   font-weight: 300;
   font-weight: 300;
   src: local('Exo Light Italic'), local('Exo-LightItalic'),
   src: local('Exo Light Italic'), local('Exo-LightItalic'),
-       url('../webfonts/exo-v8-latin-ext_latin-300italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
-       url('../webfonts/exo-v8-latin-ext_latin-300italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-300italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-300italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 }
 
 
 /* exo-regular - latin-ext_latin */
 /* exo-regular - latin-ext_latin */
@@ -28,8 +28,8 @@
   font-style: normal;
   font-style: normal;
   font-weight: 400;
   font-weight: 400;
   src: local('Exo Regular'), local('Exo-Regular'),
   src: local('Exo Regular'), local('Exo-Regular'),
-       url('../webfonts/exo-v8-latin-ext_latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
-       url('../webfonts/exo-v8-latin-ext_latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 }
 
 
 /* exo-italic - latin-ext_latin */
 /* exo-italic - latin-ext_latin */
@@ -38,8 +38,8 @@
   font-style: italic;
   font-style: italic;
   font-weight: 400;
   font-weight: 400;
   src: local('Exo Italic'), local('Exo-Italic'),
   src: local('Exo Italic'), local('Exo-Italic'),
-       url('../webfonts/exo-v8-latin-ext_latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
-       url('../webfonts/exo-v8-latin-ext_latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 }
 
 
 /* exo-500 - latin-ext_latin */
 /* exo-500 - latin-ext_latin */
@@ -48,8 +48,8 @@
   font-style: normal;
   font-style: normal;
   font-weight: 500;
   font-weight: 500;
   src: local('Exo Medium'), local('Exo-Medium'),
   src: local('Exo Medium'), local('Exo-Medium'),
-       url('../webfonts/exo-v8-latin-ext_latin-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
-       url('../webfonts/exo-v8-latin-ext_latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 }
 
 
 /* exo-500italic - latin-ext_latin */
 /* exo-500italic - latin-ext_latin */
@@ -58,8 +58,8 @@
   font-style: italic;
   font-style: italic;
   font-weight: 500;
   font-weight: 500;
   src: local('Exo Medium Italic'), local('Exo-MediumItalic'),
   src: local('Exo Medium Italic'), local('Exo-MediumItalic'),
-       url('../webfonts/exo-v8-latin-ext_latin-500italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
-       url('../webfonts/exo-v8-latin-ext_latin-500italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-500italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-500italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 }
 
 
 /* exo-600 - latin-ext_latin */
 /* exo-600 - latin-ext_latin */
@@ -68,8 +68,8 @@
   font-style: normal;
   font-style: normal;
   font-weight: 600;
   font-weight: 600;
   src: local('Exo SemiBold'), local('Exo-SemiBold'),
   src: local('Exo SemiBold'), local('Exo-SemiBold'),
-       url('../webfonts/exo-v8-latin-ext_latin-600.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
-       url('../webfonts/exo-v8-latin-ext_latin-600.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-600.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-600.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 }
 
 
 /* exo-600italic - latin-ext_latin */
 /* exo-600italic - latin-ext_latin */
@@ -78,8 +78,8 @@
   font-style: italic;
   font-style: italic;
   font-weight: 600;
   font-weight: 600;
   src: local('Exo SemiBold Italic'), local('Exo-SemiBoldItalic'),
   src: local('Exo SemiBold Italic'), local('Exo-SemiBoldItalic'),
-       url('../webfonts/exo-v8-latin-ext_latin-600italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
-       url('../webfonts/exo-v8-latin-ext_latin-600italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-600italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-600italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 }
 
 
 /* exo-700 - latin-ext_latin */
 /* exo-700 - latin-ext_latin */
@@ -88,8 +88,8 @@
   font-style: normal;
   font-style: normal;
   font-weight: 700;
   font-weight: 700;
   src: local('Exo Bold'), local('Exo-Bold'),
   src: local('Exo Bold'), local('Exo-Bold'),
-       url('../webfonts/exo-v8-latin-ext_latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
-       url('../webfonts/exo-v8-latin-ext_latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 }
 
 
 /* exo-700italic - latin-ext_latin */
 /* exo-700italic - latin-ext_latin */
@@ -98,8 +98,8 @@
   font-style: italic;
   font-style: italic;
   font-weight: 700;
   font-weight: 700;
   src: local('Exo Bold Italic'), local('Exo-BoldItalic'),
   src: local('Exo Bold Italic'), local('Exo-BoldItalic'),
-       url('../webfonts/exo-v8-latin-ext_latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
-       url('../webfonts/exo-v8-latin-ext_latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
+       url('../../webfonts/exo-v8-latin-ext_latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 }
 
 
 /* ==========================================================================
 /* ==========================================================================
@@ -111,8 +111,8 @@
 @font-face {
 @font-face {
   font-family: 'Inconsolata';
   font-family: 'Inconsolata';
   src: local('Inconsolata Bold'), local('Inconsolata-Bold'),
   src: local('Inconsolata Bold'), local('Inconsolata-Bold'),
-      url('../webfonts/Inconsolata-Bold.woff2') format('woff2'),
-      url('../webfonts/Inconsolata-Bold.woff') format('woff');
+      url('../../webfonts/Inconsolata-Bold.woff2') format('woff2'),
+      url('../../webfonts/Inconsolata-Bold.woff') format('woff');
   font-weight: bold;
   font-weight: bold;
   font-style: normal;
   font-style: normal;
 }
 }
@@ -121,8 +121,8 @@
 @font-face {
 @font-face {
   font-family: 'Inconsolata';
   font-family: 'Inconsolata';
   src: local('Inconsolata Regular'), local('Inconsolata-Regular'),
   src: local('Inconsolata Regular'), local('Inconsolata-Regular'),
-      url('../webfonts/Inconsolata-Regular.woff2') format('woff2'),
-      url('../webfonts/Inconsolata-Regular.woff') format('woff');
+      url('../../webfonts/Inconsolata-Regular.woff2') format('woff2'),
+      url('../../webfonts/Inconsolata-Regular.woff') format('woff');
   font-weight: normal;
   font-weight: normal;
   font-style: normal;
   font-style: normal;
 }
 }
@@ -1620,6 +1620,7 @@ div.l-content > div.l-separator:nth-of-type(4) {
 .table-header {
 .table-header {
   font-size: 0.95em !important;
   font-size: 0.95em !important;
   background: linear-gradient(to bottom, rgba(247,247,247,1) 0%,rgba(255,255,255,1) 100%) !important;
   background: linear-gradient(to bottom, rgba(247,247,247,1) 0%,rgba(255,255,255,1) 100%) !important;
+  background-color: #fff;
   border-left: 1px solid #d0d0d0 !important;
   border-left: 1px solid #d0d0d0 !important;
   border-right: 1px solid #d0d0d0 !important;
   border-right: 1px solid #d0d0d0 !important;
   border-bottom: 1px solid #d0d0d0 !important;
   border-bottom: 1px solid #d0d0d0 !important;
@@ -1636,6 +1637,9 @@ div.l-content > div.l-separator:nth-of-type(4) {
   overflow: hidden;
   overflow: hidden;
   line-height: 1rem;
   line-height: 1rem;
   margin-top: 1px;
   margin-top: 1px;
+  position: sticky;
+  top: 145px;
+  z-index: 100;
 }
 }
 
 
 .table-header:hover {
 .table-header:hover {

+ 0 - 0
install/deb/themes/flat.css → web/css/src/themes/flat.css


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
web/css/styles.min.css


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
web/css/themes/dark.min.css


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
web/css/themes/default.min.css


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
web/css/themes/flat.min.css


+ 22 - 15
web/edit/server/index.php

@@ -271,7 +271,7 @@ if (!empty($_POST['save'])) {
     // Update theme
     // Update theme
     if (empty($_SESSION['error_msg'])) {
     if (empty($_SESSION['error_msg'])) {
         if ($_POST['v_theme'] != $_SESSION['THEME']) {
         if ($_POST['v_theme'] != $_SESSION['THEME']) {
-            exec (HESTIA_CMD."v-change-sys-theme ".escapeshellarg($_POST['v_theme']), $output, $return_var);
+            exec (HESTIA_CMD."v-change-sys-config-value THEME ".escapeshellarg($_POST['v_theme']), $output, $return_var);
             check_return_code($return_var,$output);
             check_return_code($return_var,$output);
             unset($output);
             unset($output);
         }
         }
@@ -694,24 +694,16 @@ if (!empty($_POST['save'])) {
             $v_security_adv = 'yes';
             $v_security_adv = 'yes';
         }
         }
     }
     }
-    if (empty($_SESSION['error_msg'])) {
-        if ($_POST['v_api'] != $_SESSION['API']) {
-            $api_status = 'disable';
-            if ($_POST['v_api'] == 'yes'){
-                $api_status = 'enable';
-            }
-            exec (HESTIA_CMD."v-change-sys-api ".escapeshellarg($api_status), $output, $return_var);
-            check_return_code($return_var,$output);
-            unset($output);
-            if (empty($_SESSION['error_msg'])) $v_login_style = $_POST['v_api'];
-            $v_security_adv = 'yes';
-        }
-    }
+    
     if (empty($_SESSION['error_msg'])) {
     if (empty($_SESSION['error_msg'])) {
         if ($_POST['v_api_allowed_ip'] != $_SESSION['API_ALLOWED_IP']) {
         if ($_POST['v_api_allowed_ip'] != $_SESSION['API_ALLOWED_IP']) {
             $ips = array();
             $ips = array();
             foreach(explode("\n",$_POST['v_api_allowed_ip']) as $ip){ 
             foreach(explode("\n",$_POST['v_api_allowed_ip']) as $ip){ 
-                if(filter_var(trim($ip), FILTER_VALIDATE_IP)){
+                if ($ip != "allow-all") {
+                    if(filter_var(trim($ip), FILTER_VALIDATE_IP)){
+                        $ips[] = trim($ip);
+                    }
+                }else{
                     $ips[] = trim($ip);
                     $ips[] = trim($ip);
                 }
                 }
             }
             }
@@ -724,6 +716,21 @@ if (!empty($_POST['save'])) {
             }
             }
         }
         }
     }
     }
+    
+    if (empty($_SESSION['error_msg'])) {
+        if ($_POST['v_api'] != $_SESSION['API']) {
+            $api_status = 'disable';
+            if ($_POST['v_api'] == 'yes'){
+                $api_status = 'enable';
+            }
+            exec (HESTIA_CMD."v-change-sys-api ".escapeshellarg($api_status), $output, $return_var);
+            check_return_code($return_var,$output);
+            unset($output);
+            if (empty($_SESSION['error_msg'])) $v_login_style = $_POST['v_api'];
+            $v_security_adv = 'yes';
+        }
+    }
+
     // Update SSL certificate
     // Update SSL certificate
     if ((!empty($_POST['v_ssl_crt'])) && (empty($_SESSION['error_msg']))) {
     if ((!empty($_POST['v_ssl_crt'])) && (empty($_SESSION['error_msg']))) {
         if (($v_ssl_crt != str_replace("\r\n", "\n",  $_POST['v_ssl_crt'])) || ($v_ssl_key != str_replace("\r\n", "\n",  $_POST['v_ssl_key']))) {
         if (($v_ssl_crt != str_replace("\r\n", "\n",  $_POST['v_ssl_crt'])) || ($v_ssl_key != str_replace("\r\n", "\n",  $_POST['v_ssl_key']))) {

+ 11 - 5
web/templates/header.html

@@ -4,11 +4,17 @@
   <meta charset="utf-8">
   <meta charset="utf-8">
   <link rel="icon" href="/images/favicon.ico" type="image/x-icon">
   <link rel="icon" href="/images/favicon.ico" type="image/x-icon">
   <title><?php echo $_SERVER['HTTP_HOST']; ?> - <?=_($TAB)?> - <?=_('Hestia Control Panel');?></title>
   <title><?php echo $_SERVER['HTTP_HOST']; ?> - <?=_($TAB)?> - <?=_('Hestia Control Panel');?></title>
-  <link type="text/css" rel="stylesheet" href="/css/styles.min.css?<?=JS_LATEST_UPDATE?>" />
-  <link type="text/css" rel="stylesheet" href="/css/active-theme.css?<?php echo rand(); ?>" />
-  <link type="text/css" href="/css/animate.min.css?<?=JS_LATEST_UPDATE?>" rel="stylesheet" />
-  <link type="text/css" href="/css/jquery-custom-dialogs.css?<?=JS_LATEST_UPDATE?>" rel="stylesheet" />
-  <link type="text/css" href="/css/all.min.css?<?=JS_LATEST_UPDATE?>" rel="stylesheet" />
+  <!-- Load base theme-->
+  <link type="text/css" rel="stylesheet" href="/css/themes/default.min.css?<?=JS_LATEST_UPDATE?>" />
+  <? if ($_SESSION['THEME'] !== 'default') {?>
+    <!-- Load provided theme -->
+    <link type="text/css" rel="stylesheet" href="/css/themes/<?php echo $_SESSION['THEME']; ?>.min.css?<?php echo rand(); ?>" />
+    <!-- Load custom theme -->
+    <link type="text/css" rel="stylesheet" href="/css/themes/custom/<?php echo $_SESSION['THEME']; ?>.css?<?php echo rand(); ?>" />
+  <? } ?>
+  <link type="text/css" href="/css/dependencies/animate.min.css?<?=JS_LATEST_UPDATE?>" rel="stylesheet" />
+  <link type="text/css" href="/css/dependencies/jquery-custom-dialogs.css?<?=JS_LATEST_UPDATE?>" rel="stylesheet" />
+  <link type="text/css" href="/css/dependencies/fontawesome.min.css?<?=JS_LATEST_UPDATE?>" rel="stylesheet" />
   <script type="text/javascript" src="/inc/jquery/jquery-3.5.1.min.js"></script> 
   <script type="text/javascript" src="/inc/jquery/jquery-3.5.1.min.js"></script> 
   <script>
   <script>
     //
     //

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