From: kink Date: Sun, 16 Dec 2007 15:24:23 +0000 (+0000) Subject: give an error when trying to enable a nonexistent plugin X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=fb98dfcfe85a44f48b4495a402f3871f8724e771;ds=sidebyside 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 --- 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) {