From cf7ac033abed3fb70cf33839f266a3471f38dbc7 Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 24 Jun 2010 22:30:49 +0000 Subject: Provide some error messages when posting from a script so consumers can have a clue at what happened. --- usr/local/www/services_captiveportal_mac.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/services_captiveportal_mac.php b/usr/local/www/services_captiveportal_mac.php index 828c9e5..38989a5 100755 --- a/usr/local/www/services_captiveportal_mac.php +++ b/usr/local/www/services_captiveportal_mac.php @@ -68,12 +68,16 @@ if ($_POST) { } if ($_POST['postafterlogin']) { - if (!is_array($a_passthrumacs)) + if (!is_array($a_passthrumacs)) { + echo "No entry exists yet!\n"; exit; + } if ($_POST['username']) { $mac = captiveportal_passthrumac_findbyname($_POST['username']); if (!empty($mac)) $_POST['delmac'] = $mac['mac']; + else + echo "No entry exists for this username: {$_POST['username']}\n"; } if ($_POST['delmac']) { $found = false; @@ -91,7 +95,9 @@ if ($_POST) { } unset($a_passthrumacs[$idx]); write_config(); - } + echo "The entry was sucessfully deleted\n"; + } else + echo "No entry exists for this mac address: {$_POST['delmac']}\n"; } exit; } -- cgit v1.1