From fb98dfcfe85a44f48b4495a402f3871f8724e771 Mon Sep 17 00:00:00 2001 From: kink Date: Sun, 16 Dec 2007 15:24:23 +0000 Subject: [PATCH] give an error when trying to enable a nonexistent plugin through the conf.pl commandline, thanks Tomas Kuliavas. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12823 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- config/conf.pl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/config/conf.pl b/config/conf.pl index 191480e3..abeffb8d 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -482,9 +482,14 @@ $ask_user_info = 'true' if ( !$ask_user_info ); if ( $ARGV[0] eq '--install-plugin' ) { print "Activating plugin " . $ARGV[1] . "\n"; - push @plugins, $ARGV[1]; - save_data(); - exit(0); + if ( -d "../plugins/" . $ARGV[1]) { + push @plugins, $ARGV[1]; + save_data(); + exit(0); + } else { + print "No such plugin.\n"; + exit(1); + } } elsif ( $ARGV[0] eq '--remove-plugin' ) { print "Removing plugin " . $ARGV[1] . "\n"; foreach $plugin (@plugins) { -- 2.25.1