Просмотр исходного кода

Fix #1529 (#1535)

Update all admin accounts to “Administrator”
Fix minor issue with mysql
Jaap Marcus 5 лет назад
Родитель
Сommit
b1f288f09a

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

@@ -1022,7 +1022,7 @@ if [ "$mysql" = 'yes' ]; then
 fi
 
 if [ "$postgresql" = 'yes' ]; then
-    installed_db_types="$installed_db_type,pgsql"
+    installed_db_types="$installed_db_types,pgsql"
 fi
 
 if [ ! -z "$installed_db_types" ]; then
@@ -1712,6 +1712,7 @@ check_result $? "can't enable sftp jail"
 $HESTIA/bin/v-add-user admin $vpass $email default "System Administrator"
 check_result $? "can't create admin user"
 $HESTIA/bin/v-change-user-shell admin nologin
+$HESTIA/bin/v-change-user-role admin admin
 $HESTIA/bin/v-change-user-language admin $lang
 
 # Roundcube permissions fix

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

@@ -1073,7 +1073,7 @@ if [ "$mysql" = 'yes' ]; then
 fi
 
 if [ "$postgresql" = 'yes' ]; then
-    installed_db_types="$installed_db_type,pgsql"
+    installed_db_types="$installed_db_types,pgsql"
 fi
 
 if [ ! -z "$installed_db_types" ]; then
@@ -1757,6 +1757,7 @@ check_result $? "can't enable sftp jail"
 $HESTIA/bin/v-add-user admin $vpass $email default "System Administrator"
 check_result $? "can't create admin user"
 $HESTIA/bin/v-change-user-shell admin nologin
+$HESTIA/bin/v-change-user-role admin admin
 $HESTIA/bin/v-change-user-language admin $lang
 
 # Configuring system IPs

+ 4 - 1
install/upgrade/versions/1.3.3.sh

@@ -13,4 +13,7 @@ if [ -e "/etc/nginx/nginx.conf" ]; then
         echo "[ * ] Updating Nginx to support fast cgi cache..."
         sed  -i 's/# Cache bypass/# FastCGI Cache settings\n    fastcgi_cache_path \/var\/cache\/nginx\/php-fpm levels=2\n    keys_zone=fcgi_cache:10m inactive=60m max_size=1024m;\n    fastcgi_cache_key \"$host$request_uri $cookie_user\";\n    fastcgi_temp_path  \/var\/cache\/nginx\/temp;\n    fastcgi_ignore_headers Expires Cache-Control;\n    fastcgi_cache_use_stale error timeout invalid_header;\n    fastcgi_cache_valid any 1d;\n\n    # Cache bypass/g' /etc/nginx/nginx.conf
     fi
-fi
+fi
+
+echo '[*] Set Role "Admin" to Administrator'
+$HESTIA/bin/v-change-user-role admin admin

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

@@ -163,7 +163,7 @@ if (!empty($_POST['save'])) {
         unset($output);
     }
     // Change Role (admin only)
-    if (($v_role != $_POST['$v_role']) && ($_SESSION['user'] == 'admin') && (empty($_SESSION['error_msg']))) {
+    if (($v_role != $_POST['$v_role']) && ($_SESSION['user'] == 'admin') && $v_username != "admin" && (empty($_SESSION['error_msg']))) {
         $v_role = escapeshellarg($_POST['v_role']);
         exec (HESTIA_CMD."v-change-user-role ".escapeshellarg($v_username)." ".$v_role, $output, $return_var);
         check_return_code($return_var,$output);