Browse Source

Merge branch 'main' into fix/ui-buttons

Kristan Kenney 5 years ago
parent
commit
e1015a843a

+ 5 - 2
bin/v-rename-package → bin/v-rename-user-package

@@ -29,9 +29,11 @@ source $HESTIA/conf/hestia.conf
 # Ensure that package names have been passed to the script.
 if [ -z "$old_name" ]; then
     echo "ERROR: Current package name not specified."
+    exit 1
 fi
 if [ -z "$new_name" ]; then
     echo "ERROR: New package name not specified."
+    exit 1
 fi
 
 # Perform verification if read-only mode is enabled
@@ -44,7 +46,7 @@ check_hestia_demo_mode
 
 if [ -e $HESTIA/data/packages/$old_name.pkg ]; then
     mv $HESTIA/data/packages/$old_name.pkg $HESTIA/data/packages/$new_name.pkg
-    echo "Successfully renamed $old_name to $new_name."
+    
 
     # Update package for existing users
     for user in `ls $HESTIA/data/users/`; do
@@ -54,6 +56,7 @@ if [ -e $HESTIA/data/packages/$old_name.pkg ]; then
             v-change-user-package $user $new_name
         fi
     done
+    echo "Successfully renamed package $old_name to $new_name."
 else
     echo "ERROR: Specified package not found."
 fi
@@ -64,7 +67,7 @@ fi
 #----------------------------------------------------------#
 
 # Logging
-log_history "renamed package $old_name to $new_name"
+log_history "renamed package $old_name to $new_name" '' 'admin'
 log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
install/upgrade/versions/1.4.0.sh

@@ -25,11 +25,11 @@ if [ "$MAIL_SYSTEM" == "exim4" ]; then
     echo "[ * ] Populating HELO/SMTP Banner param for existing IP's..."
     > /etc/exim4/mailhelo.conf
 
-    for ip in $(v-list-sys-ips plain | cut -f1); do
+    for ip in $($BIN/v-list-sys-ips plain | cut -f1); do
         helo=$(is_ip_rdns_valid $ip)
 
         if [ ! -z "$helo" ]; then
-            v-change-sys-ip-helo $ip $helo
+            $BIN/v-change-sys-ip-helo $ip $helo
         fi
     done
 

+ 8 - 1
src/deb/nginx/postinst

@@ -15,8 +15,15 @@ if [ ! -e "/usr/local/hestia/data/users/admin" ]; then
     exit
 fi
 
-# Load hestia.conf
+###############################################################
+#                Initialize functions/variables               #
+###############################################################
+
+# Load upgrade functions and variables
+source /usr/local/hestia/func/main.sh
+source /usr/local/hestia/func/upgrade.sh
 source /usr/local/hestia/conf/hestia.conf
+source /usr/local/hestia/install/upgrade/upgrade.conf
 
 # Reset backend port
 if [ ! -z "$BACKEND_PORT" ]; then

+ 10 - 0
src/deb/php/postinst

@@ -11,6 +11,16 @@ if [ ! -e "/usr/local/hestia/data/users/admin" ]; then
     exit
 fi
 
+###############################################################
+#                Initialize functions/variables               #
+###############################################################
+
+# Load upgrade functions and variables
+source /usr/local/hestia/func/main.sh
+source /usr/local/hestia/func/upgrade.sh
+source /usr/local/hestia/conf/hestia.conf
+source /usr/local/hestia/install/upgrade/upgrade.conf
+
 # Restart hestia service
 if [ -f "/etc/init.d/hestia" ]; then
     systemctl restart hestia > /dev/null 2>&1

+ 11 - 0
web/templates/admin/list_stats.html

@@ -4,6 +4,17 @@
               <a class="ui-button cancel" dir="ltr" href='/list/stats/'><i class="fas fa-info-circle status-icon lightblue"></i><?=_('Overall Statistics')?></a>
           </div>
         <div class="l-sort-toolbar clearfix">
+          <table>
+            <tr>
+                <td class="l-sort-toolbar__search-box">
+                    <form action="/search/" method="get">
+                      <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+                      <input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" />
+                      <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value=""><i class="fas fa-search"></i></button>
+                    </form>
+                  </td>
+            </tr>
+          </table>
           <table>
             <tr>
               <td>