From 8b7a3c5a6b6ccc1cf6ed7f259f4a7996541fb0d2 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 24 May 2011 17:24:01 +0000 Subject: [PATCH] making it easier for totally dummy users --- lib/core/option.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index 47af9874d..2efdafc45 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1418,13 +1418,21 @@ def __useWizardInterface(): logger.info("starting wizard interface") - while not conf.url: - message = "Please enter full target URL (-u): " - conf.url = readInput(message, default=None) + while True: + while not conf.url: + message = "Please enter full target URL (-u): " + conf.url = readInput(message, default=None) - message = "POST data (--data) [Enter for None]: " - conf.data = readInput(message, default=None) + message = "POST data (--data) [Enter for None]: " + conf.data = readInput(message, default=None) + if any(filter(lambda x: '=' in str(x), [conf.url, conf.data])): + break + else: + conf.url = conf.data = None + warnMsg = "no testable parameter(s) found " + warnMsg += "(e.g. GET parameter 'id' in 'www.site.com/index.php?id=1')" + logger.critical(warnMsg) choice = None while choice is None or choice not in ("", "1", "2", "3"):