  our $IMG_DIR    = 'images';
  our $CSS_FILE   = 'squidguardmgr.css';
  our $JS_FILE    = 'squidguardmgr.js';
-@@ -161,7 +211,7 @@
+@@ -161,7 +216,7 @@
  	if ($VIEW eq 'squid') {
  		if ($SQUID_WRAPPER) {
  			print "Running: $SQUID_WRAPPER ... \n";

 $VERSION     = '1.14',
 $AUTHOR      = 'Gilles DAROLD <gilles AT darold DOT net>';
 $COPYRIGHT   = 'Copyright &copy; 2010-2015 Gilles DAROLD, all rights reserved';
@@ -24,8 +75,8 @@
 my $SC_PROGRAM  = 'SquidClamav Manager';
 
 # Default SquidGuard installation path

 	}
 	$ACTION = '';
 }
@@ -928,7 +983,7 @@
 			map { s/^/\+/; } @add;
 			print OUT join("\n", @add), "\n";
 			close OUT;
-			print `$SQUIDGUARD -u $file.tmpdiff`;
+			print `su squid -c $SQUIDGUARD -u $file.tmpdiff`;
 			unlink("$file.tmpdiff");
 		} else {
 			&error("Can't open $file.tmpdiff for writing: $!<br>");
@@ -993,7 +1048,7 @@
 				map { s/^/\-/; } @removed;
 				print OUT join("\n", @removed), "\n";
 				close OUT;
-				print `$SQUIDGUARD -u $file.tmpdiff`;
+				print `su squid -c $SQUIDGUARD -u $file.tmpdiff`;
 				unlink("$file.tmpdiff");
 			} else {
 				&error("Can't open $file.tmpdiff for writing: $!");
@@ -2634,7 +2689,7 @@
 		# Create a diff file
 		if ($DIFF) {
 			`$DIFF -U 0 $CONFIG->{dbhome}/$bl $CONFIG->{dbhome}/$bl.tmp  | $GREP -v "^\@\@" | $GREP -v "^--- " | $GREP -v "^+++ " > $CONFIG->{dbhome}/$bl.tmpdiff`;
-			print `$SQUIDGUARD -u $CONFIG->{dbhome}/$bl.tmpdiff`;
+			print `su squid -c $SQUIDGUARD -u $CONFIG->{dbhome}/$bl.tmpdiff`;
 			# Save diff into the historical file.
 			if ($KEEP_DIFF) {
 				if (open(IN, "$CONFIG->{dbhome}/$bl.tmpdiff")) {
@@ -3586,9 +3641,9 @@
 	my $bl = shift;
 
 	if ($bl eq 'all') {
-		$ERROR = `$SQUIDGUARD -C all`;
+		$ERROR = `su squid -c SQUIDGUARD -C all`;
 	} else {
-		$ERROR = `$SQUIDGUARD -C $bl`;
+		$ERROR = `su squid -c $SQUIDGUARD -C $bl`;
 	}
 }
 
