mirror of
https://github.com/openNDS/openNDS.git
synced 2026-01-10 04:17:55 -05:00
Add - Error page to status.client
Signed-off-by: Rob White <rob@blue-wave.net>
This commit is contained in:
@@ -28,6 +28,37 @@ do_ndsctl () {
|
||||
done
|
||||
}
|
||||
|
||||
urlencode() {
|
||||
entitylist="
|
||||
s/%/%25/g
|
||||
s/\s/%20/g
|
||||
s/\"/%22/g
|
||||
s/>/%3E/g
|
||||
s/</%3C/g
|
||||
s/'/%27/g
|
||||
s/\`/%60/g
|
||||
"
|
||||
local buffer="$1"
|
||||
|
||||
for entity in $entitylist; do
|
||||
urlencoded=$(echo "$buffer" | sed "$entity")
|
||||
buffer=$urlencoded
|
||||
done
|
||||
|
||||
urlencoded=$(echo "$buffer" | awk '{ gsub(/\$/, "\\%24"); print }')
|
||||
}
|
||||
|
||||
get_option_from_config() {
|
||||
|
||||
if [ ! -z "$1" ]; then
|
||||
param=$(/usr/lib/opennds/libopennds.sh get_option_from_config "$1")
|
||||
# urlencode
|
||||
urlencode "$param"
|
||||
param=$urlencoded
|
||||
eval $1="$param" &>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
get_client_zone () {
|
||||
# Gets the client zone, (if we don't already have it) ie the connection the client is using, such as:
|
||||
# local interface (br-lan, wlan0, wlan0-1 etc.,
|
||||
@@ -271,13 +302,24 @@ body() {
|
||||
fi
|
||||
|
||||
elif [ "$status" = "err511" ]; then
|
||||
get_option_from_config "fasremoteip"
|
||||
get_option_from_config "fasremotefqdn"
|
||||
|
||||
pagebody="
|
||||
<h1>To login, click or tap the Continue button</h1>
|
||||
<form action=\"$url/login\" method=\"get\" target=\"_self\">
|
||||
<input type=\"submit\" value=\"Continue\" >
|
||||
</form>
|
||||
"
|
||||
if [ -z "$fasremoteip" ] && [ -z "$fasremotefqdn" ]; then
|
||||
pagebody="
|
||||
<h1>ERROR: Remote Portal Not Defined or Not Available.</h1>
|
||||
<form action=\"$url/login\" method=\"get\" target=\"_self\">
|
||||
<input type=\"submit\" value=\"Retry\" >
|
||||
</form>
|
||||
"
|
||||
else
|
||||
pagebody="
|
||||
<h1>To login, click or tap the Continue button</h1>
|
||||
<form action=\"$url/login\" method=\"get\" target=\"_self\">
|
||||
<input type=\"submit\" value=\"Continue\" >
|
||||
</form>
|
||||
"
|
||||
fi
|
||||
|
||||
else
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user